Fix attach placeholder for kprobes

pull/10/head
Alessandro Decina 3 years ago
parent 7baf4f5688
commit ddbe4013bf

@ -57,7 +57,7 @@ fn try_main() -> Result<(), anyhow::Error> {
{%- when "kprobe", "kretprobe" -%} {%- when "kprobe", "kretprobe" -%}
let program: &mut KProbe = bpf.program_mut("{{crate_name}}")?.try_into()?; let program: &mut KProbe = bpf.program_mut("{{crate_name}}")?.try_into()?;
program.load()?; program.load()?;
program.attach("{{probe}}", 0)?; program.attach("{{kprobe}}", 0)?;
{%- when "uprobe", "uretprobe" -%} {%- when "uprobe", "uretprobe" -%}
let program: &mut UProbe = bpf.program_mut("{{crate_name}}")?.try_into()?; let program: &mut UProbe = bpf.program_mut("{{crate_name}}")?.try_into()?;
program.load()?; program.load()?;

Loading…
Cancel
Save