[PATCH v3 bpf-next] Add CONFIG_DEBUG_INFO_BTF check to bpftool feature command

Subsystems: bpf [general] (safe dynamic programs and tools), bpf [tooling] (bpftool), the rest

STALE1990d

5 messages, 4 authors, 2021-02-22 · open the first message on its own page

[PATCH v3 bpf-next] Add CONFIG_DEBUG_INFO_BTF check to bpftool feature command

From: grantseltzer <hidden>
Date: 2021-02-22 15:35:46

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.

Signed-off-by: grantseltzer <redacted>
---
 tools/bpf/bpftool/feature.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/tools/bpf/bpftool/feature.c b/tools/bpf/bpftool/feature.c
index 359960a8f..b90cc6832 100644
--- a/tools/bpf/bpftool/feature.c
+++ b/tools/bpf/bpftool/feature.c
@@ -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", },
-- 
2.29.2

Re: [PATCH v3 bpf-next] Add CONFIG_DEBUG_INFO_BTF check to bpftool feature command

From: Quentin Monnet <hidden>
Date: 2021-02-22 16:05:25

2021-02-20 17:13 UTC+0000 ~ grantseltzer [off-list ref]
quoted hunk
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.

Signed-off-by: grantseltzer <redacted>
---
 tools/bpf/bpftool/feature.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/tools/bpf/bpftool/feature.c b/tools/bpf/bpftool/feature.c
index 359960a8f..b90cc6832 100644
--- a/tools/bpf/bpftool/feature.c
+++ b/tools/bpf/bpftool/feature.c
@@ -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!

Reviewed-by: Quentin Monnet <redacted>

(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

Re: [PATCH v3 bpf-next] Add CONFIG_DEBUG_INFO_BTF check to bpftool feature command

From: Martin KaFai Lau <hidden>
Date: 2021-02-22 19:08:50

On Sat, Feb 20, 2021 at 05:13:07PM +0000, grantseltzer wrote:
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.
Acked-by: Martin KaFai Lau <redacted>

Re: [PATCH v3 bpf-next] Add CONFIG_DEBUG_INFO_BTF check to bpftool feature command

From: Andrii Nakryiko <hidden>
Date: 2021-02-22 19:26:31

On Mon, Feb 22, 2021 at 7:34 AM grantseltzer [off-list ref] wrote:
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.

Signed-off-by: grantseltzer <redacted>
Signed-off-by should have a properly capitalized (where it makes
sense) real name of the author. Is it Grant Seltzer then?
quoted hunk
---
 tools/bpf/bpftool/feature.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/tools/bpf/bpftool/feature.c b/tools/bpf/bpftool/feature.c
index 359960a8f..b90cc6832 100644
--- a/tools/bpf/bpftool/feature.c
+++ b/tools/bpf/bpftool/feature.c
@@ -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")?
                /* cgroups */
                { "CONFIG_CGROUPS", },
--
2.29.2

Re: [PATCH v3 bpf-next] Add CONFIG_DEBUG_INFO_BTF check to bpftool feature command

From: Grant Seltzer Richman <hidden>
Date: 2021-02-22 20:06:45

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!

On Mon, Feb 22, 2021 at 2:22 PM Andrii Nakryiko
[off-list ref] wrote:
On Mon, Feb 22, 2021 at 7:34 AM grantseltzer [off-list ref] wrote:
quoted
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.

Signed-off-by: grantseltzer <redacted>
Signed-off-by should have a properly capitalized (where it makes
sense) real name of the author. Is it Grant Seltzer then?
quoted
---
 tools/bpf/bpftool/feature.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/tools/bpf/bpftool/feature.c b/tools/bpf/bpftool/feature.c
index 359960a8f..b90cc6832 100644
--- a/tools/bpf/bpftool/feature.c
+++ b/tools/bpf/bpftool/feature.c
@@ -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
                /* cgroups */
                { "CONFIG_CGROUPS", },
--
2.29.2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help