BPF List
 help / color / mirror / Atom feed
From: Jiri Olsa <olsajiri@gmail.com>
To: Daniel Borkmann <daniel@iogearbox.net>
Cc: Yonghong Song <yhs@fb.com>,
	bpf@vger.kernel.org, Alexei Starovoitov <ast@kernel.org>,
	Andrii Nakryiko <andrii@kernel.org>,
	kernel-team@fb.com
Subject: Re: [PATCH bpf-next v3 6/7] selftests/bpf: Add struct argument tests with fentry/fexit programs.
Date: Tue, 30 Aug 2022 14:11:17 +0200	[thread overview]
Message-ID: <Yw3+ZfsbBdqo6R41@krava> (raw)
In-Reply-To: <7cf3de93-ae20-3d76-20d9-67242a65408b@iogearbox.net>

On Tue, Aug 30, 2022 at 12:12:08AM +0200, Daniel Borkmann wrote:
> On 8/28/22 4:55 AM, Yonghong Song wrote:
> > Add various struct argument tests with fentry/fexit programs.
> > Also add one test with a kernel func which does not have any
> > argument to test BPF_PROG2 macro in such situation.
> > 
> > Signed-off-by: Yonghong Song <yhs@fb.com>
> > ---
> >   .../selftests/bpf/bpf_testmod/bpf_testmod.c   |  48 ++++++++
> >   .../selftests/bpf/prog_tests/tracing_struct.c |  63 ++++++++++
> >   .../selftests/bpf/progs/tracing_struct.c      | 114 ++++++++++++++++++
> >   3 files changed, 225 insertions(+)
> >   create mode 100644 tools/testing/selftests/bpf/prog_tests/tracing_struct.c
> >   create mode 100644 tools/testing/selftests/bpf/progs/tracing_struct.c
> > 
> 
> For s390x these tests need to be deny-listed due to missing trampoline support..
> 
>   All error logs:
>   test_fentry:PASS:tracing_struct__open_and_load 0 nsec
>   libbpf: prog 'test_struct_arg_1': failed to attach: ERROR: strerror_r(-524)=22
>   libbpf: prog 'test_struct_arg_1': failed to auto-attach: -524
>   test_fentry:FAIL:tracing_struct__attach unexpected error: -524 (errno 524)
>   #209     tracing_struct:FAIL
>   Summary: 189/972 PASSED, 27 SKIPPED, 1 FAILED
> 
> However, looks like the no_alu32 ones on x86 fail:
> 
>   [...]
>   #207     trace_printk:OK
>   #208     trace_vprintk:OK
>   test_fentry:PASS:tracing_struct__open_and_load 0 nsec
>   test_fentry:PASS:tracing_struct__attach 0 nsec
>   trigger_module_test_read:PASS:testmod_file_open 0 nsec
>   test_fentry:PASS:trigger_read 0 nsec
>   test_fentry:PASS:t1:a.a 0 nsec
>   test_fentry:PASS:t1:a.b 0 nsec
>   test_fentry:PASS:t1:b 0 nsec
>   test_fentry:PASS:t1:c 0 nsec
>   test_fentry:PASS:t1 nregs 0 nsec
>   test_fentry:PASS:t1 reg0 0 nsec
>   test_fentry:PASS:t1 reg1 0 nsec
>   test_fentry:FAIL:t1 reg2 unexpected t1 reg2: actual 7327499336969879553 != expected 1

I'm getting the same, I think it's because the argument is int (4 bytes)
while the register is 8, we need to cast to int before we check for the
argument value

jirka

>   test_fentry:PASS:t1 reg3 0 nsec
>   test_fentry:PASS:t1 ret 0 nsec
>   test_fentry:PASS:t2:a 0 nsec
>   test_fentry:PASS:t2:b.a 0 nsec
>   test_fentry:PASS:t2:b.b 0 nsec
>   test_fentry:PASS:t2:c 0 nsec
>   test_fentry:PASS:t2 ret 0 nsec
>   test_fentry:PASS:t3:a 0 nsec
>   test_fentry:PASS:t3:b 0 nsec
>   test_fentry:PASS:t3:c.a 0 nsec
>   test_fentry:PASS:t3:c.b 0 nsec
>   test_fentry:PASS:t3 ret 0 nsec
>   test_fentry:PASS:t4:a.a 0 nsec
>   test_fentry:PASS:t4:b 0 nsec
>   test_fentry:PASS:t4:c 0 nsec
>   test_fentry:PASS:t4:d 0 nsec
>   test_fentry:PASS:t4:e.a 0 nsec
>   test_fentry:PASS:t4:e.b 0 nsec
>   test_fentry:PASS:t4 ret 0 nsec
>   test_fentry:PASS:t5 ret 0 nsec
>   #209     tracing_struct:FAIL
>   #210     trampoline_count:OK
>   [...]

  reply	other threads:[~2022-08-30 12:11 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-28  2:54 [PATCH bpf-next v3 0/7] bpf: Support struct argument for trampoline base progs Yonghong Song
2022-08-28  2:54 ` [PATCH bpf-next v3 1/7] bpf: Allow struct argument in trampoline based programs Yonghong Song
2022-08-30 12:11   ` Jiri Olsa
2022-08-30 17:03     ` Yonghong Song
2022-08-28  2:54 ` [PATCH bpf-next v3 2/7] bpf: x86: Support in-register struct arguments in trampoline programs Yonghong Song
2022-08-28  2:54 ` [PATCH bpf-next v3 3/7] bpf: Update descriptions for helpers bpf_get_func_arg[_cnt]() Yonghong Song
2022-08-28  2:54 ` [PATCH bpf-next v3 4/7] bpf: arm64: No support of struct argument in trampoline programs Yonghong Song
2022-08-28  2:55 ` [PATCH bpf-next v3 5/7] libbpf: Add new BPF_PROG2 macro Yonghong Song
2022-08-30  0:32   ` Kui-Feng Lee
2022-08-30 16:50     ` Yonghong Song
2022-08-28  2:55 ` [PATCH bpf-next v3 6/7] selftests/bpf: Add struct argument tests with fentry/fexit programs Yonghong Song
2022-08-29 22:12   ` Daniel Borkmann
2022-08-30 12:11     ` Jiri Olsa [this message]
2022-08-30 17:20       ` Yonghong Song
2022-08-30 16:36     ` Yonghong Song
2022-08-28  2:55 ` [PATCH bpf-next v3 7/7] selftests/bpf: Use BPF_PROG2 for some fentry programs without struct arguments Yonghong Song

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=Yw3+ZfsbBdqo6R41@krava \
    --to=olsajiri@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=kernel-team@fb.com \
    --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