[−][src]Struct vignette::Sampler
Set's up the SIGPROF handler.
Dropping this reset's the handler.
Implementations
impl Sampler
[src]
pub fn new() -> Self
[src]
pub fn suspend_and_resume_thread<F, T>(&self, thread: Thread, callback: F) -> T where
F: FnOnce(&mut ucontext_t) -> T,
[src]
F: FnOnce(&mut ucontext_t) -> T,
Calls the callback with a suspended thread, then resumes the thread.
This function is dangerous!
- This function is not safe to call from multiple threads at the same time, nor is it safe to create multiple instances of Sampler and call this on two of them concurrently as it relies on global shared state.
- Callback must not perform any heap allocations, nor must it interact with any other shared locks that sampled threads can access.
- Callback should return as quickly as possible to keep the program performant.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Sampler
impl Send for Sampler
impl Sync for Sampler
impl Unpin for Sampler
impl UnwindSafe for Sampler
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Erased for T
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,