Re: [bpf-next 2/3] selftests/bpf: add rename tracepoint bench test

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>

Acked-by: Jiri Olsa <jolsa@xxxxxxxxxx>

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
> 




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux