aya_ebpf/programs/
perf_event.rs

1use core::ffi::c_void;
2
3use crate::EbpfContext;
4
5pub struct PerfEventContext {
6    ctx: *mut c_void,
7}
8
9impl PerfEventContext {
10    pub fn new(ctx: *mut c_void) -> PerfEventContext {
11        PerfEventContext { ctx }
12    }
13}
14
15impl EbpfContext for PerfEventContext {
16    fn as_ptr(&self) -> *mut c_void {
17        self.ctx
18    }
19}