Skip to contentSkip to conversation

add CONFIG_DEBUG_INFO_BTF check to bpftool feature command

PATCH Superseded grantseltzer 2 participants 4 messages Feb 19, 2021 – Feb 20, 2021

Subsystems (2)

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 add CONFIG_DEBUG_INFO_BTF check to bpftool feature command

---
 tools/bpf/bpftool/feature.c | 2 ++
 1 file changed, 2 insertions(+)
tools/bpf/bpftool/feature.c +2 -0
index 359960a8f..34343e7fa 100644
@@ -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", },
+		/* Enable using BTF debug information */
+		{ "CONFIG_DEBUG_INFO_BTF", },
 
 		/* cgroups */
 		{ "CONFIG_CGROUPS", },
Signature · 1 line
2.29.2
#1 lore raw

There is no description. Please provide a commit message.

Quoted 21 lines · grantseltzer
---
 tools/bpf/bpftool/feature.c | 2 ++
 1 file changed, 2 insertions(+)
tools/bpf/bpftool/feature.c +2 -0
index 359960a8f..34343e7fa 100644
@@ -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", },
+		/* Enable using BTF debug information */
+		{ "CONFIG_DEBUG_INFO_BTF", },
 
 		/* cgroups */
 		{ "CONFIG_CGROUPS", },
Signature · 1 line
2.29.2
#2 lore raw

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 +0 -0
index 359960a8f..34343e7fa 100644
@@ -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", },

+ /* Enable using BTF debug information */
+ { "CONFIG_DEBUG_INFO_BTF", },

                /* cgroups */
                { "CONFIG_CGROUPS", },

--
2.29.2

Quoted 25 lines · Martin KaFai Lau

There is no description. Please provide a commit message.

Quoted 21 lines · grantseltzer
---
 tools/bpf/bpftool/feature.c | 2 ++
 1 file changed, 2 insertions(+)
tools/bpf/bpftool/feature.c +2 -1
index 359960a8f..34343e7fa 100644
@@ -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", },
+             /* Enable using BTF debug information */
+             { "CONFIG_DEBUG_INFO_BTF", },
 
              /* cgroups */
              { "CONFIG_CGROUPS", },
--

2.29.2

#3 lore raw
Quoted 48 lines · Grant Seltzer Richman

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
index 359960a8f..34343e7fa 100644
@@ -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", },
+               /* Enable using BTF debug information */
+               { "CONFIG_DEBUG_INFO_BTF", },
 
                /* cgroups */
                { "CONFIG_CGROUPS", },

--
2.29.2

Quoted 20 lines · Martin KaFai Lau

There is no description. Please provide a commit message.

Quoted 16 lines · grantseltzer
---
 tools/bpf/bpftool/feature.c | 2 ++
 1 file changed, 2 insertions(+)
tools/bpf/bpftool/feature.c +2 -0
index 359960a8f..34343e7fa 100644
@@ -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", },
+             /* Enable using BTF debug information */
+             { "CONFIG_DEBUG_INFO_BTF", },
 
Quoted 2 lines
Quoted 2 lines

tools/bpf/bpftool/feature.c static void probe_kernel_image_config(const char *define_prefix) · line 343

Quoted 2 lines
tools/bpf/bpftool/feature.c +0 -0
              /* cgroups */
              { "CONFIG_CGROUPS", },

I don't think this old reference "> >" part can be applied. Please resubmit a clean patch instead of replying to the old one. Documentation/process/submitting-patches.rst has details on the how-tos.

It is not a bug fix, so it belongs to bpf-next (Documentation/bpf/bpf_devel_QA.rst).
Please tag it with bpf-next. The next revision will be v2, sample commands would be:
git format-patch --subject-prefix='PATCH v2 bpf-next' ... ./scripts/checkpatch.pl ...
git send-email ...