pub struct Comm {
pub record_id: Option<RecordId>,
pub by_execve: bool,
pub task: Task,
pub comm: CString,
}
Expand description
Process name (comm) has been changed.
§Examples
use perf_event_open::config::{Cpu, Opts, Proc};
use perf_event_open::count::Counter;
use perf_event_open::event::sw::Software;
let event = Software::Dummy;
let target = (Proc::CURRENT, Cpu::ALL);
let mut opts = Opts::default();
opts.extra_record.comm = true;
let counter = Counter::new(event, target, opts).unwrap();
let sampler = counter.sampler(5).unwrap();
counter.enable().unwrap();
// Change the process name to "foo" to trigger the `Comm` record.
unsafe { libc::prctl(libc::PR_SET_NAME, c"foo".as_ptr()) };
let mut iter = sampler.iter();
while let Some(it) = iter.next() {
println!("{:-?}", it);
}
Fields§
§record_id: Option<RecordId>
Record IDs.
by_execve: bool
Whether comm was changed by execve
.
task: Task
Task info.
comm: CString
New comm.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Comm
impl RefUnwindSafe for Comm
impl Send for Comm
impl Sync for Comm
impl Unpin for Comm
impl UnwindSafe for Comm
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