|
|
@ -183,7 +183,7 @@ pub enum ProgramSection {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
Xdp {
|
|
|
|
Xdp {
|
|
|
|
name: String,
|
|
|
|
name: String,
|
|
|
|
frags_supported: bool,
|
|
|
|
frags: bool,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
SkMsg {
|
|
|
|
SkMsg {
|
|
|
|
name: String,
|
|
|
|
name: String,
|
|
|
@ -231,7 +231,7 @@ pub enum ProgramSection {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
Lsm {
|
|
|
|
Lsm {
|
|
|
|
name: String,
|
|
|
|
name: String,
|
|
|
|
sleepable_supported: bool,
|
|
|
|
sleepable: bool,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
BtfTracePoint {
|
|
|
|
BtfTracePoint {
|
|
|
|
name: String,
|
|
|
|
name: String,
|
|
|
@ -314,14 +314,8 @@ impl FromStr for ProgramSection {
|
|
|
|
"kretprobe" => KRetProbe { name },
|
|
|
|
"kretprobe" => KRetProbe { name },
|
|
|
|
"uprobe" => UProbe { name },
|
|
|
|
"uprobe" => UProbe { name },
|
|
|
|
"uretprobe" => URetProbe { name },
|
|
|
|
"uretprobe" => URetProbe { name },
|
|
|
|
"xdp" => Xdp {
|
|
|
|
"xdp" => Xdp { name, frags: false },
|
|
|
|
name,
|
|
|
|
"xdp.frags" => Xdp { name, frags: true },
|
|
|
|
frags_supported: false,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"xdp.frags" => Xdp {
|
|
|
|
|
|
|
|
name,
|
|
|
|
|
|
|
|
frags_supported: true,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"tp_btf" => BtfTracePoint { name },
|
|
|
|
"tp_btf" => BtfTracePoint { name },
|
|
|
|
_ if kind.starts_with("tracepoint") || kind.starts_with("tp") => {
|
|
|
|
_ if kind.starts_with("tracepoint") || kind.starts_with("tp") => {
|
|
|
|
// tracepoint sections are named `tracepoint/category/event_name`,
|
|
|
|
// tracepoint sections are named `tracepoint/category/event_name`,
|
|
|
@ -475,11 +469,11 @@ impl FromStr for ProgramSection {
|
|
|
|
"raw_tp" | "raw_tracepoint" => RawTracePoint { name },
|
|
|
|
"raw_tp" | "raw_tracepoint" => RawTracePoint { name },
|
|
|
|
"lsm" => Lsm {
|
|
|
|
"lsm" => Lsm {
|
|
|
|
name,
|
|
|
|
name,
|
|
|
|
sleepable_supported: false,
|
|
|
|
sleepable: false,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
"lsm.s" => Lsm {
|
|
|
|
"lsm.s" => Lsm {
|
|
|
|
name,
|
|
|
|
name,
|
|
|
|
sleepable_supported: true,
|
|
|
|
sleepable: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
"fentry" => FEntry { name },
|
|
|
|
"fentry" => FEntry { name },
|
|
|
|
"fexit" => FExit { name },
|
|
|
|
"fexit" => FExit { name },
|
|
|
@ -1846,7 +1840,7 @@ mod tests {
|
|
|
|
assert_matches!(
|
|
|
|
assert_matches!(
|
|
|
|
obj.programs.get("foo"),
|
|
|
|
obj.programs.get("foo"),
|
|
|
|
Some(Program {
|
|
|
|
Some(Program {
|
|
|
|
section: ProgramSection::Xdp { .. },
|
|
|
|
section: ProgramSection::Xdp { frags: false, .. },
|
|
|
|
..
|
|
|
|
..
|
|
|
|
})
|
|
|
|
})
|
|
|
|
);
|
|
|
|
);
|
|
|
@ -1867,10 +1861,7 @@ mod tests {
|
|
|
|
assert_matches!(
|
|
|
|
assert_matches!(
|
|
|
|
obj.programs.get("foo"),
|
|
|
|
obj.programs.get("foo"),
|
|
|
|
Some(Program {
|
|
|
|
Some(Program {
|
|
|
|
section: ProgramSection::Xdp {
|
|
|
|
section: ProgramSection::Xdp { frags: true, .. },
|
|
|
|
frags_supported: true,
|
|
|
|
|
|
|
|
..
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
..
|
|
|
|
..
|
|
|
|
})
|
|
|
|
})
|
|
|
|
);
|
|
|
|
);
|
|
|
@ -1928,7 +1919,10 @@ mod tests {
|
|
|
|
assert_matches!(
|
|
|
|
assert_matches!(
|
|
|
|
obj.programs.get("foo"),
|
|
|
|
obj.programs.get("foo"),
|
|
|
|
Some(Program {
|
|
|
|
Some(Program {
|
|
|
|
section: ProgramSection::Lsm { .. },
|
|
|
|
section: ProgramSection::Lsm {
|
|
|
|
|
|
|
|
sleepable: false,
|
|
|
|
|
|
|
|
..
|
|
|
|
|
|
|
|
},
|
|
|
|
..
|
|
|
|
..
|
|
|
|
})
|
|
|
|
})
|
|
|
|
);
|
|
|
|
);
|
|
|
@ -1950,7 +1944,7 @@ mod tests {
|
|
|
|
obj.programs.get("foo"),
|
|
|
|
obj.programs.get("foo"),
|
|
|
|
Some(Program {
|
|
|
|
Some(Program {
|
|
|
|
section: ProgramSection::Lsm {
|
|
|
|
section: ProgramSection::Lsm {
|
|
|
|
sleepable_supported: true,
|
|
|
|
sleepable: true,
|
|
|
|
..
|
|
|
|
..
|
|
|
|
},
|
|
|
|
},
|
|
|
|
..
|
|
|
|
..
|
|
|
|