The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH v2 0/3] perf sched latency: Refine outputs, unit scaling, and histogram support
@ 2026-07-25 17:33 Aaron Tomlin
  2026-07-25 17:33 ` [PATCH v2 1/3] perf sched: Suppress latency table output when trace samples are missing Aaron Tomlin
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Aaron Tomlin @ 2026-07-25 17:33 UTC (permalink / raw)
  To: peterz, mingo, acme, namhyung
  Cc: mark.rutland, alexander.shishkin, jolsa, irogers, adrian.hunter,
	james.clark, howardchu95, atomlin, neelx, chjohnst, sean, steve,
	linux-perf-users, linux-kernel

This patch series improves 'perf sched latency' by fixing misleading empty
table output, introducing dynamic unit auto-scaling for latency and runtime
statistics, and adding latency histogram visualisation alongside time-span
filtering.

Patch 1 fixes a bug where 'perf sched latency' would fall through and
return success (0) when perf_session__has_traces() failed due to missing
tracepoint events in perf.data. This resulted in empty header tables and
zeroed summary statistics being printed. The fix ensures an early return of
a suitable error code.

Patch 2 introduces dynamic auto-scaling for display columns (Runtime, Avg
delay, Max delay). Previously, all values were unconditionally formatted in
milliseconds (ms), making microsecond or second-scale latencies difficult
to read. Columns are now scaled dynamically to the most appropriate unit
(ns, us, ms, s) and headers are updated accordingly.

Patch 3 adds three new command-line options to 'perf sched latency':
    --histogram (-H):
            Displays an ASCII bar chart of CPU wait latencies between
            snapshots

    --hist-mode:
            Configures the bucketing scheme to either logarithmic (log) or
            100 us equal-width linear (linear) mode

    --time:
            Filters event processing to a specified [start,stop] time span

Changes since v1:

 - Fixed integer overflow in latency_bucket() (Ian Rogers)

 - Linked to v1: https://lore.kernel.org/lkml/20260724142901.634761-1-atomlin@atomlin.com/

Aaron Tomlin (3):
  perf sched: Suppress latency table output when trace samples are
    missing
  perf sched latency: Auto-scale latency and runtime display units
  perf sched latency: Add histogram and time interval options

 tools/perf/Documentation/perf-sched.txt |   6 +
 tools/perf/builtin-sched.c              | 234 +++++++++++++++++++++---
 2 files changed, 219 insertions(+), 21 deletions(-)

-- 
2.54.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-07-25 17:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-25 17:33 [PATCH v2 0/3] perf sched latency: Refine outputs, unit scaling, and histogram support Aaron Tomlin
2026-07-25 17:33 ` [PATCH v2 1/3] perf sched: Suppress latency table output when trace samples are missing Aaron Tomlin
2026-07-25 17:33 ` [PATCH v2 2/3] perf sched latency: Auto-scale latency and runtime display units Aaron Tomlin
2026-07-25 17:33 ` [PATCH v2 3/3] perf sched latency: Add histogram and time interval options Aaron Tomlin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox