aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/bench/syscall.c
diff options
context:
space:
mode:
authorTiezhu Yang <[email protected]>2022-11-10 03:50:07 +0000
committerArnaldo Carvalho de Melo <[email protected]>2023-02-02 19:32:19 +0000
commit391f84e5555c20a5b5ca4a2b0c3daec383765a09 (patch)
tree8ed20027c4e3b49e3e97abd0dd0ada3351403e9c /tools/perf/bench/syscall.c
parentperf bench syscall: Introduce bench_syscall_common() (diff)
downloadkernel-391f84e5555c20a5b5ca4a2b0c3daec383765a09.tar.gz
kernel-391f84e5555c20a5b5ca4a2b0c3daec383765a09.zip
perf bench syscall: Add getpgid syscall benchmark
This commit adds a simple getpgid syscall benchmark, more syscall benchmarks can be added in the future. Signed-off-by: Tiezhu Yang <[email protected]> Acked-by: Namhyung Kim <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Peter Zijlstra <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Diffstat (limited to 'tools/perf/bench/syscall.c')
-rw-r--r--tools/perf/bench/syscall.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/perf/bench/syscall.c b/tools/perf/bench/syscall.c
index 746fd7171921..6411b146ba68 100644
--- a/tools/perf/bench/syscall.c
+++ b/tools/perf/bench/syscall.c
@@ -46,6 +46,9 @@ static int bench_syscall_common(int argc, const char **argv, int syscall)
case __NR_getppid:
getppid();
break;
+ case __NR_getpgid:
+ getpgid(0);
+ break;
default:
break;
}
@@ -58,6 +61,9 @@ static int bench_syscall_common(int argc, const char **argv, int syscall)
case __NR_getppid:
name = "getppid()";
break;
+ case __NR_getpgid:
+ name = "getpgid()";
+ break;
default:
break;
}
@@ -100,3 +106,8 @@ int bench_syscall_basic(int argc, const char **argv)
{
return bench_syscall_common(argc, argv, __NR_getppid);
}
+
+int bench_syscall_getpgid(int argc, const char **argv)
+{
+ return bench_syscall_common(argc, argv, __NR_getpgid);
+}