]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
perf stat: Avoid metric-only segv
authorIan Rogers <irogers@google.com>
Fri, 9 Feb 2024 20:49:46 +0000 (12:49 -0800)
committerSasha Levin <sashal@kernel.org>
Tue, 26 Mar 2024 22:19:48 +0000 (18:19 -0400)
commit40ae9bb1ddc71d23d241bbd4af1252e3537b5ac2
tree2fe6a14707289aa0a1291f8303dccb72805deb54
parente40ef597e57c83cf7bd4e44a8bdad82043704673
perf stat: Avoid metric-only segv

[ Upstream commit 2543947c77e0e224bda86b4e7220c2f6714da463 ]

Cycles is recognized as part of a hard coded metric in stat-shadow.c,
it may call print_metric_only with a NULL fmt string leading to a
segfault. Handle the NULL fmt explicitly.

Fixes: 088519f318be ("perf stat: Move the display functions to stat-display.c")
Signed-off-by: Ian Rogers <irogers@google.com>
Reviewed-by: Kan Liang <kan.liang@linux.intel.com>
Cc: K Prateek Nayak <kprateek.nayak@amd.com>
Cc: James Clark <james.clark@arm.com>
Cc: Kaige Ye <ye@kaige.org>
Cc: John Garry <john.g.garry@oracle.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/r/20240209204947.3873294-4-irogers@google.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/perf/util/stat-display.c