Skip to content

Commit

Permalink
wtf
Browse files Browse the repository at this point in the history
  • Loading branch information
tamird committed Oct 13, 2024
1 parent 32fac93 commit a1cb382
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions {{project-name}}/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,10 @@ async fn main() -> anyhow::Result<()> {
}
{% case program_type -%}
{%- when "kprobe", "kretprobe" -%}
use anyhow::Context as _;
let program: &mut KProbe = ebpf.program_mut("{{crate_name}}").unwrap().try_into()?;
program.load()?;
program.attach("{{kprobe}}", 0)?;
program.load().context("load")?;
program.attach("{{kprobe}}", 0).context("attach")?;
{%- when "fentry" -%}
let btf = Btf::from_sys_fs().context("BTF from sysfs")?;
let program: &mut FEntry = ebpf.program_mut("{{crate_name}}").unwrap().try_into()?;
Expand Down

0 comments on commit a1cb382

Please sign in to comment.