bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 bpf-next] Add CONFIG_DEBUG_INFO_BTF check to bpftool feature command
@ 2021-02-20  5:13 grantseltzer
  2021-02-22 12:02 ` Quentin Monnet
  0 siblings, 1 reply; 2+ messages in thread
From: grantseltzer @ 2021-02-20  5:13 UTC (permalink / raw)
  To: andrii, daniel, kafai, songliubraving, john.fastabend, kpsingh
  Cc: bpf, grantseltzer

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 <grantseltzer@gmail.com>
---
 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..34343e7fa 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", },
+		/* Enable using BTF debug information */
+		{ "CONFIG_DEBUG_INFO_BTF", },
 
 		/* cgroups */
 		{ "CONFIG_CGROUPS", },
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2 bpf-next] Add CONFIG_DEBUG_INFO_BTF check to bpftool feature command
  2021-02-20  5:13 [PATCH v2 bpf-next] Add CONFIG_DEBUG_INFO_BTF check to bpftool feature command grantseltzer
@ 2021-02-22 12:02 ` Quentin Monnet
  0 siblings, 0 replies; 2+ messages in thread
From: Quentin Monnet @ 2021-02-22 12:02 UTC (permalink / raw)
  To: grantseltzer, andrii, daniel, kafai, songliubraving,
	john.fastabend, kpsingh
  Cc: bpf

2021-02-20 05:13 UTC+0000 ~ grantseltzer <grantseltzer@gmail.com>
> 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 <grantseltzer@gmail.com>
> ---
>  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..34343e7fa 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", },
> +		/* Enable using BTF debug information */
> +		{ "CONFIG_DEBUG_INFO_BTF", },

Nit: The comment is slightly misleading, you can use BTF to list program
C instructions or map structures without this option for example. Maybe
something like this?

	/* Kernel BTF debug information available */

Thanks for the patch!
Quentin

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-02-22 12:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-20  5:13 [PATCH v2 bpf-next] Add CONFIG_DEBUG_INFO_BTF check to bpftool feature command grantseltzer
2021-02-22 12:02 ` Quentin Monnet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).