You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
aya/ebpf/aya-ebpf/src/programs/perf_event.rs

22 lines
396 B
Rust

use core::ffi::c_void;
use aya_ebpf_bindings::bindings::bpf_perf_event_data;
use crate::EbpfContext;
pub struct PerfEventContext {
pub ctx: *mut bpf_perf_event_data,
}
impl PerfEventContext {
pub fn new(ctx: *mut bpf_perf_event_data) -> Self {
Self { ctx }
}
}
impl EbpfContext for PerfEventContext {
fn as_ptr(&self) -> *mut c_void {
self.ctx.cast()
}
}