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§
Source§impl Hooks for RealHooks
impl Hooks for RealHooks
Source§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
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
Source§unsafe 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
.
Source§unsafe 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
.
Source§unsafe 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
.
Source§unsafe 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
.
Source§unsafe 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
.
Source§unsafe 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
.
Source§unsafe 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
.
Source§unsafe 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
.
Source§unsafe 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
.
Source§unsafe 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
.
Source§unsafe 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
.
Source§unsafe 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
.
Auto Trait Implementations§
impl Freeze for RealHooks
impl RefUnwindSafe for RealHooks
impl Send for RealHooks
impl Sync for RealHooks
impl Unpin for RealHooks
impl UnwindSafe for RealHooks
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more