Re: [PATCH 8/8] perf bench futex: Fix wording in futex bench messages
From: Namhyung Kim
Date: Mon Oct 05 2026 - 19:58:26 EST
On Sat, Sep 26, 2026 at 08:04:07PM +0100, Michal Pluta wrote:
> When the kernel is using a different number of hash buckets than
> requested with -b, the message printed is ungrammatical, and it ends
> with a stale errno even though nothing failed:
>
> Requested number of hash buckets does not currently used.
> Requested: 3 in usage: 64
> perf: prctl(PR_FUTEX_HASH): No such file or directory
>
> Fix the wording and use errx(), so that no errno text is printed:
>
> Requested number of buckets differs from the number in use.
> Requested: 3, in use: 64
> perf: prctl(PR_FUTEX_HASH)
Maybe better split the errx() change as it seems there are some other
places need the same change.
Thanks,
Namhyung
>
> Also fix "Wokeup" in the 'futex wake' output, which should be "Woke up".
>
> Fixes: 60035a3981a7 ("tools/perf: Allow to select the number of hash buckets")
> Assisted-by: LLM
> Signed-off-by: Michal Pluta <michalpl2003@xxxxxxxxx>
> ---
> tools/perf/bench/futex-wake.c | 4 ++--
> tools/perf/bench/futex.c | 6 +++---
> 2 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/tools/perf/bench/futex-wake.c b/tools/perf/bench/futex-wake.c
> index 7674622639ca..2cbf31e121d5 100644
> --- a/tools/perf/bench/futex-wake.c
> +++ b/tools/perf/bench/futex-wake.c
> @@ -89,7 +89,7 @@ static void print_summary(void)
> double waketime_stddev = stddev_stats(&waketime_stats);
> unsigned int wakeup_avg = avg_stats(&wakeup_stats);
>
> - printf("Wokeup %d of %d threads in %.4f ms (+-%.2f%%)\n",
> + printf("Woke up %d of %d threads in %.4f ms (+-%.2f%%)\n",
> wakeup_avg,
> params.nthreads,
> waketime_avg / USEC_PER_MSEC,
> @@ -223,7 +223,7 @@ int bench_futex_wake(int argc, const char **argv)
> update_stats(&waketime_stats, runtime_us);
>
> if (!params.silent) {
> - printf("[Run %d]: Wokeup %d of %d threads in %.4f ms\n",
> + printf("[Run %d]: Woke up %d of %d threads in %.4f ms\n",
> j + 1, nwoken, params.nthreads,
> runtime_us / (double)USEC_PER_MSEC);
> }
> diff --git a/tools/perf/bench/futex.c b/tools/perf/bench/futex.c
> index 5757d47f8f7c..be0cbc03682c 100644
> --- a/tools/perf/bench/futex.c
> +++ b/tools/perf/bench/futex.c
> @@ -43,9 +43,9 @@ void futex_print_nbuckets(struct bench_futex_parameters *params)
> printf("Can't query number of buckets: %m\n");
> err(EXIT_FAILURE, "prctl(PR_FUTEX_HASH)");
> }
> - printf("Requested number of hash buckets does not currently used.\n");
> - printf("Requested: %d in usage: %d\n", params->nbuckets, ret);
> - err(EXIT_FAILURE, "prctl(PR_FUTEX_HASH)");
> + printf("Requested number of buckets differs from the number in use.\n");
> + printf("Requested: %d, in use: %d\n", params->nbuckets, ret);
> + errx(EXIT_FAILURE, "prctl(PR_FUTEX_HASH)");
> }
> if (params->nbuckets == 0)
> ret = asprintf(&futex_hash_mode, "Futex hashing: global hash");
> --
> 2.43.0
>