From: Ian Rogers Date: Wed, 6 Nov 2024 00:48:18 +0000 (-0800) Subject: perf stat: Expand metric+unit buffer size X-Git-Tag: v6.13-rc1~68^2~66 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=62a6d092f1e7e72365ecf65bbc3f268121130292;p=linux.git perf stat: Expand metric+unit buffer size 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 Acked-by: Kan Liang Link: https://lore.kernel.org/r/20241106004818.2174593-1-irogers@google.com Signed-off-by: Namhyung Kim --- diff --git a/tools/perf/util/stat-shadow.c b/tools/perf/util/stat-shadow.c index ada787947e16..47718610d5d8 100644 --- a/tools/perf/util/stat-shadow.c +++ b/tools/perf/util/stat-shadow.c @@ -517,7 +517,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]; if (metric_threshold && expr__parse(&threshold, pctx, metric_threshold) == 0 &&