Struct perf_event::hooks::RealHooks
source · pub struct RealHooks;
Expand description
An implementation of the Hooks
trait in terms of the real Linux system calls.
This type implements each methods of the Hooks
trait by
calling the underlying system call or ioctl. The following call
is equivalent to calling clear_thread_hooks
:
unsafe {
set_thread_hooks(Box::new(RealHooks));
}
If what you want is non-intercepted access to the underlying
system calls, it’s probably better to just access the
perf_event_open_sys
crate directly, rather than using this type.
Trait Implementations
sourceimpl Hooks for RealHooks
impl Hooks for RealHooks
sourceunsafe fn perf_event_open(
&mut self,
attrs: *mut perf_event_attr,
pid: pid_t,
cpu: c_int,
group_fd: c_int,
flags: c_ulong
) -> c_int
unsafe fn perf_event_open(
&mut self,
attrs: *mut perf_event_attr,
pid: pid_t,
cpu: c_int,
group_fd: c_int,
flags: c_ulong
) -> c_int
sourceunsafe fn ENABLE(&mut self, fd: c_int, arg: c_uint) -> c_int
unsafe fn ENABLE(&mut self, fd: c_int, arg: c_uint) -> c_int
Wrapper for perf_event ioctl
perf_event_ioctls_ENABLE
. Read more
sourceunsafe fn DISABLE(&mut self, fd: c_int, arg: c_uint) -> c_int
unsafe fn DISABLE(&mut self, fd: c_int, arg: c_uint) -> c_int
Wrapper for perf_event ioctl
perf_event_ioctls_DISABLE
. Read more
sourceunsafe fn REFRESH(&mut self, fd: c_int, arg: c_int) -> c_int
unsafe fn REFRESH(&mut self, fd: c_int, arg: c_int) -> c_int
Wrapper for perf_event ioctl
perf_event_ioctls_REFRESH
. Read more
sourceunsafe fn RESET(&mut self, fd: c_int, arg: c_uint) -> c_int
unsafe fn RESET(&mut self, fd: c_int, arg: c_uint) -> c_int
Wrapper for perf_event ioctl
perf_event_ioctls_RESET
. Read more
sourceunsafe fn PERIOD(&mut self, fd: c_int, arg: u64) -> c_int
unsafe fn PERIOD(&mut self, fd: c_int, arg: u64) -> c_int
Wrapper for perf_event ioctl
perf_event_ioctls_PERIOD
. Read more
sourceunsafe fn SET_OUTPUT(&mut self, fd: c_int, arg: c_int) -> c_int
unsafe fn SET_OUTPUT(&mut self, fd: c_int, arg: c_int) -> c_int
Wrapper for perf_event ioctl
perf_event_ioctls_SET_OUTPUT
. Read more
sourceunsafe fn SET_FILTER(&mut self, fd: c_int, arg: *mut c_char) -> c_int
unsafe fn SET_FILTER(&mut self, fd: c_int, arg: *mut c_char) -> c_int
Wrapper for perf_event ioctl
perf_event_ioctls_SET_FILTER
. Read more
sourceunsafe fn ID(&mut self, fd: c_int, arg: *mut u64) -> c_int
unsafe fn ID(&mut self, fd: c_int, arg: *mut u64) -> c_int
Wrapper for perf_event ioctl
perf_event_ioctls_ID
. Read more
sourceunsafe fn SET_BPF(&mut self, fd: c_int, arg: u32) -> c_int
unsafe fn SET_BPF(&mut self, fd: c_int, arg: u32) -> c_int
Wrapper for perf_event ioctl
perf_event_ioctls_SET_BPF
. Read more
sourceunsafe fn PAUSE_OUTPUT(&mut self, fd: c_int, arg: u32) -> c_int
unsafe fn PAUSE_OUTPUT(&mut self, fd: c_int, arg: u32) -> c_int
Wrapper for perf_event ioctl
perf_event_ioctls_PAUSE_OUTPUT
. Read more
sourceunsafe fn QUERY_BPF(&mut self, fd: c_int, arg: *mut perf_event_query_bpf) -> c_int
unsafe fn QUERY_BPF(&mut self, fd: c_int, arg: *mut perf_event_query_bpf) -> c_int
Wrapper for perf_event ioctl
perf_event_ioctls_QUERY_BPF
. Read more
sourceunsafe fn MODIFY_ATTRIBUTES(
&mut self,
fd: c_int,
arg: *mut perf_event_attr
) -> c_int
unsafe fn MODIFY_ATTRIBUTES(
&mut self,
fd: c_int,
arg: *mut perf_event_attr
) -> c_int
Wrapper for perf_event ioctl
perf_event_ioctls_MODIFY_ATTRIBUTES
. Read more
Auto Trait Implementations
impl RefUnwindSafe for RealHooks
impl Send for RealHooks
impl Sync for RealHooks
impl Unpin for RealHooks
impl UnwindSafe for RealHooks
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more