From: "Liang, Kan" <kan.liang@linux.intel.com>
To: Ian Rogers <irogers@google.com>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Namhyung Kim <namhyung@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@kernel.org>,
Adrian Hunter <adrian.hunter@intel.com>,
linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1] perf stat: Expand metric+unit buffer size
Date: Wed, 6 Nov 2024 10:27:03 -0500 [thread overview]
Message-ID: <126ebac6-fb52-4c3c-b364-0b423e164d40@linux.intel.com> (raw)
In-Reply-To: <20241106004818.2174593-1-irogers@google.com>
On 2024-11-05 7:48 p.m., Ian Rogers wrote:
> Long metric names combined with units may exceed the metric_bf and
> lead to truncation. Double metric_bf in size to avoid this.
>
> Signed-off-by: Ian Rogers <irogers@google.com>
> ---
> tools/perf/util/stat-shadow.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/perf/util/stat-shadow.c b/tools/perf/util/stat-shadow.c
> index 8c9292aa61d3..6b531d4f58a3 100644
> --- a/tools/perf/util/stat-shadow.c
> +++ b/tools/perf/util/stat-shadow.c
> @@ -507,7 +507,7 @@ static void generic_metric(struct perf_stat_config *config,
> if (!metric_events[i]) {
> if (expr__parse(&ratio, pctx, metric_expr) == 0) {
> char *unit;
> - char metric_bf[64];
> + char metric_bf[128];
I thin there is already a MAX_EVENT_NAME.
Can we similarly define a MAX_METRIC_NAME for it?
Thanks,
Kan
>
> if (metric_threshold &&
> expr__parse(&threshold, pctx, metric_threshold) == 0 &&
next prev parent reply other threads:[~2024-11-06 15:27 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-06 0:48 [PATCH v1] perf stat: Expand metric+unit buffer size Ian Rogers
2024-11-06 15:27 ` Liang, Kan [this message]
2024-11-06 16:04 ` Ian Rogers
2024-11-06 16:23 ` Liang, Kan
2024-11-07 19:07 ` Namhyung Kim
2024-11-07 19:38 ` Liang, Kan
2024-11-08 17:35 ` Namhyung Kim
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=126ebac6-fb52-4c3c-b364-0b423e164d40@linux.intel.com \
--to=kan.liang@linux.intel.com \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=irogers@google.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.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;
as well as URLs for NNTP newsgroup(s).