bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ilya Leoshkevich <iii@linux.ibm.com>
To: Andrii Nakryiko <andrii.nakryiko@gmail.com>,
	Alan Maguire <alan.maguire@oracle.com>
Cc: Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>, bpf <bpf@vger.kernel.org>,
	Heiko Carstens <hca@linux.ibm.com>,
	Vasily Gorbik <gor@linux.ibm.com>
Subject: Re: [PATCH bpf-next 1/3] selftests/bpf: Use cpu_number only on arches that have it
Date: Tue, 12 Oct 2021 13:02:59 +0200	[thread overview]
Message-ID: <fd749b049550e179d0d0b789d08a102655b1a68e.camel@linux.ibm.com> (raw)
In-Reply-To: <CAEf4BzY=npfWOSgPPEKZ9g44a5XQ_606agX840dLLCqJiDC++g@mail.gmail.com>

On Tue, 2021-10-12 at 05:56 +0200, Andrii Nakryiko wrote:
> On Tue, Oct 12, 2021 at 4:51 AM Ilya Leoshkevich <iii@linux.ibm.com>
> wrote:
> > 
> > cpu_number exists only on Intel and aarch64, so skip the test
> > involing
> > it on other arches. An alternative would be to replace it with an
> > exported non-ifdefed primitive-typed percpu variable from the
> > common
> > code, but there appears to be none.
> > 
> > Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
> > ---
> >  tools/testing/selftests/bpf/prog_tests/btf_dump.c | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/tools/testing/selftests/bpf/prog_tests/btf_dump.c
> > b/tools/testing/selftests/bpf/prog_tests/btf_dump.c
> > index 87f9df653e4e..12f457b6786d 100644
> > --- a/tools/testing/selftests/bpf/prog_tests/btf_dump.c
> > +++ b/tools/testing/selftests/bpf/prog_tests/btf_dump.c
> > @@ -778,8 +778,10 @@ static void test_btf_dump_struct_data(struct
> > btf *btf, struct btf_dump *d,
> >  static void test_btf_dump_var_data(struct btf *btf, struct
> > btf_dump *d,
> >                                    char *str)
> >  {
> > +#if defined(__i386__) || defined(__x86_64__) ||
> > defined(__aarch64__)
> >         TEST_BTF_DUMP_VAR(btf, d, NULL, str, "cpu_number", int,
> > BTF_F_COMPACT,
> >                           "int cpu_number = (int)100", 100);
> > +#endif
> 
> We are in the talks about supporting cross-compilation of selftests,
> and this will be just another breakage that we'll have to undo.

Why would this break? Cross-compilation should define these macros
based on target, not build system.

> Can we find some other variable that will be available on all
> architectures? Maybe "runqueues"?

Wouldn't runqueues be pointless? We already have cpu_profile_flip. I
thought the idea here was to have something marked with
EXPORT_PER_CPU_SYMBOL.

> >         TEST_BTF_DUMP_VAR(btf, d, NULL, str, "cpu_profile_flip",
> > int, BTF_F_COMPACT,
> >                           "static int cpu_profile_flip = (int)2",
> > 2);
> >  }
> > --
> > 2.31.1


  reply	other threads:[~2021-10-12 11:03 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-12  2:32 [PATCH bpf-next 0/3] btf_dump fixes for s390 Ilya Leoshkevich
2021-10-12  2:32 ` [PATCH bpf-next 1/3] selftests/bpf: Use cpu_number only on arches that have it Ilya Leoshkevich
2021-10-12  3:56   ` Andrii Nakryiko
2021-10-12 11:02     ` Ilya Leoshkevich [this message]
2021-10-20 18:32       ` Andrii Nakryiko
2021-10-12  2:32 ` [PATCH bpf-next 2/3] libbpf: Fix dumping big-endian bitfields Ilya Leoshkevich
2021-10-12  4:03   ` Andrii Nakryiko
2021-10-12 11:43     ` Ilya Leoshkevich
2021-10-12  2:32 ` [PATCH bpf-next 3/3] libbpf: Fix dumping __int128 Ilya Leoshkevich
2021-10-12  3:52   ` Andrii Nakryiko
2021-10-12 11:44     ` Ilya Leoshkevich

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=fd749b049550e179d0d0b789d08a102655b1a68e.camel@linux.ibm.com \
    --to=iii@linux.ibm.com \
    --cc=alan.maguire@oracle.com \
    --cc=andrii.nakryiko@gmail.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.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).