mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: Michal Pluta <michalpl2003@gmail.com>
Cc: acme@kernel.org, "Thomas Gleixner" <tglx@kernel.org>,
	"Ingo Molnar" <mingo@redhat.com>,
	"Peter Zijlstra" <peterz@infradead.org>,
	"Darren Hart" <dvhart@infradead.org>,
	"Davidlohr Bueso" <dave@stgolabs.net>,
	"André Almeida" <andrealmeid@igalia.com>,
	"Mark Rutland" <mark.rutland@arm.com>,
	"Alexander Shishkin" <alexander.shishkin@linux.intel.com>,
	"Jiri Olsa" <jolsa@kernel.org>, "Ian Rogers" <irogers@google.com>,
	"Adrian Hunter" <adrian.hunter@intel.com>,
	"James Clark" <james.clark@linaro.org>,
	"Sebastian Andrzej Siewior" <bigeasy@linutronix.de>,
	linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org
Subject: Re: [PATCH 8/8] perf bench futex: Fix wording in futex bench messages
Date: Mon, 5 Oct 2026 16:57:15 -0700	[thread overview]
Message-ID: <asQ5W6FU7l5LlYEo@google.com> (raw)
In-Reply-To: <20260926190407.1106421-9-michalpl2003@gmail.com>

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@gmail.com>
> ---
>  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
> 

      reply	other threads:[~2026-10-05 23:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-26 19:03 [PATCH 0/8] perf bench futex: Fix several bugs and bad inputs Michal Pluta
2026-09-26 19:04 ` [PATCH 1/8] perf bench futex: Retry futex_wait() when interrupted by a signal Michal Pluta
2026-09-26 19:04 ` [PATCH 2/8] perf bench futex: Set the number of hash buckets in futex wake Michal Pluta
2026-09-26 19:04 ` [PATCH 3/8] perf bench futex: Use the whole timeval for elapsed times Michal Pluta
2026-10-05 23:54   ` Namhyung Kim
2026-09-26 19:04 ` [PATCH 4/8] perf bench futex: Reject invalid -q, -f and -b values Michal Pluta
2026-09-26 19:04 ` [PATCH 5/8] perf bench futex: Stop when futex_wake() fails in futex wake Michal Pluta
2026-09-26 19:04 ` [PATCH 6/8] perf bench futex: Use a 64-bit operation counter in hash and lock-pi Michal Pluta
2026-09-26 19:04 ` [PATCH 7/8] perf bench futex: Clean up two nits in futex hash Michal Pluta
2026-09-26 19:04 ` [PATCH 8/8] perf bench futex: Fix wording in futex bench messages Michal Pluta
2026-10-05 23:57   ` Namhyung Kim [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=asQ5W6FU7l5LlYEo@google.com \
    --to=namhyung@kernel.org \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=andrealmeid@igalia.com \
    --cc=bigeasy@linutronix.de \
    --cc=dave@stgolabs.net \
    --cc=dvhart@infradead.org \
    --cc=irogers@google.com \
    --cc=james.clark@linaro.org \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=michalpl2003@gmail.com \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tglx@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®