.. | .. |
---|
11 | 11 | * Available benchmark collection list: |
---|
12 | 12 | * |
---|
13 | 13 | * sched ... scheduler and IPC performance |
---|
| 14 | + * syscall ... System call performance |
---|
14 | 15 | * mem ... memory access performance |
---|
15 | 16 | * numa ... NUMA scheduling and MM performance |
---|
16 | 17 | * futex ... Futex performance |
---|
| 18 | + * epoll ... Event poll performance |
---|
17 | 19 | */ |
---|
18 | | -#include "perf.h" |
---|
19 | | -#include "util/util.h" |
---|
20 | 20 | #include <subcmd/parse-options.h> |
---|
21 | 21 | #include "builtin.h" |
---|
22 | 22 | #include "bench/bench.h" |
---|
.. | .. |
---|
25 | 25 | #include <stdlib.h> |
---|
26 | 26 | #include <string.h> |
---|
27 | 27 | #include <sys/prctl.h> |
---|
| 28 | +#include <linux/zalloc.h> |
---|
28 | 29 | |
---|
29 | 30 | typedef int (*bench_fn_t)(int argc, const char **argv); |
---|
30 | 31 | |
---|
.. | .. |
---|
49 | 50 | { NULL, NULL, NULL } |
---|
50 | 51 | }; |
---|
51 | 52 | |
---|
| 53 | +static struct bench syscall_benchmarks[] = { |
---|
| 54 | + { "basic", "Benchmark for basic getppid(2) calls", bench_syscall_basic }, |
---|
| 55 | + { "all", "Run all syscall benchmarks", NULL }, |
---|
| 56 | + { NULL, NULL, NULL }, |
---|
| 57 | +}; |
---|
| 58 | + |
---|
52 | 59 | static struct bench mem_benchmarks[] = { |
---|
53 | 60 | { "memcpy", "Benchmark for memcpy() functions", bench_mem_memcpy }, |
---|
54 | 61 | { "memset", "Benchmark for memset() functions", bench_mem_memset }, |
---|
| 62 | + { "find_bit", "Benchmark for find_bit() functions", bench_mem_find_bit }, |
---|
55 | 63 | { "all", "Run all memory access benchmarks", NULL }, |
---|
56 | 64 | { NULL, NULL, NULL } |
---|
57 | 65 | }; |
---|
.. | .. |
---|
67 | 75 | { NULL, NULL, NULL } |
---|
68 | 76 | }; |
---|
69 | 77 | |
---|
| 78 | +#ifdef HAVE_EVENTFD_SUPPORT |
---|
| 79 | +static struct bench epoll_benchmarks[] = { |
---|
| 80 | + { "wait", "Benchmark epoll concurrent epoll_waits", bench_epoll_wait }, |
---|
| 81 | + { "ctl", "Benchmark epoll concurrent epoll_ctls", bench_epoll_ctl }, |
---|
| 82 | + { "all", "Run all futex benchmarks", NULL }, |
---|
| 83 | + { NULL, NULL, NULL } |
---|
| 84 | +}; |
---|
| 85 | +#endif // HAVE_EVENTFD_SUPPORT |
---|
| 86 | + |
---|
| 87 | +static struct bench internals_benchmarks[] = { |
---|
| 88 | + { "synthesize", "Benchmark perf event synthesis", bench_synthesize }, |
---|
| 89 | + { "kallsyms-parse", "Benchmark kallsyms parsing", bench_kallsyms_parse }, |
---|
| 90 | + { "inject-build-id", "Benchmark build-id injection", bench_inject_build_id }, |
---|
| 91 | + { NULL, NULL, NULL } |
---|
| 92 | +}; |
---|
| 93 | + |
---|
70 | 94 | struct collection { |
---|
71 | 95 | const char *name; |
---|
72 | 96 | const char *summary; |
---|
.. | .. |
---|
75 | 99 | |
---|
76 | 100 | static struct collection collections[] = { |
---|
77 | 101 | { "sched", "Scheduler and IPC benchmarks", sched_benchmarks }, |
---|
| 102 | + { "syscall", "System call benchmarks", syscall_benchmarks }, |
---|
78 | 103 | { "mem", "Memory access benchmarks", mem_benchmarks }, |
---|
79 | 104 | #ifdef HAVE_LIBNUMA_SUPPORT |
---|
80 | 105 | { "numa", "NUMA scheduling and MM benchmarks", numa_benchmarks }, |
---|
81 | 106 | #endif |
---|
82 | 107 | {"futex", "Futex stressing benchmarks", futex_benchmarks }, |
---|
| 108 | +#ifdef HAVE_EVENTFD_SUPPORT |
---|
| 109 | + {"epoll", "Epoll stressing benchmarks", epoll_benchmarks }, |
---|
| 110 | +#endif |
---|
| 111 | + { "internals", "Perf-internals benchmarks", internals_benchmarks }, |
---|
83 | 112 | { "all", "All benchmarks", NULL }, |
---|
84 | 113 | { NULL, NULL, NULL } |
---|
85 | 114 | }; |
---|