Skip to content

Commit

Permalink
scxtop: proposing to add bus-cycles event.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
devnexen committed Jan 18, 2025
1 parent 8776d1b commit 96828f0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tools/scxtop/src/perf_event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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"));
}
Expand Down

0 comments on commit 96828f0

Please sign in to comment.