perf_event_data/records/
aux_output_hw_id.rs

1use crate::prelude::*;
2
3/// AUX_OUTPUT_HW_ID events allow matching data written to the aux area with
4/// an architecture-specific hadrware ID.
5///
6/// This is needed when combining Intel PT along with sampling multiple PEBS
7/// events. See the docs within `perf_event.h` for more explanation.
8///
9/// This struct corresponds to `PERF_RECORD_AUX_OUTPUT_HW_ID`. At the time of
10/// writing it is not yet documented in the [manpage]. However, there is
11/// documentation present within [the kernel source][src].
12///
13/// [manpage]: http://man7.org/linux/man-pages/man2/perf_event_open.2.html
14/// [src]: https://sourcegraph.com/github.com/torvalds/linux@eb7081409f94a9a8608593d0fb63a1aa3d6f95d8/-/blob/tools/include/uapi/linux/perf_event.h?L1205
15#[derive(Copy, Clone, Debug)]
16pub struct AuxOutputHwId {
17    /// An architecture-specific hardware ID.
18    pub hw_id: u64,
19}
20
21impl<'p> Parse<'p> for AuxOutputHwId {
22    fn parse<B, E>(p: &mut Parser<B, E>) -> ParseResult<Self>
23    where
24        E: Endian,
25        B: ParseBuf<'p>,
26    {
27        Ok(Self { hw_id: p.parse()? })
28    }
29}