From 764d1d7de888a619b37969ba17fdddb339700e2d Mon Sep 17 00:00:00 2001 From: Daniel Hodges Date: Sat, 11 Jan 2025 09:50:16 -0500 Subject: [PATCH] scxtop: Fix attach on newer kernels Signed-off-by: Daniel Hodges --- tools/scxtop/src/main.rs | 60 +++++++--------------------------------- 1 file changed, 10 insertions(+), 50 deletions(-) diff --git a/tools/scxtop/src/main.rs b/tools/scxtop/src/main.rs index 50ef589e0..a3858bc37 100644 --- a/tools/scxtop/src/main.rs +++ b/tools/scxtop/src/main.rs @@ -77,74 +77,34 @@ async fn run() -> Result<()> { links.push(skel.progs.on_sched_switch.attach()?); // 6.13 compatability - if let Ok(link) = skel - .progs - .scx_insert_vtime - .attach_kprobe(false, "scx_bpf_dsq_insert_vtime") - { + if let Ok(link) = skel.progs.scx_insert_vtime.attach() { links.push(link); } - if let Ok(link) = skel - .progs - .scx_dispatch_vtime - .attach_kprobe(false, "scx_bpf_dispatch_vtime") - { + if let Ok(link) = skel.progs.scx_dispatch_vtime.attach() { links.push(link); } - if let Ok(link) = skel - .progs - .scx_insert - .attach_kprobe(false, "scx_bpf_dsq_insert") - { + if let Ok(link) = skel.progs.scx_insert.attach() { links.push(link); } - if let Ok(link) = skel - .progs - .scx_dispatch - .attach_kprobe(false, "scx_bpf_dispatch") - { + if let Ok(link) = skel.progs.scx_dispatch.attach() { links.push(link); } - if let Ok(link) = skel - .progs - .scx_dispatch_from_dsq_set_vtime - .attach_kprobe(false, "scx_bpf_dispatch_from_dsq_set_vtime") - { + if let Ok(link) = skel.progs.scx_dispatch_from_dsq_set_vtime.attach() { links.push(link); } - if let Ok(link) = skel - .progs - .scx_dsq_move_set_vtime - .attach_kprobe(false, "scx_bpf_dsq_move_set_vtime") - { + if let Ok(link) = skel.progs.scx_dsq_move_set_vtime.attach() { links.push(link); } - if let Ok(link) = skel - .progs - .scx_dsq_move_set_slice - .attach_kprobe(false, "scx_bpf_dsq_move_set_slice") - { + if let Ok(link) = skel.progs.scx_dsq_move_set_slice.attach() { links.push(link); } - if let Ok(link) = skel - .progs - .scx_dispatch_from_dsq_set_slice - .attach_kprobe(false, "scx_bpf_dispatch_from_dsq_set_slice") - { + if let Ok(link) = skel.progs.scx_dispatch_from_dsq_set_slice.attach() { links.push(link); } - if let Ok(link) = skel - .progs - .scx_dispatch_from_dsq - .attach_kprobe(false, "scx_bpf_dispatch_from_dsq") - { + if let Ok(link) = skel.progs.scx_dispatch_from_dsq.attach() { links.push(link); } - if let Ok(link) = skel - .progs - .scx_dsq_move - .attach_kprobe(false, "scx_bpf_dsq_move") - { + if let Ok(link) = skel.progs.scx_dsq_move.attach() { links.push(link); }