Skip to content

Commit

Permalink
reducing code noise and probes data heap allocation.
Browse files Browse the repository at this point in the history
  • Loading branch information
devnexen committed Jan 30, 2025
1 parent a598e54 commit 3918b4c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
3 changes: 1 addition & 2 deletions tools/scxtop/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ impl<'a> App<'a> {
non_hw_event_active: false,
prev_bpf_sample_rate: sample_rate,
trace_tick: 0,
trace_tick_warmup: trace_tick_warmup,
trace_tick_warmup,
max_trace_ticks: trace_ticks,
trace_manager: PerfettoTraceManager::new(&trace_file_prefix, None),
};
Expand Down Expand Up @@ -1981,7 +1981,6 @@ impl<'a> App<'a> {
Action::SchedWakeup { .. } => {
if self.state == AppState::Tracing {
self.trace_manager.on_sched_wakeup(action);
return;
}
}
_ => {
Expand Down
9 changes: 4 additions & 5 deletions tools/scxtop/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,11 @@ async fn run() -> Result<()> {
let open_skel = builder.open(&mut open_object)?;
let skel = open_skel.load()?;

let mut links = Vec::new();
// Attach probes
links.push(skel.progs.on_sched_cpu_perf.attach()?);
links.push(skel.progs.scx_sched_reg.attach()?);
links.push(skel.progs.scx_sched_unreg.attach()?);
links.push(skel.progs.on_sched_switch.attach()?);
let mut links = vec![skel.progs.on_sched_cpu_perf.attach()?
, skel.progs.scx_sched_reg.attach()?
, skel.progs.scx_sched_unreg.attach()?
, skel.progs.on_sched_switch.attach()?];

// 6.13 compatability
if let Ok(link) = skel.progs.scx_insert_vtime.attach() {
Expand Down

0 comments on commit 3918b4c

Please sign in to comment.