All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrii Nakryiko <andrii.nakryiko@gmail.com>
To: Lorenz Bauer <lmb@cloudflare.com>
Cc: Andrii Nakryiko <andrii@kernel.org>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>, bpf <bpf@vger.kernel.org>,
	kernel-team <kernel-team@cloudflare.com>
Subject: Re: [PATCH bpf v2 1/1] lib: bpf: tracing: fail compilation if target arch is missing
Date: Wed, 16 Jun 2021 21:24:39 -0700	[thread overview]
Message-ID: <CAEf4BzbJRMuG_h9x1mv_ab_JHA-gx6=+6bc9ydAWPNGV_jQpOA@mail.gmail.com> (raw)
In-Reply-To: <20210616083635.11434-1-lmb@cloudflare.com>

On Wed, Jun 16, 2021 at 1:36 AM Lorenz Bauer <lmb@cloudflare.com> wrote:
>
> bpf2go is the Go equivalent of libbpf skeleton. The convention is that
> the compiled BPF is checked into the repository to facilitate distributing
> BPF as part of Go packages. To make this portable, bpf2go by default
> generates both bpfel and bpfeb variants of the C.
>
> Using bpf_tracing.h is inherently non-portable since the fields of
> struct pt_regs differ between platforms, so CO-RE can't help us here.
> The only way of working around this is to compile for each target
> platform independently. bpf2go can't do this by default since there
> are too many platforms.
>
> Define the various PT_... macros when no target can be determined and
> turn them into compilation failures. This works because bpf2go always
> compiles for bpf targets, so the compiler fallback doesn't kick in.
> Conditionally define __BPF_MISSING_TARGET so that we can inject a
> more appropriate error message at build time. The user can then
> choose which platform to target explicitly.
>
> Signed-off-by: Lorenz Bauer <lmb@cloudflare.com>
> ---

Applied to bpf-next, thanks.

But please use one of few "canonical" patch subject prefixes next time:
  - libbpf:
  - selftests/bpf:
  - bpftool:
  - bpf: (for kernel patches)

We don't do ":each: folder: path:" prefixes, it's not necessary and is
quite long.

>  tools/lib/bpf/bpf_tracing.h | 46 +++++++++++++++++++++++++++++++++----
>  1 file changed, 42 insertions(+), 4 deletions(-)
>

[...]

      parent reply	other threads:[~2021-06-17  4:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-16  8:36 [PATCH bpf v2 1/1] lib: bpf: tracing: fail compilation if target arch is missing Lorenz Bauer
2021-06-17  4:20 ` patchwork-bot+netdevbpf
2021-06-17  4:24 ` Andrii Nakryiko [this message]

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='CAEf4BzbJRMuG_h9x1mv_ab_JHA-gx6=+6bc9ydAWPNGV_jQpOA@mail.gmail.com' \
    --to=andrii.nakryiko@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=kernel-team@cloudflare.com \
    --cc=lmb@cloudflare.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.