perf_event_data/records/itrace_start.rs
1use crate::prelude::*;
2
3/// ITRACE_START records indicate when a process has started an instruction
4/// trace.
5///
6/// This struct corresponds to `PERF_RECORD_ITRACE_START`. See the [manpage]
7/// for more documentation.
8///
9/// [manpage]: http://man7.org/linux/man-pages/man2/perf_event_open.2.html
10#[derive(Clone, Debug)]
11pub struct ITraceStart {
12 /// Process ID of thread starting an instruction trace.
13 pub pid: u32,
14
15 /// Thread ID of thread starting an instruction trace.
16 pub tid: u32,
17}
18
19impl<'p> Parse<'p> for ITraceStart {
20 fn parse<B, E>(p: &mut Parser<B, E>) -> ParseResult<Self>
21 where
22 E: Endian,
23 B: ParseBuf<'p>,
24 {
25 Ok(Self {
26 pid: p.parse()?,
27 tid: p.parse()?,
28 })
29 }
30}