|
|
@ -35,6 +35,8 @@ use aya::{programs::BtfTracePoint, Btf};
|
|
|
|
use std::net::TcpStream;
|
|
|
|
use std::net::TcpStream;
|
|
|
|
use std::os::unix::io::AsRawFd;
|
|
|
|
use std::os::unix::io::AsRawFd;
|
|
|
|
use aya::programs::SocketFilter;
|
|
|
|
use aya::programs::SocketFilter;
|
|
|
|
|
|
|
|
{%- when "raw_tracepoint" -%}
|
|
|
|
|
|
|
|
use aya::programs::RawTracePoint;
|
|
|
|
{%- endcase %}
|
|
|
|
{%- endcase %}
|
|
|
|
use aya_log::BpfLogger;
|
|
|
|
use aya_log::BpfLogger;
|
|
|
|
use clap::Parser;
|
|
|
|
use clap::Parser;
|
|
|
@ -153,6 +155,10 @@ async fn main() -> Result<(), anyhow::Error> {
|
|
|
|
let cgroup = std::fs::File::open(opt.cgroup_path)?;
|
|
|
|
let cgroup = std::fs::File::open(opt.cgroup_path)?;
|
|
|
|
program.load()?;
|
|
|
|
program.load()?;
|
|
|
|
program.attach(cgroup)?;
|
|
|
|
program.attach(cgroup)?;
|
|
|
|
|
|
|
|
{%- when "raw_tracepoint" -%}
|
|
|
|
|
|
|
|
let program: &mut RawTracePoint = bpf.program_mut("{{crate_name}}").unwrap().try_into()?;
|
|
|
|
|
|
|
|
program.load()?;
|
|
|
|
|
|
|
|
program.attach("{{tracepoint_name}}")?;
|
|
|
|
{%- endcase %}
|
|
|
|
{%- endcase %}
|
|
|
|
|
|
|
|
|
|
|
|
info!("Waiting for Ctrl-C...");
|
|
|
|
info!("Waiting for Ctrl-C...");
|
|
|
|