lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZrnuIgIMjNp1HARW@krava>
Date: Mon, 12 Aug 2024 13:12:34 +0200
From: Jiri Olsa <olsajiri@...il.com>
To: "Daniel T. Lee" <danieltimlee@...il.com>
Cc: Daniel Borkmann <daniel@...earbox.net>,
	Alexei Starovoitov <ast@...nel.org>,
	Andrii Nakryiko <andrii.nakryiko@...il.com>,
	Martin KaFai Lau <martin.lau@...ux.dev>,
	Eduard Zingerman <eddyz87@...il.com>, Song Liu <song@...nel.org>,
	Yonghong Song <yonghong.song@...ux.dev>,
	John Fastabend <john.fastabend@...il.com>,
	KP Singh <kpsingh@...nel.org>, Stanislav Fomichev <sdf@...ichev.me>,
	Hao Luo <haoluo@...gle.com>, Mykola Lysenko <mykolal@...com>,
	Shuah Khan <shuah@...nel.org>, Yipeng Zou <zouyipeng@...wei.com>,
	linux-kselftest@...r.kernel.org, bpf@...r.kernel.org,
	netdev@...r.kernel.org
Subject: Re: [bpf-next 2/3] selftests/bpf: add rename tracepoint bench test

On Mon, Aug 12, 2024 at 12:45:02AM +0000, Daniel T. Lee wrote:
> In addition to migrating the tracepoint overhead test from sample/bpf
> to selftest/bpf, this commit extends benchmarking test with rename
> task.
> 
> Since previous commit migrated tracepoint based on rename task, this
> commit updates the benchmarking program to utilize the newly added
> 'rename-tp'.
> 
> Signed-off-by: Daniel T. Lee <danieltimlee@...il.com>

Acked-by: Jiri Olsa <jolsa@...nel.org>

jirka

> ---
>  tools/testing/selftests/bpf/bench.c              |  2 ++
>  .../testing/selftests/bpf/benchs/bench_rename.c  | 16 ++++++++++++++++
>  .../selftests/bpf/benchs/run_bench_rename.sh     |  2 +-
>  3 files changed, 19 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/bpf/bench.c b/tools/testing/selftests/bpf/bench.c
> index 627b74ae041b..e3d17b9b78cc 100644
> --- a/tools/testing/selftests/bpf/bench.c
> +++ b/tools/testing/selftests/bpf/bench.c
> @@ -495,6 +495,7 @@ extern const struct bench bench_rename_kretprobe;
>  extern const struct bench bench_rename_rawtp;
>  extern const struct bench bench_rename_fentry;
>  extern const struct bench bench_rename_fexit;
> +extern const struct bench bench_rename_tp;
>  
>  /* pure counting benchmarks to establish theoretical lmits */
>  extern const struct bench bench_trig_usermode_count;
> @@ -552,6 +553,7 @@ static const struct bench *benchs[] = {
>  	&bench_rename_rawtp,
>  	&bench_rename_fentry,
>  	&bench_rename_fexit,
> +	&bench_rename_tp,
>  	/* pure counting benchmarks for establishing theoretical limits */
>  	&bench_trig_usermode_count,
>  	&bench_trig_kernel_count,
> diff --git a/tools/testing/selftests/bpf/benchs/bench_rename.c b/tools/testing/selftests/bpf/benchs/bench_rename.c
> index bf66893c7a33..48cd9556ddf8 100644
> --- a/tools/testing/selftests/bpf/benchs/bench_rename.c
> +++ b/tools/testing/selftests/bpf/benchs/bench_rename.c
> @@ -106,6 +106,12 @@ static void setup_fexit(void)
>  	attach_bpf(ctx.skel->progs.prog5);
>  }
>  
> +static void setup_tp(void)
> +{
> +	setup_ctx();
> +	attach_bpf(ctx.skel->progs.prog6);
> +}
> +
>  const struct bench bench_rename_base = {
>  	.name = "rename-base",
>  	.validate = validate,
> @@ -136,6 +142,16 @@ const struct bench bench_rename_kretprobe = {
>  	.report_final = hits_drops_report_final,
>  };
>  
> +const struct bench bench_rename_tp = {
> +	.name = "rename-tp",
> +	.validate = validate,
> +	.setup = setup_tp,
> +	.producer_thread = producer,
> +	.measure = measure,
> +	.report_progress = hits_drops_report_progress,
> +	.report_final = hits_drops_report_final,
> +};
> +
>  const struct bench bench_rename_rawtp = {
>  	.name = "rename-rawtp",
>  	.validate = validate,
> diff --git a/tools/testing/selftests/bpf/benchs/run_bench_rename.sh b/tools/testing/selftests/bpf/benchs/run_bench_rename.sh
> index 7b281dbe4165..131e5e6ea8ec 100755
> --- a/tools/testing/selftests/bpf/benchs/run_bench_rename.sh
> +++ b/tools/testing/selftests/bpf/benchs/run_bench_rename.sh
> @@ -2,7 +2,7 @@
>  
>  set -eufo pipefail
>  
> -for i in base kprobe kretprobe rawtp fentry fexit
> +for i in base kprobe kretprobe rawtp fentry fexit tp
>  do
>  	summary=$(sudo ./bench -w2 -d5 -a rename-$i | tail -n1 | cut -d'(' -f1 | cut -d' ' -f3-)
>  	printf "%-10s: %s\n" $i "$summary"
> -- 
> 2.43.0
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ