summaryrefslogtreecommitdiff
path: root/scripts/stackusage
diff options
context:
space:
mode:
authorAaron Tomlin <atomlin@atomlin.com>2026-08-06 11:39:23 -0400
committerNamhyung Kim <namhyung@kernel.org>2026-08-07 10:56:22 -0700
commit4a81d59a9d81e6db4e76f84a3d2638e64ff79533 (patch)
tree3c7886c3a2447318d07c5f76881d845f6ba74fa9 /scripts/stackusage
parent006a6f0f6ea629a5b37d7b9f3299cf5b6aecb42e (diff)
downloadlinux-4a81d59a9d81e6db4e76f84a3d2638e64ff79533.tar.gz
linux-4a81d59a9d81e6db4e76f84a3d2638e64ff79533.zip
perf sched: Suppress latency table output when trace samples are missing
When 'perf sched latency' is executed on a perf.data file that lacks tracepoint samples (i.e., a file recorded without the -R flag or containing only non-tracepoint events), perf_session__has_traces() correctly outputs an error message. However, perf_sched__read_events() subsequently falls through and returns 0 (success). Consequently, caller functions such as perf_sched__lat() assume event processing succeeded and proceed to render empty latency header tables and total summary statistics. Fix this behaviour by ensuring perf_sched__read_events() aborts early and returns a suitable error code when perf_session__has_traces() evaluates to false. Additionally, validate thread__get_runtime() against NULL in map_switch_event() to prevent potential null-pointer dereferences. Fixes: 27295592c22e ("perf session: Share the common trace sample_check routine as perf_session__has_traces") Reviewed-by: Ian Rogers <irogers@google.com> Signed-off-by: Aaron Tomlin <atomlin@atomlin.com> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Diffstat (limited to 'scripts/stackusage')
0 files changed, 0 insertions, 0 deletions