]> git.baikalelectronics.ru Git - kernel.git/commit
bpftool: Use sysfs vmlinux when dumping BTF by ID
authorLarysa Zaremba <larysa.zaremba@intel.com>
Fri, 13 May 2022 12:17:43 +0000 (14:17 +0200)
committerAndrii Nakryiko <andrii@kernel.org>
Fri, 13 May 2022 23:07:53 +0000 (16:07 -0700)
commitd9e24b03b72af0a8d7f61714d35153ed52ebe34b
tree140f329c224fbe8ee0b59c3db64d7aec459f5dbb
parentc0ad0b7ed03c32919f7efe6764e6257b3b3d96fe
bpftool: Use sysfs vmlinux when dumping BTF by ID

Currently, dumping almost all BTFs specified by id requires
using the -B option to pass the base BTF. For kernel module
BTFs the vmlinux BTF sysfs path should work.

This patch simplifies dumping by ID usage by loading
vmlinux BTF from sysfs as base, if base BTF was not specified
and the ID corresponds to a kernel module BTF.

Signed-off-by: Larysa Zaremba <larysa.zaremba@intel.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Reviewed-by: Alexander Lobakin <alexandr.lobakin@intel.com>
Link: https://lore.kernel.org/bpf/20220513121743.12411-1-larysa.zaremba@intel.com
tools/bpf/bpftool/btf.c