bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Borkmann <daniel@iogearbox.net>
To: menglong8.dong@gmail.com, yhs@meta.com, alexei.starovoitov@gmail.com
Cc: ast@kernel.org, andrii@kernel.org, martin.lau@linux.dev,
	song@kernel.org, yhs@fb.com, john.fastabend@gmail.com,
	kpsingh@kernel.org, sdf@google.com, haoluo@google.com,
	jolsa@kernel.org, benbjiang@tencent.com, bpf@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Menglong Dong <imagedong@tencent.com>,
	revest@chromium.org
Subject: Re: [PATCH bpf-next v7 3/3] selftests/bpf: add testcase for TRACING with 6+ arguments
Date: Mon, 26 Jun 2023 16:47:53 +0200	[thread overview]
Message-ID: <d507239c-0e73-abb3-3863-f4363b8fdd11@iogearbox.net> (raw)
In-Reply-To: <20230622075715.1818144-4-imagedong@tencent.com>

On 6/22/23 9:57 AM, menglong8.dong@gmail.com wrote:
> From: Menglong Dong <imagedong@tencent.com>

(CC'ing also Florent wrt arm64)

> Add test9/test10 in fexit_test.c and fentry_test.c to test the fentry
> and fexit whose target function have 7/11 arguments.
> 
> Correspondingly, add bpf_testmod_fentry_test7() and
> bpf_testmod_fentry_test11() to bpf_testmod.c
> 
> Meanwhile, add bpf_modify_return_test2() to test_run.c to test the
> MODIFY_RETURN with 7 arguments.
> 
> Add bpf_testmod_test_struct_arg_7/bpf_testmod_test_struct_arg_7 in
> bpf_testmod.c to test the struct in the arguments.
> 
> And the testcases passed:
> 
> ./test_progs -t fexit
> Summary: 5/12 PASSED, 0 SKIPPED, 0 FAILED
> 
> ./test_progs -t fentry
> Summary: 3/0 PASSED, 0 SKIPPED, 0 FAILED
> 
> ./test_progs -t modify_return
> Summary: 1/0 PASSED, 0 SKIPPED, 0 FAILED
> 
> ./test_progs -t tracing_struct
> Summary: 1/0 PASSED, 0 SKIPPED, 0 FAILED
> 
> Signed-off-by: Menglong Dong <imagedong@tencent.com>
> Acked-by: Yonghong Song <yhs@fb.com>
> ---
> v6:
> - add testcases to tracing_struct.c instead of fentry_test.c and
>    fexit_test.c
> v5:
> - add testcases for MODIFY_RETURN
> v4:
> - use different type for args in bpf_testmod_fentry_test{7,12}
> - add testcase for grabage values in ctx
> v3:
> - move bpf_fentry_test{7,12} to bpf_testmod.c and rename them to
>    bpf_testmod_fentry_test{7,12} meanwhile
> - get return value by bpf_get_func_ret() in
>    "fexit/bpf_testmod_fentry_test12", as we don't change ___bpf_ctx_cast()
>    in this version
> ---
>   net/bpf/test_run.c                            | 23 ++++++--
>   .../selftests/bpf/bpf_testmod/bpf_testmod.c   | 49 ++++++++++++++++-
>   .../selftests/bpf/prog_tests/fentry_fexit.c   |  4 +-
>   .../selftests/bpf/prog_tests/fentry_test.c    |  2 +
>   .../selftests/bpf/prog_tests/fexit_test.c     |  2 +
>   .../selftests/bpf/prog_tests/modify_return.c  | 20 ++++++-
>   .../selftests/bpf/prog_tests/tracing_struct.c | 19 +++++++
>   .../testing/selftests/bpf/progs/fentry_test.c | 32 +++++++++++
>   .../testing/selftests/bpf/progs/fexit_test.c  | 33 ++++++++++++
>   .../selftests/bpf/progs/modify_return.c       | 40 ++++++++++++++
>   .../selftests/bpf/progs/tracing_struct.c      | 54 +++++++++++++++++++
>   11 files changed, 271 insertions(+), 7 deletions(-)

This triggers test failures on arm64 in BPF CI given the additions are
not yet supported there:

https://github.com/kernel-patches/bpf/actions/runs/5371020820/jobs/9743606263
https://github.com/kernel-patches/bpf/actions/runs/5371020820/jobs/9743606326

[...]
Notice: Success: 362/3077, Skipped: 12, Failed: 3
Error: #71 fentry_fexit
   Error: #71 fentry_fexit
   test_fentry_fexit:PASS:fentry_skel_load 0 nsec
   test_fentry_fexit:PASS:fexit_skel_load 0 nsec
   test_fentry_fexit:FAIL:fentry_attach unexpected error: -1 (errno 524)
Error: #72 fentry_test
   Error: #72 fentry_test
   test_fentry_test:PASS:fentry_skel_load 0 nsec
   fentry_test:FAIL:fentry_attach unexpected error: -1 (errno 524)
   test_fentry_test:FAIL:fentry_first_attach unexpected error: -1 (errno 524)
Error: #76 fexit_test
   Error: #76 fexit_test
   test_fexit_test:PASS:fexit_skel_load 0 nsec
   fexit_test:FAIL:fexit_attach unexpected error: -1 (errno 524)
   test_fexit_test:FAIL:fexit_first_attach unexpected error: -1 (errno 524)
[...]

I think probably the best way would be to separate the new test cases and
then update tools/testing/selftests/bpf/DENYLIST.aarch64 to exclude them
from being run on arm64 until support gets added there too.

Thanks,
Daniel

  reply	other threads:[~2023-06-26 14:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-22  7:57 [PATCH bpf-next v7 0/3] bpf, x86: allow function arguments up to 12 for TRACING menglong8.dong
2023-06-22  7:57 ` [PATCH bpf-next v7 1/3] bpf, x86: save/restore regs with BPF_DW size menglong8.dong
2023-06-22  7:57 ` [PATCH bpf-next v7 2/3] bpf, x86: allow function arguments up to 12 for TRACING menglong8.dong
2023-06-22  7:57 ` [PATCH bpf-next v7 3/3] selftests/bpf: add testcase for TRACING with 6+ arguments menglong8.dong
2023-06-26 14:47   ` Daniel Borkmann [this message]
2023-06-26 15:05     ` Menglong Dong

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=d507239c-0e73-abb3-3863-f4363b8fdd11@iogearbox.net \
    --to=daniel@iogearbox.net \
    --cc=alexei.starovoitov@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=benbjiang@tencent.com \
    --cc=bpf@vger.kernel.org \
    --cc=haoluo@google.com \
    --cc=imagedong@tencent.com \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=kpsingh@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=menglong8.dong@gmail.com \
    --cc=revest@chromium.org \
    --cc=sdf@google.com \
    --cc=song@kernel.org \
    --cc=yhs@fb.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 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).