mirror of https://github.com/aya-rs/aya
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.
22 lines
396 B
Rust
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()
|
|
}
|
|
}
|