Commit 62a6d092 authored by Ian Rogers's avatar Ian Rogers Committed by Namhyung Kim
Browse files

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: default avatarIan Rogers <irogers@google.com>
Acked-by: default avatarKan Liang <kan.liang@linux.intel.com>
Link: https://lore.kernel.org/r/20241106004818.2174593-1-irogers@google.com


Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
parent d8c0f8b4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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 &&