netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: Yonghong Song <yhs@fb.com>
Cc: bpf@vger.kernel.org, netdev@vger.kernel.org,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Jiri Olsa <jolsa@kernel.org>,
	kernel-team@fb.com
Subject: Re: [PATCH bpf-next v2 2/5] tools/bpf: sync btf_ids.h to tools
Date: Mon, 20 Jul 2020 21:44:18 +0200	[thread overview]
Message-ID: <20200720194418.GN760733@krava> (raw)
In-Reply-To: <20200720163359.1393079-1-yhs@fb.com>

On Mon, Jul 20, 2020 at 09:33:59AM -0700, Yonghong Song wrote:
> Sync kernel header btf_ids.h to tools directory.
> Also define macro CONFIG_DEBUG_INFO_BTF before
> including btf_ids.h in prog_tests/resolve_btfids.c
> since non-stub definitions for BTF_ID_LIST etc. macros
> are defined under CONFIG_DEBUG_INFO_BTF. This
> prevented test_progs from failing.

I was going to send this with the d_path change ;-)

thanks,
jirka

> 
> Signed-off-by: Yonghong Song <yhs@fb.com>
> ---
>  tools/include/linux/btf_ids.h                         | 11 ++++++++++-
>  .../testing/selftests/bpf/prog_tests/resolve_btfids.c |  1 +
>  2 files changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/include/linux/btf_ids.h b/tools/include/linux/btf_ids.h
> index fe019774f8a7..1cdb56950ffe 100644
> --- a/tools/include/linux/btf_ids.h
> +++ b/tools/include/linux/btf_ids.h
> @@ -3,6 +3,8 @@
>  #ifndef _LINUX_BTF_IDS_H
>  #define _LINUX_BTF_IDS_H
>  
> +#ifdef CONFIG_DEBUG_INFO_BTF
> +
>  #include <linux/compiler.h> /* for __PASTE */
>  
>  /*
> @@ -21,7 +23,7 @@
>  asm(							\
>  ".pushsection " BTF_IDS_SECTION ",\"a\";       \n"	\
>  ".local " #symbol " ;                          \n"	\
> -".type  " #symbol ", @object;                  \n"	\
> +".type  " #symbol ", STT_OBJECT;               \n"	\
>  ".size  " #symbol ", 4;                        \n"	\
>  #symbol ":                                     \n"	\
>  ".zero 4                                       \n"	\
> @@ -83,5 +85,12 @@ asm(							\
>  ".zero 4                                       \n"	\
>  ".popsection;                                  \n");
>  
> +#else
> +
> +#define BTF_ID_LIST(name) static u32 name[5];
> +#define BTF_ID(prefix, name)
> +#define BTF_ID_UNUSED
> +
> +#endif /* CONFIG_DEBUG_INFO_BTF */
>  
>  #endif
> diff --git a/tools/testing/selftests/bpf/prog_tests/resolve_btfids.c b/tools/testing/selftests/bpf/prog_tests/resolve_btfids.c
> index 403be6f36cba..22d83bba4e91 100644
> --- a/tools/testing/selftests/bpf/prog_tests/resolve_btfids.c
> +++ b/tools/testing/selftests/bpf/prog_tests/resolve_btfids.c
> @@ -6,6 +6,7 @@
>  #include <bpf/libbpf.h>
>  #include <linux/btf.h>
>  #include <linux/kernel.h>
> +#define CONFIG_DEBUG_INFO_BTF
>  #include <linux/btf_ids.h>
>  #include "test_progs.h"
>  
> -- 
> 2.24.1
> 


  reply	other threads:[~2020-07-20 19:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-20 16:33 [PATCH bpf-next v2 0/5] bpf: compute btf_ids at build time for btf_iter Yonghong Song
2020-07-20 16:33 ` [PATCH bpf-next v2 1/5] bpf: compute bpf_skc_to_*() helper socket btf ids at build time Yonghong Song
2020-07-20 16:33 ` [PATCH bpf-next v2 2/5] tools/bpf: sync btf_ids.h to tools Yonghong Song
2020-07-20 19:44   ` Jiri Olsa [this message]
2020-07-20 16:34 ` [PATCH bpf-next v2 3/5] bpf: add BTF_ID_LIST_GLOBAL in btf_ids.h Yonghong Song
2020-07-20 19:58   ` Jiri Olsa
2020-07-20 16:34 ` [PATCH bpf-next v2 4/5] bpf: make btf_sock_ids global Yonghong Song
2020-07-20 16:34 ` [PATCH bpf-next v2 5/5] bpf: net: use precomputed btf_id for bpf iterators Yonghong Song
2020-07-21 20:21 ` [PATCH bpf-next v2 0/5] bpf: compute btf_ids at build time for btf_iter Alexei Starovoitov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200720194418.GN760733@krava \
    --to=jolsa@redhat.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=jolsa@kernel.org \
    --cc=kernel-team@fb.com \
    --cc=netdev@vger.kernel.org \
    --cc=yhs@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).