diff mbox series

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

Message ID 20240812004503.43206-3-danieltimlee@gmail.com (mailing list archive)
State Changes Requested
Delegated to: BPF
Headers show
Series samples/bpf: Remove obsolete tracing-related tests | expand

Checks

Context Check Description
bpf/vmtest-bpf-next-PR success PR summary
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for bpf-next, async
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 7 this patch: 7
netdev/build_tools success Errors and warnings before: 10 this patch: 10
netdev/cc_maintainers warning 1 maintainers not CCed: andrii@kernel.org
netdev/build_clang success Errors and warnings before: 7 this patch: 7
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success net selftest script(s) already in Makefile
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 7 this patch: 7
netdev/checkpatch warning WARNING: externs should be avoided in .c files
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
bpf/vmtest-bpf-next-VM_Test-42 success Logs for x86_64-llvm-18 / veristat
bpf/vmtest-bpf-next-VM_Test-0 success Logs for Lint
bpf/vmtest-bpf-next-VM_Test-3 success Logs for Validate matrix.py
bpf/vmtest-bpf-next-VM_Test-2 success Logs for Unittests
bpf/vmtest-bpf-next-VM_Test-1 success Logs for ShellCheck
bpf/vmtest-bpf-next-VM_Test-5 success Logs for aarch64-gcc / build-release
bpf/vmtest-bpf-next-VM_Test-10 success Logs for aarch64-gcc / veristat
bpf/vmtest-bpf-next-VM_Test-12 success Logs for s390x-gcc / build-release
bpf/vmtest-bpf-next-VM_Test-11 success Logs for s390x-gcc / build / build for s390x with gcc
bpf/vmtest-bpf-next-VM_Test-16 success Logs for s390x-gcc / veristat
bpf/vmtest-bpf-next-VM_Test-18 success Logs for x86_64-gcc / build / build for x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-28 success Logs for x86_64-llvm-17 / build-release / build for x86_64 with llvm-17-O2
bpf/vmtest-bpf-next-VM_Test-19 success Logs for x86_64-gcc / build-release
bpf/vmtest-bpf-next-VM_Test-4 success Logs for aarch64-gcc / build / build for aarch64 with gcc
bpf/vmtest-bpf-next-VM_Test-27 success Logs for x86_64-llvm-17 / build / build for x86_64 with llvm-17
bpf/vmtest-bpf-next-VM_Test-17 success Logs for set-matrix
bpf/vmtest-bpf-next-VM_Test-33 success Logs for x86_64-llvm-17 / veristat
bpf/vmtest-bpf-next-VM_Test-34 success Logs for x86_64-llvm-18 / build / build for x86_64 with llvm-18
bpf/vmtest-bpf-next-VM_Test-35 success Logs for x86_64-llvm-18 / build-release / build for x86_64 with llvm-18-O2
bpf/vmtest-bpf-next-VM_Test-41 success Logs for x86_64-llvm-18 / veristat
bpf/vmtest-bpf-next-VM_Test-9 success Logs for aarch64-gcc / test (test_verifier, false, 360) / test_verifier on aarch64 with gcc
bpf/vmtest-bpf-next-VM_Test-14 success Logs for s390x-gcc / test (test_progs_no_alu32, false, 360) / test_progs_no_alu32 on s390x with gcc
bpf/vmtest-bpf-next-VM_Test-15 success Logs for s390x-gcc / test (test_verifier, false, 360) / test_verifier on s390x with gcc
bpf/vmtest-bpf-next-VM_Test-6 success Logs for aarch64-gcc / test (test_maps, false, 360) / test_maps on aarch64 with gcc
bpf/vmtest-bpf-next-VM_Test-7 success Logs for aarch64-gcc / test (test_progs, false, 360) / test_progs on aarch64 with gcc
bpf/vmtest-bpf-next-VM_Test-13 success Logs for s390x-gcc / test (test_progs, false, 360) / test_progs on s390x with gcc
bpf/vmtest-bpf-next-VM_Test-8 success Logs for aarch64-gcc / test (test_progs_no_alu32, false, 360) / test_progs_no_alu32 on aarch64 with gcc
bpf/vmtest-bpf-next-VM_Test-25 success Logs for x86_64-gcc / test (test_verifier, false, 360) / test_verifier on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-32 success Logs for x86_64-llvm-17 / test (test_verifier, false, 360) / test_verifier on x86_64 with llvm-17
bpf/vmtest-bpf-next-VM_Test-23 success Logs for x86_64-gcc / test (test_progs_no_alu32_parallel, true, 30) / test_progs_no_alu32_parallel on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-22 success Logs for x86_64-gcc / test (test_progs_no_alu32, false, 360) / test_progs_no_alu32 on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-24 success Logs for x86_64-gcc / test (test_progs_parallel, true, 30) / test_progs_parallel on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-26 success Logs for x86_64-gcc / veristat / veristat on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-21 success Logs for x86_64-gcc / test (test_progs, false, 360) / test_progs on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-20 success Logs for x86_64-gcc / test (test_maps, false, 360) / test_maps on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-31 success Logs for x86_64-llvm-17 / test (test_progs_no_alu32, false, 360) / test_progs_no_alu32 on x86_64 with llvm-17
bpf/vmtest-bpf-next-VM_Test-29 success Logs for x86_64-llvm-17 / test (test_maps, false, 360) / test_maps on x86_64 with llvm-17
bpf/vmtest-bpf-next-VM_Test-30 success Logs for x86_64-llvm-17 / test (test_progs, false, 360) / test_progs on x86_64 with llvm-17
bpf/vmtest-bpf-next-VM_Test-36 success Logs for x86_64-llvm-18 / test (test_maps, false, 360) / test_maps on x86_64 with llvm-18
bpf/vmtest-bpf-next-VM_Test-37 success Logs for x86_64-llvm-18 / test (test_progs, false, 360) / test_progs on x86_64 with llvm-18
bpf/vmtest-bpf-next-VM_Test-38 success Logs for x86_64-llvm-18 / test (test_progs_cpuv4, false, 360) / test_progs_cpuv4 on x86_64 with llvm-18
bpf/vmtest-bpf-next-VM_Test-39 success Logs for x86_64-llvm-18 / test (test_progs_no_alu32, false, 360) / test_progs_no_alu32 on x86_64 with llvm-18
bpf/vmtest-bpf-next-VM_Test-40 success Logs for x86_64-llvm-18 / test (test_verifier, false, 360) / test_verifier on x86_64 with llvm-18

Commit Message

Daniel T. Lee Aug. 12, 2024, 12:45 a.m. UTC
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@gmail.com>
---
 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(-)

Comments

Jiri Olsa Aug. 12, 2024, 11:12 a.m. UTC | #1
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@gmail.com>

Acked-by: Jiri Olsa <jolsa@kernel.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
>
diff mbox series

Patch

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"