summaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-bench.c
diff options
context:
space:
mode:
authorAndrei Vagin <avagin@google.com>2023-03-08 08:32:01 +0100
committerKees Cook <keescook@chromium.org>2023-07-18 01:08:08 +0200
commit7d5cb68af638fc370e89df4c2d8d8c4708600e67 (patch)
treefa592a113117da5a65a359341b707a3bc08ce468 /tools/perf/builtin-bench.c
parentselftest/seccomp: add a new test for the sync mode of seccomp_user_notify (diff)
downloadlinux-7d5cb68af638fc370e89df4c2d8d8c4708600e67.tar.xz
linux-7d5cb68af638fc370e89df4c2d8d8c4708600e67.zip
perf/benchmark: add a new benchmark for seccom_unotify
The benchmark is similar to the pipe benchmark. It creates two processes, one is calling syscalls, and another process is handling them via seccomp user notifications. It measures the time required to run a specified number of interations. $ ./perf bench sched seccomp-notify --sync-mode --loop 1000000 # Running 'sched/seccomp-notify' benchmark: # Executed 1000000 system calls Total time: 2.769 [sec] 2.769629 usecs/op 361059 ops/sec $ ./perf bench sched seccomp-notify # Running 'sched/seccomp-notify' benchmark: # Executed 1000000 system calls Total time: 8.571 [sec] 8.571119 usecs/op 116670 ops/sec Signed-off-by: Andrei Vagin <avagin@google.com> Acked-by: "Peter Zijlstra (Intel)" <peterz@infradead.org> Link: https://lore.kernel.org/r/20230308073201.3102738-7-avagin@google.com Link: https://lore.kernel.org/r/20230630051953.454638-1-avagin@gmail.com [kees: Added PRIu64 format string] Signed-off-by: Kees Cook <keescook@chromium.org>
Diffstat (limited to 'tools/perf/builtin-bench.c')
-rw-r--r--tools/perf/builtin-bench.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/perf/builtin-bench.c b/tools/perf/builtin-bench.c
index db435b791a09..5033e8bab276 100644
--- a/tools/perf/builtin-bench.c
+++ b/tools/perf/builtin-bench.c
@@ -47,6 +47,7 @@ static struct bench numa_benchmarks[] = {
static struct bench sched_benchmarks[] = {
{ "messaging", "Benchmark for scheduling and IPC", bench_sched_messaging },
{ "pipe", "Benchmark for pipe() between two processes", bench_sched_pipe },
+ { "seccomp-notify", "Benchmark for seccomp user notify", bench_sched_seccomp_notify},
{ "all", "Run all scheduler benchmarks", NULL },
{ NULL, NULL, NULL }
};