All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yonghong Song <yonghong.song@linux.dev>
To: "Jose E. Marchesi" <jose.marchesi@oracle.com>, bpf@vger.kernel.org
Cc: Yonghong Song <yhs@meta.com>,
	Eduard Zingerman <eddyz87@gmail.com>,
	david.faust@oracle.com, cupertino.miranda@oracle.com
Subject: Re: [PATCH bpf-next] bpf: add a few more options for GCC_BPF in selftests/bpf/Makefile
Date: Wed, 24 Apr 2024 14:05:12 -0700	[thread overview]
Message-ID: <744420fb-4b2b-44c8-9e35-1ffd9f086fd9@linux.dev> (raw)
In-Reply-To: <20240424084141.31298-1-jose.marchesi@oracle.com>


On 4/24/24 1:41 AM, Jose E. Marchesi wrote:
> This little patch modifies selftests/bpf/Makefile so it passes the
> following extra options when invoking gcc-bpf:
>
>   -gbtf
>     This makes GCC to emit BTF debug info in .BTF and .BTF.ext.

Could we do if '-g' is specified, for bpf program,
btf will be automatically generated?

>
>   -mco-re
>     This tells GCC to generate CO-RE relocations in .BTF.ext.

Can we make this default? That is, remove -mco-re option. I
can imagine for any serious bpf program, co-re is a must.

>
>   -masm=pseudoc
>     This tells GCC to emit BPF assembler using the pseudo-c syntax.

Can we make it the other way round such that -masm=pseudoc is
the default? You can have an option e.g., -masm=non-pseudoc,
for the other format?

>
> Tested in bpf-next master.
> No regressions.
>
> Signed-off-by: Jose E. Marchesi <jose.marchesi@oracle.com>
> Cc: Yonghong Song <yhs@meta.com>
> Cc: Eduard Zingerman <eddyz87@gmail.com>
> Cc: david.faust@oracle.com
> Cc: cupertino.miranda@oracle.com
> ---
>   tools/testing/selftests/bpf/Makefile | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
> index edc73f8f5aef..702428021132 100644
> --- a/tools/testing/selftests/bpf/Makefile
> +++ b/tools/testing/selftests/bpf/Makefile
> @@ -442,7 +442,7 @@ endef
>   # Build BPF object using GCC
>   define GCC_BPF_BUILD_RULE
>   	$(call msg,GCC-BPF,$(TRUNNER_BINARY),$2)
> -	$(Q)$(BPF_GCC) $3 -O2 -c $1 -o $2
> +	$(Q)$(BPF_GCC) $3 -O2 -gbtf -mco-re -masm=pseudoc -c $1 -o $2
>   endef
>   
>   SKEL_BLACKLIST := btf__% test_pinning_invalid.c test_sk_assign.c

  parent reply	other threads:[~2024-04-24 21:05 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-24  8:41 [PATCH bpf-next] bpf: add a few more options for GCC_BPF in selftests/bpf/Makefile Jose E. Marchesi
2024-04-24 16:47 ` Eduard Zingerman
2024-04-24 21:05 ` Yonghong Song [this message]
2024-04-24 21:24   ` Jose E. Marchesi
2024-04-24 21:47     ` David Faust
2024-04-24 21:48     ` Alexei Starovoitov
2024-04-25 12:32       ` Jose E. Marchesi
2024-04-25 15:40         ` Alexei Starovoitov
2024-04-26 14:41           ` Jose E. Marchesi
2024-04-26 14:47             ` Alexei Starovoitov
2024-04-25 18:20         ` Andrii Nakryiko
2024-04-25 18:48           ` Jose E. Marchesi

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=744420fb-4b2b-44c8-9e35-1ffd9f086fd9@linux.dev \
    --to=yonghong.song@linux.dev \
    --cc=bpf@vger.kernel.org \
    --cc=cupertino.miranda@oracle.com \
    --cc=david.faust@oracle.com \
    --cc=eddyz87@gmail.com \
    --cc=jose.marchesi@oracle.com \
    --cc=yhs@meta.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.