1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use crate::prelude::*;

/// LOST_SAMPLES records indicate that some samples were lost while using
/// hardware sampling.
///
/// This struct corresponds to `PERF_RECORD_LOST_SAMPLES`. See the [manpage]
/// for more documentation.
///
/// [manpage]: http://man7.org/linux/man-pages/man2/perf_event_open.2.html
#[derive(Clone, Debug)]
pub struct LostSamples {
    /// The number of potentially lost samples.
    pub lost: u64,
}

impl<'p> Parse<'p> for LostSamples {
    fn parse<B, E>(p: &mut Parser<B, E>) -> ParseResult<Self>
    where
        E: Endian,
        B: ParseBuf<'p>,
    {
        Ok(Self { lost: p.parse()? })
    }
}