[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID:
<GV1PR08MB10521E382B62E14F8EF4BF5BEFB652@GV1PR08MB10521.eurprd08.prod.outlook.com>
Date: Fri, 13 Sep 2024 13:56:46 +0000
From: Yeo Reum Yun <YeoReum.Yun@....com>
To: James Clark <james.clark@...aro.org>
CC: "linux-perf-users@...r.kernel.org" <linux-perf-users@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>, nd
<nd@....com>, "peterz@...radead.org" <peterz@...radead.org>,
"mingo@...hat.com" <mingo@...hat.com>, "acme@...nel.org" <acme@...nel.org>,
"namhyung@...nel.org" <namhyung@...nel.org>, Mark Rutland
<Mark.Rutland@....com>, "alexander.shishkin@...ux.intel.com"
<alexander.shishkin@...ux.intel.com>, "jolsa@...nel.org" <jolsa@...nel.org>,
"irogers@...gle.com" <irogers@...gle.com>, "asmadeus@...ewreck.org"
<asmadeus@...ewreck.org>
Subject: Re: [PATCH v3 2/2] perf stat: Stop repeating when ref_perf_stat()
returns -1
> I meant this to be a function doc above the run_perf_stat() function.
> Usually what a function returns would be documented there, in case there
> end up being multiple callers.
Ah. okay. okay. I'll move to this to funciton.
Thanks.
________________________________________
From: James Clark <james.clark@...aro.org>
Sent: 13 September 2024 14:49
To: Yeo Reum Yun
Cc: linux-perf-users@...r.kernel.org; linux-kernel@...r.kernel.org; nd; peterz@...radead.org; mingo@...hat.com; acme@...nel.org; namhyung@...nel.org; Mark Rutland; alexander.shishkin@...ux.intel.com; jolsa@...nel.org; irogers@...gle.com; asmadeus@...ewreck.org
Subject: Re: [PATCH v3 2/2] perf stat: Stop repeating when ref_perf_stat() returns -1
On 13/09/2024 11:14, Levi Yun wrote:
> Exit when run_perf_stat() returns an error to avoid continuously
> repeating the same error message. It's not expected that COUNTER_FATAL
> or internal errors are recoverable so there's no point in retrying.
>
> This fixes the following flood of error messages for permission issues,
> for example when perf_event_paranoid==3:
> perf stat -r 1044 -- false
>
> Error:
> Access to performance monitoring and observability operations is limited.
> ...
> Error:
> Access to performance monitoring and observability operations is limited.
> ...
> (repeating for 1044 times).
>
> Signed-off-by: Levi Yun <yeoreum.yun@....com>
> ---
> tools/perf/builtin-stat.c | 14 +++++++++++++-
> 1 file changed, 13 insertions(+), 1 deletion(-)
>
> diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
> index 954eb37ce7b8..d25528ea7e40 100644
> --- a/tools/perf/builtin-stat.c
> +++ b/tools/perf/builtin-stat.c
> @@ -2875,7 +2875,19 @@ int cmd_stat(int argc, const char **argv)
> evlist__reset_prev_raw_counts(evsel_list);
>
> status = run_perf_stat(argc, argv, run_idx);
> - if (forever && status != -1 && !interval) {
> +
> + /*
> + * Returns -1 for fatal errors which signifies to not continue
> + * when in repeat mode.
> + *
> + * Returns < -1 error codes when stat record is used. These
> + * result in the stat information being displayed, but writing
> + * to the file fails and is non fatal.
> + */
I meant this to be a function doc above the run_perf_stat() function.
Usually what a function returns would be documented there, in case there
end up being multiple callers.
With that change:
Reviewed-by: James Clark <james.clark@...aro.org>
Also I think something happened with the cover letter as well, it's
marked as V2.
Powered by blists - more mailing lists