perf_event_data/records/lost_samples.rs
1use crate::prelude::*;
2
3/// LOST_SAMPLES records indicate that some samples were lost while using
4/// hardware sampling.
5///
6/// This struct corresponds to `PERF_RECORD_LOST_SAMPLES`. 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 LostSamples {
12 /// The number of potentially lost samples.
13 pub lost: u64,
14}
15
16impl<'p> Parse<'p> for LostSamples {
17 fn parse<B, E>(p: &mut Parser<B, E>) -> ParseResult<Self>
18 where
19 E: Endian,
20 B: ParseBuf<'p>,
21 {
22 Ok(Self { lost: p.parse()? })
23 }
24}