|
|
@ -19,7 +19,7 @@ use aya::programs::{CgroupSkb, CgroupSkbAttachType};
|
|
|
|
{%- when "tracepoint" -%}
|
|
|
|
{%- when "tracepoint" -%}
|
|
|
|
use aya::programs::TracePoint;
|
|
|
|
use aya::programs::TracePoint;
|
|
|
|
{%- when "lsm" -%}
|
|
|
|
{%- when "lsm" -%}
|
|
|
|
use aya::programs::Lsm;
|
|
|
|
use aya::{programs::Lsm, Btf};
|
|
|
|
{%- endcase %}
|
|
|
|
{%- endcase %}
|
|
|
|
use std::{
|
|
|
|
use std::{
|
|
|
|
convert::{TryFrom,TryInto},
|
|
|
|
convert::{TryFrom,TryInto},
|
|
|
@ -94,8 +94,9 @@ fn try_main() -> Result<(), anyhow::Error> {
|
|
|
|
program.load()?;
|
|
|
|
program.load()?;
|
|
|
|
program.attach("{{tracepoint_category}}", "{{tracepoint_name}}")?;
|
|
|
|
program.attach("{{tracepoint_category}}", "{{tracepoint_name}}")?;
|
|
|
|
{%- when "lsm" -%}
|
|
|
|
{%- when "lsm" -%}
|
|
|
|
|
|
|
|
let btf = Btf::from_sys_fs()?;
|
|
|
|
let program: &mut Lsm = bpf.program_mut("{{lsm_hook}}")?.try_into()?;
|
|
|
|
let program: &mut Lsm = bpf.program_mut("{{lsm_hook}}")?.try_into()?;
|
|
|
|
program.load("{{lsm_hook}}")?;
|
|
|
|
program.load("{{lsm_hook}}", &btf)?;
|
|
|
|
program.attach()?;
|
|
|
|
program.attach()?;
|
|
|
|
{%- endcase %}
|
|
|
|
{%- endcase %}
|
|
|
|
|
|
|
|
|
|
|
|