All of lore.kernel.org
 help / color / mirror / Atom feed
From: Menglong Dong <menglong.dong@linux.dev>
To: ast@kernel.org, jolsa@kernel.org,
	Menglong Dong <menglong8.dong@gmail.com>
Cc: daniel@iogearbox.net, john.fastabend@gmail.com,
	andrii@kernel.org, martin.lau@linux.dev, eddyz87@gmail.com,
	song@kernel.org, yonghong.song@linux.dev, kpsingh@kernel.org,
	sdf@fomichev.me, haoluo@google.com, mattbobrowski@google.com,
	rostedt@goodmis.org, mhiramat@kernel.org,
	mathieu.desnoyers@efficios.com, leon.hwang@linux.dev,
	jiang.biao@linux.dev, bpf@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org
Subject: Re: [PATCH bpf-next v2 07/10] selftests/bpf: test get_func_ip for fsession
Date: Wed, 22 Oct 2025 22:11:23 +0800	[thread overview]
Message-ID: <5933395.DvuYhMxLoT@7950hx> (raw)
In-Reply-To: <20251022080159.553805-8-dongml2@chinatelecom.cn>

On 2025/10/22 16:01, Menglong Dong wrote:
> As the layout of the stack changed for fsession, we'd better test
> bpf_get_func_ip() for it.
> 
> Signed-off-by: Menglong Dong <dongml2@chinatelecom.cn>
> ---
>  .../selftests/bpf/prog_tests/get_func_ip_test.c    |  2 ++
>  .../testing/selftests/bpf/progs/get_func_ip_test.c | 14 ++++++++++++++
>  2 files changed, 16 insertions(+)
> 
> diff --git a/tools/testing/selftests/bpf/prog_tests/get_func_ip_test.c b/tools/testing/selftests/bpf/prog_tests/get_func_ip_test.c
> index c40242dfa8fb..a9078a1dbb07 100644
> --- a/tools/testing/selftests/bpf/prog_tests/get_func_ip_test.c
> +++ b/tools/testing/selftests/bpf/prog_tests/get_func_ip_test.c
> @@ -46,6 +46,8 @@ static void test_function_entry(void)
>  	ASSERT_EQ(skel->bss->test5_result, 1, "test5_result");
>  	ASSERT_EQ(skel->bss->test7_result, 1, "test7_result");
>  	ASSERT_EQ(skel->bss->test8_result, 1, "test8_result");
> +	ASSERT_EQ(skel->bss->test9_result1, 1, "test9_result1");
> +	ASSERT_EQ(skel->bss->test9_result2, 1, "test9_result2");

Oops, the fsession part should be factor out, and be skipped
if not X86_64, which failed the CI for !X86_64 arch :(

I'll fix it in the next version.

>  
>  cleanup:
>  	get_func_ip_test__destroy(skel);
> diff --git a/tools/testing/selftests/bpf/progs/get_func_ip_test.c b/tools/testing/selftests/bpf/progs/get_func_ip_test.c
> index 2011cacdeb18..9acb79fc7537 100644
> --- a/tools/testing/selftests/bpf/progs/get_func_ip_test.c
> +++ b/tools/testing/selftests/bpf/progs/get_func_ip_test.c
> @@ -103,3 +103,17 @@ int BPF_URETPROBE(test8, int ret)
>  	test8_result = (const void *) addr == (const void *) uprobe_trigger;
>  	return 0;
>  }
> +
> +__u64 test9_result1 = 0;
> +__u64 test9_result2 = 0;
> +SEC("fsession/bpf_fentry_test1")
> +int BPF_PROG(test9, int a)
> +{
> +	__u64 addr = bpf_get_func_ip(ctx);
> +
> +	if (bpf_tracing_is_exit(ctx))
> +		test9_result1 = (const void *) addr == &bpf_fentry_test1;
> +	else
> +		test9_result2 = (const void *) addr == &bpf_fentry_test1;
> +	return 0;
> +}
> 





  reply	other threads:[~2025-10-22 14:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-22  8:01 [PATCH bpf-next v2 00/10] bpf: tracing session supporting Menglong Dong
2025-10-22  8:01 ` [PATCH bpf-next v2 01/10] bpf: add tracing session support Menglong Dong
2025-10-22  8:01 ` [PATCH bpf-next v2 02/10] bpf: add kfunc bpf_tracing_is_exit for TRACE_SESSION Menglong Dong
2025-10-22  8:01 ` [PATCH bpf-next v2 03/10] bpf: add kfunc bpf_fsession_cookie for TRACING SESSION Menglong Dong
2025-10-22  8:01 ` [PATCH bpf-next v2 04/10] bpf,x86: add ret_off to invoke_bpf() Menglong Dong
2025-10-22  8:01 ` [PATCH bpf-next v2 05/10] bpf,x86: add tracing session supporting for x86_64 Menglong Dong
2025-10-22  8:01 ` [PATCH bpf-next v2 06/10] libbpf: add support for tracing session Menglong Dong
2025-10-22  8:01 ` [PATCH bpf-next v2 07/10] selftests/bpf: test get_func_ip for fsession Menglong Dong
2025-10-22 14:11   ` Menglong Dong [this message]
2025-10-22  8:19 ` [PATCH bpf-next v2 00/10] bpf: tracing session supporting 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=5933395.DvuYhMxLoT@7950hx \
    --to=menglong.dong@linux.dev \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=haoluo@google.com \
    --cc=jiang.biao@linux.dev \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=kpsingh@kernel.org \
    --cc=leon.hwang@linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mattbobrowski@google.com \
    --cc=menglong8.dong@gmail.com \
    --cc=mhiramat@kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=sdf@fomichev.me \
    --cc=song@kernel.org \
    --cc=yonghong.song@linux.dev \
    /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.