Skip to contentSkip to conversation

Add CONFIG_DEBUG_INFO_BTF and CONFIG_DEBUG_INFO_BTF_MODULES check to bpftool feature command

PATCH Applied grantseltzer 4 participants 4 messages Feb 22, 2021 – Feb 23, 2021

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 Add CONFIG_DEBUG_INFO_BTF and CONFIG_DEBUG_INFO_BTF_MODULES check to bpftool feature command

This adds both the CONFIG_DEBUG_INFO_BTF and CONFIG_DEBUG_INFO_BTF_MODULES kernel compile option to output of the bpftool feature command. This is relevant for developers that want to account for data structure definition differences between kernels.

---
 tools/bpf/bpftool/feature.c | 4 ++++
 1 file changed, 4 insertions(+)
tools/bpf/bpftool/feature.c +4 -0
index 359960a8f..40a88df27 100644
@@ -336,6 +336,10 @@ 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", },
+		/* Kernel module BTF debug information available */
+		{ "CONFIG_DEBUG_INFO_BTF_MODULES", },
 
 		/* cgroups */
 		{ "CONFIG_CGROUPS", },
Signature · 1 line
2.29.2
Acked-by on v4 1/1
#1 lore raw
Quoted 4 lines · grantseltzer

This adds both the CONFIG_DEBUG_INFO_BTF and CONFIG_DEBUG_INFO_BTF_MODULES kernel compile option to output of the bpftool feature command. This is relevant for developers that want to account for data structure definition differences between kernels.

[ Acked-by and Reviewed-by can be carried over to
the following revisions if the change is obvious.

Also, it is useful to comment on what has
changed between revisions. There is no need
to resend this patch just for this though. ]

#2 lore raw
In reply to grantseltzer
Quoted 8 lines · grantseltzer

This adds both the CONFIG_DEBUG_INFO_BTF and CONFIG_DEBUG_INFO_BTF_MODULES kernel compile option to output of the bpftool feature command. This is relevant for developers that want to account for data structure definition differences between kernels.

---

Applied to bpf-next, but adjusted subject to shorter:

"Add kernel/modules BTF presence checks to bpftool feature command"

Quoted 21 lines
 tools/bpf/bpftool/feature.c | 4 ++++
 1 file changed, 4 insertions(+)
tools/bpf/bpftool/feature.c +4 -1
index 359960a8f..40a88df27 100644
@@ -336,6 +336,10 @@ 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", },
+               /* Kernel module BTF debug information available */
+               { "CONFIG_DEBUG_INFO_BTF_MODULES", },
 
                /* cgroups */
                { "CONFIG_CGROUPS", },
--

2.29.2

#3 lore raw
In reply to grantseltzer
This patch was applied to bpf/bpf-next.git (refs/heads/master):

Hello:

This patch was applied to bpf/bpf-next.git (refs/heads/master):

Quoted 8 lines · On Mon, 22 Feb 2021 19:58:46 +0000 you wrote:

This adds both the CONFIG_DEBUG_INFO_BTF and CONFIG_DEBUG_INFO_BTF_MODULES kernel compile option to output of the bpftool feature command. This is relevant for developers that want to account for data structure definition differences between kernels.

[...]

Here is the summary with links:
- [v4,bpf-next] Add CONFIG_DEBUG_INFO_BTF and CONFIG_DEBUG_INFO_BTF_MODULES check to bpftool feature command

    https://git.kernel.org/bpf/bpf-next/c/6b12bb20aeb3

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html