diff options
| author | Ingo Molnar <mingo@kernel.org> | 2025-05-25 10:10:08 +0200 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2025-05-25 10:10:08 +0200 |
| commit | 94ec70880fd376dd5cc60ba2bd7ddf830b3d4f28 (patch) | |
| tree | f0cb51c5eeadc2927c648b49c713f10809db5fd5 /tools/perf/bench/futex-hash.c | |
| parent | cdb7d2d68cde6145a06a56c9d5d5d917297501c6 (diff) | |
| parent | 78272d44970c07899c78661f6b7492b5a7e14a90 (diff) | |
| download | linux-next-94ec70880fd376dd5cc60ba2bd7ddf830b3d4f28.tar.gz linux-next-94ec70880fd376dd5cc60ba2bd7ddf830b3d4f28.zip | |
Merge branch 'locking/futex' into locking/core, to pick up pending futex changes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/perf/bench/futex-hash.c')
| -rw-r--r-- | tools/perf/bench/futex-hash.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/perf/bench/futex-hash.c b/tools/perf/bench/futex-hash.c index b472eded521b..fdf133c9520f 100644 --- a/tools/perf/bench/futex-hash.c +++ b/tools/perf/bench/futex-hash.c @@ -18,9 +18,11 @@ #include <stdlib.h> #include <linux/compiler.h> #include <linux/kernel.h> +#include <linux/prctl.h> #include <linux/zalloc.h> #include <sys/time.h> #include <sys/mman.h> +#include <sys/prctl.h> #include <perf/cpumap.h> #include "../util/mutex.h" @@ -50,9 +52,12 @@ struct worker { static struct bench_futex_parameters params = { .nfutexes = 1024, .runtime = 10, + .nbuckets = -1, }; static const struct option options[] = { + OPT_INTEGER( 'b', "buckets", ¶ms.nbuckets, "Specify amount of hash buckets"), + OPT_BOOLEAN( 'I', "immutable", ¶ms.buckets_immutable, "Make the hash buckets immutable"), OPT_UINTEGER('t', "threads", ¶ms.nthreads, "Specify amount of threads"), OPT_UINTEGER('r', "runtime", ¶ms.runtime, "Specify runtime (in seconds)"), OPT_UINTEGER('f', "futexes", ¶ms.nfutexes, "Specify amount of futexes per threads"), @@ -118,6 +123,7 @@ static void print_summary(void) printf("%sAveraged %ld operations/sec (+- %.2f%%), total secs = %d\n", !params.silent ? "\n" : "", avg, rel_stddev_stats(stddev, avg), (int)bench__runtime.tv_sec); + futex_print_nbuckets(¶ms); } int bench_futex_hash(int argc, const char **argv) @@ -161,6 +167,7 @@ int bench_futex_hash(int argc, const char **argv) if (!params.fshared) futex_flag = FUTEX_PRIVATE_FLAG; + futex_set_nbuckets_param(¶ms); printf("Run summary [PID %d]: %d threads, each operating on %d [%s] futexes for %d secs.\n\n", getpid(), params.nthreads, params.nfutexes, params.fshared ? "shared":"private", params.runtime); |
