From 96828f0bfaa2bc999b772b3e16a247f071c410e3 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Sat, 18 Jan 2025 14:09:48 +0000 Subject: [PATCH] scxtop: proposing to add bus-cycles event. if the hardware does not have PMUs, the graph just does not provide any data. Can have its use for memory intensive tasks for example. --- tools/scxtop/src/perf_event.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/scxtop/src/perf_event.rs b/tools/scxtop/src/perf_event.rs index 72c96deba..28d0bd527 100644 --- a/tools/scxtop/src/perf_event.rs +++ b/tools/scxtop/src/perf_event.rs @@ -148,6 +148,11 @@ impl PerfEvent { "stalled-cycles-frontend".to_string(), 0, )); + avail_events.push(PerfEvent::new( + "hw".to_string(), + "bus-cycles".to_string(), + 0, + )); avail_events } @@ -229,6 +234,9 @@ impl PerfEvent { "stalled-cycles-frontend" => { attrs.config = perf::bindings::PERF_COUNT_HW_STALLED_CYCLES_FRONTEND as u64; } + "bus-cycles" | "bus_cycles" => { + attrs.config = perf::bindings::PERF_COUNT_HW_BUS_CYCLES as u64; + } _ => { return Err(anyhow!("unknown event")); }