Add CONFIG_DEBUG_INFO_BTF check to bpftool feature command
Subsystems (4)
PATCH v3 1/1 Add CONFIG_DEBUG_INFO_BTF check to bpftool feature command
This adds the CONFIG_DEBUG_INFO_BTF kernel compile option to output of the bpftool feature command. This is relevant for developers that want to use libbpf to account for data structure definition differences between kernels.
--- tools/bpf/bpftool/feature.c | 2 ++ 1 file changed, 2 insertions(+)
tools/bpf/bpftool/feature.c +2 -0
@@ -336,6 +336,8 @@ static void probe_kernel_image_config(const char *define_prefix) { "CONFIG_BPF_JIT", }, /* Avoid compiling eBPF interpreter (use JIT only) */ { "CONFIG_BPF_JIT_ALWAYS_ON", }, + /* Kernel BTF debug information available */ + { "CONFIG_DEBUG_INFO_BTF", }, /* cgroups */ { "CONFIG_CGROUPS", },
Signature · 1 line
2.29.2
2021-02-20 17:13 UTC+0000 ~ grantseltzer <[email protected]>
Quoted 16 lines
This adds the
CONFIG_DEBUG_INFO_BTFkernel compile option to output of the bpftool feature command. This is relevant for developers that want to use libbpf to account for data structure definition differences between kernels.Signed-off-by grantseltzer <[email protected]>--- tools/bpf/bpftool/feature.c | 2 ++ 1 file changed, 2 insertions(+)tools/bpf/bpftool/feature.c +0
-0
tools/bpf/bpftool/feature.c static void probe_kernel_image_config(const char *define_prefix) · line 343
Quoted 8 lines
tools/bpf/bpftool/feature.c +2
-0@@ -336,6 +336,8 @@ static void probe_kernel_image_config(const char *define_prefix) { "CONFIG_BPF_JIT", }, /* Avoid compiling eBPF interpreter (use JIT only) */ { "CONFIG_BPF_JIT_ALWAYS_ON", }, + /* Kernel BTF debug information available */ + { "CONFIG_DEBUG_INFO_BTF", }, /* cgroups */ { "CONFIG_CGROUPS", },
Thanks for the change!
(Note: the date of the email is not correct, but I discussed offline with Grant and this is now sorted out for future submissions.)
Quentin
Quoted 4 lines · grantseltzer
This adds the
CONFIG_DEBUG_INFO_BTFkernel compile option to output of the bpftool feature command. This is relevant for developers that want to use libbpf to account for data structure definition differences between kernels.
Quoted 7 lines · grantseltzer
This adds the
CONFIG_DEBUG_INFO_BTFkernel compile option to output of the bpftool feature command. This is relevant for developers that want to use libbpf to account for data structure definition differences between kernels.Signed-off-by grantseltzer <[email protected]>
Signed-off-by should have a properly capitalized (where it makes sense) real name of the author. Is it Grant Seltzer then?
Quoted 9 lines
--- tools/bpf/bpftool/feature.c | 2 ++ 1 file changed, 2 insertions(+)tools/bpf/bpftool/feature.c +0
-0
tools/bpf/bpftool/feature.c static void probe_kernel_image_config(const char *define_prefix) · line 340
Quoted 5 lines
tools/bpf/bpftool/feature.c +2
-0@@ -336,6 +336,8 @@ static void probe_kernel_image_config(const char *define_prefix) { "CONFIG_BPF_JIT", }, /* Avoid compiling eBPF interpreter (use JIT only) */ { "CONFIG_BPF_JIT_ALWAYS_ON", }, + /* Kernel BTF debug information available */ + { "CONFIG_DEBUG_INFO_BTF", },
How about checking CONFIG_DEBUG_INFO_BTF_MODULES as well (i.e., "Kernel module BTF information is available")?
Quoted 6 lines
tools/bpf/bpftool/feature.c +0
-1/* cgroups */ { "CONFIG_CGROUPS", }, --2.29.2
I submitted a new patch that includes CONFIG_DEBUG_INFO_BTF_MODULES. I renamed the patch to include this change so it's showing up as a new thread, I also fixed the time issue, apologies for the confusion!
Quoted 37 lines · Andrii Nakryiko
Quoted 7 lines · grantseltzer
This adds the
CONFIG_DEBUG_INFO_BTFkernel compile option to output of the bpftool feature command. This is relevant for developers that want to use libbpf to account for data structure definition differences between kernels.Signed-off-by grantseltzer <[email protected]>Signed-off-by should have a properly capitalized (where it makes sense) real name of the author. Is it Grant Seltzer then?
Quoted 9 lines
--- tools/bpf/bpftool/feature.c | 2 ++ 1 file changed, 2 insertions(+)tools/bpf/bpftool/feature.c +0
-0tools/bpf/bpftool/feature.c static void probe_kernel_image_config(const char *define_prefix) · line 340
Quoted 5 lines
tools/bpf/bpftool/feature.c +2
-0@@ -336,6 +336,8 @@ static void probe_kernel_image_config(const char *define_prefix) { "CONFIG_BPF_JIT", }, /* Avoid compiling eBPF interpreter (use JIT only) */ { "CONFIG_BPF_JIT_ALWAYS_ON", }, + /* Kernel BTF debug information available */ + { "CONFIG_DEBUG_INFO_BTF", },How about checking
CONFIG_DEBUG_INFO_BTF_MODULESas well (i.e., "Kernel module BTF information is available")?Quoted 6 lines
tools/bpf/bpftool/feature.c +0
-1/* cgroups */ { "CONFIG_CGROUPS", }, --2.29.2