Skip to content

Commit

Permalink
aya: Fix uprobe support on 4.16 and lower
Browse files Browse the repository at this point in the history
Fix uprobe support on Ubuntu 18.04.
  • Loading branch information
marysaka committed Jun 5, 2023
1 parent 41fe944 commit 49c6f5d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions aya/src/programs/probe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,17 +160,20 @@ fn create_probe_event(
KProbe | UProbe => 'p',
KRetProbe | URetProbe => 'r',
};

let fixed_fn_name = fn_name.replace(['.', '/', '-'], "_");

let event_alias = format!(
"aya_{}_{}_{}_{:#x}_{}",
process::id(),
probe_type_prefix,
fn_name,
fixed_fn_name,
offset,
PROBE_NAME_INDEX.fetch_add(1, Ordering::AcqRel)
);
let offset_suffix = match kind {
KProbe => format!("+{offset}"),
UProbe => format!(":{offset:#x}"),
UProbe | URetProbe => format!(":{offset:#x}"),
_ => "".to_string(),
};
let probe = format!(
Expand Down

0 comments on commit 49c6f5d

Please sign in to comment.