linux-stable/tools/perf
Ian Rogers cf95808632 perf stat: Avoid metric-only segv
[ Upstream commit 2543947c77 ]

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: 088519f318 ("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>
2024-03-26 18:22:20 -04:00
..
arch
bench parisc: Align parisc MADV_XXX constants with all other architectures 2023-01-18 11:42:00 +01:00
Documentation perf record/stat: Explicitly call out event modifiers in the documentation 2020-09-05 11:22:49 +02:00
examples/bpf
include/bpf
jvmti
lib
pmu-events perf jevents: Make build dependency on test JSONs 2023-09-23 11:00:05 +02:00
python tweewide: Fix most Shebang lines 2021-05-22 11:38:30 +02:00
scripts perf scripts python: exported-sql-viewer.py: Fix warning display 2021-06-03 08:59:00 +02:00
tests perf test uprobe_from_different_cu: Skip if there is no gcc 2023-08-11 11:53:55 +02:00
trace perf trace: Add the syscall_arg_fmt pointer to syscall_arg 2023-01-18 11:41:28 +01:00
ui perf hists browser: Fix hierarchy mode header 2023-09-23 11:00:00 +02:00
util perf stat: Avoid metric-only segv 2024-03-26 18:22:20 -04:00
.gitignore
Build
builtin-annotate.c
builtin-bench.c
builtin-buildid-cache.c
builtin-buildid-list.c
builtin-c2c.c perf c2c: Fix sorting in percent_rmt_hitm_cmp() 2022-06-14 18:11:56 +02:00
builtin-config.c
builtin-data.c
builtin-diff.c
builtin-evlist.c
builtin-ftrace.c perf ftrace: Fix access to pid in array when setting a pid filter 2021-05-07 10:51:37 +02:00
builtin-help.c
builtin-inject.c perf inject: Close inject.output on exit 2021-07-28 13:31:02 +02:00
builtin-kallsyms.c
builtin-kmem.c
builtin-kvm.c
builtin-list.c
builtin-lock.c perf lock: Don't free "lock_seq_stat" if read_count isn't zero 2020-11-24 13:29:05 +01:00
builtin-mem.c
builtin-probe.c
builtin-record.c perf record: Fix possible incorrect free in record__switch_output() 2024-03-26 18:22:19 -04:00
builtin-report.c perf report: Fix memory leaks around perf_tip() 2021-12-08 09:01:10 +01:00
builtin-sched.c perf sched: Cast PTHREAD_STACK_MIN to int as it may turn into sysconf(__SC_THREAD_STACK_MIN_VALUE) 2023-05-17 11:35:32 +02:00
builtin-script.c perf script: Fix CPU filtering of a script's switch events 2022-01-05 12:37:46 +01:00
builtin-stat.c perf stat: Skip duration_time in setup_system_wide 2020-10-29 09:57:50 +01:00
builtin-timechart.c
builtin-top.c perf top: Skip side-band event setup if HAVE_LIBBPF_SUPPORT is not set 2024-01-25 14:34:33 -08:00
builtin-trace.c perf trace: Handle failure when trace point folder is missed 2023-01-18 11:41:28 +01:00
builtin-version.c
builtin.h
check-headers.sh x86: xen: insn: Decode Xen and KVM emulate-prefix signature 2022-05-15 19:54:47 +02:00
command-list.txt
CREDITS
design.txt
Makefile
Makefile.config perf tools: Add an option to build without libbfd 2023-09-23 11:00:05 +02:00
Makefile.perf tools: Factor HOSTCC, HOSTLD, HOSTAR definitions 2021-01-30 13:54:10 +01:00
MANIFEST
perf-archive.sh
perf-completion.sh perf tools: Fix auto-complete on aarch64 2023-03-11 16:43:49 +01:00
perf-read-vdso.c
perf-sys.h
perf-with-kcore.sh
perf.c perf tools: Fix perf's libperf_print callback 2022-04-15 14:18:38 +02:00
perf.h