Enum Record

Source
#[non_exhaustive]
pub enum Record<'a> {
Show 22 variants Mmap(Mmap<'a>), Lost(Lost), Comm(Comm<'a>), Exit(Exit), Throttle(Throttle), Unthrottle(Throttle), Fork(Fork), Read(Read), Sample(Box<Sample<'a>>), Mmap2(Mmap2<'a>), Aux(Aux), ITraceStart(ITraceStart), LostSamples(LostSamples), Switch, SwitchCpuWide(SwitchCpuWide), Namespaces(Namespaces<'a>), KSymbol(KSymbol<'a>), BpfEvent(BpfEvent), CGroup(CGroup<'a>), TextPoke(TextPoke<'a>), AuxOutputHwId(AuxOutputHwId), Unknown { ty: u32, data: Cow<'a, [u8]>, },
}
Expand description

A record emitted by the linux kernel.

This enum contains every supported record type emitted by the kernel. Depending on how the perf event counter was configured only a few of these will be emitted by any one counter.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Mmap(Mmap<'a>)

§

Lost(Lost)

§

Comm(Comm<'a>)

§

Exit(Exit)

§

Throttle(Throttle)

§

Unthrottle(Throttle)

§

Fork(Fork)

§

Read(Read)

§

Sample(Box<Sample<'a>>)

§

Mmap2(Mmap2<'a>)

§

Aux(Aux)

§

ITraceStart(ITraceStart)

§

LostSamples(LostSamples)

§

Switch

§

SwitchCpuWide(SwitchCpuWide)

§

Namespaces(Namespaces<'a>)

§

KSymbol(KSymbol<'a>)

§

BpfEvent(BpfEvent)

§

CGroup(CGroup<'a>)

§

TextPoke(TextPoke<'a>)

§

AuxOutputHwId(AuxOutputHwId)

§

Unknown

A record type that is unknown to this crate.

Note that just because a record is parsed as unknown in one release of this crate does not mean it will continue to be parsed in future releases. Adding a new variant to this enum is not considered to be a breaking change.

If you find yourself using the unknown variant to parse valid records emitted by the kernel please file an issue or create a PR to add support for them.

Fields

§ty: u32
§data: Cow<'a, [u8]>

Implementations§

Source§

impl<'p> Record<'p>

Source

pub fn parse_with_header<B, E>( p: &mut Parser<B, E>, header: perf_event_header, ) -> ParseResult<Self>
where E: Endian, B: ParseBuf<'p>,

Parse a Record using a perf_event_header that has already been parsed.

Trait Implementations§

Source§

impl<'a> Clone for Record<'a>

Source§

fn clone(&self) -> Record<'a>

Returns a duplicate of the value. Read more
1.0.0 · Source§

const fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for Record<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> From<Aux> for Record<'a>

Source§

fn from(value: Aux) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<AuxOutputHwId> for Record<'a>

Source§

fn from(value: AuxOutputHwId) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<BpfEvent> for Record<'a>

Source§

fn from(value: BpfEvent) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<CGroup<'a>> for Record<'a>

Source§

fn from(value: CGroup<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Comm<'a>> for Record<'a>

Source§

fn from(value: Comm<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<ITraceStart> for Record<'a>

Source§

fn from(value: ITraceStart) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<KSymbol<'a>> for Record<'a>

Source§

fn from(value: KSymbol<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Lost> for Record<'a>

Source§

fn from(value: Lost) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<LostSamples> for Record<'a>

Source§

fn from(value: LostSamples) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Mmap<'a>> for Record<'a>

Source§

fn from(value: Mmap<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Mmap2<'a>> for Record<'a>

Source§

fn from(value: Mmap2<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Namespaces<'a>> for Record<'a>

Source§

fn from(value: Namespaces<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Read> for Record<'a>

Source§

fn from(value: Read) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Sample<'a>> for Record<'a>

Source§

fn from(value: Sample<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<SwitchCpuWide> for Record<'a>

Source§

fn from(value: SwitchCpuWide) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<TextPoke<'a>> for Record<'a>

Source§

fn from(value: TextPoke<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'p> Parse<'p> for Record<'p>

Source§

fn parse<B, E>(p: &mut Parser<B, E>) -> ParseResult<Self>
where E: Endian, B: ParseBuf<'p>,

Parse Self using the provided Parser instance.

Auto Trait Implementations§

§

impl<'a> Freeze for Record<'a>

§

impl<'a> RefUnwindSafe for Record<'a>

§

impl<'a> Send for Record<'a>

§

impl<'a> Sync for Record<'a>

§

impl<'a> Unpin for Record<'a>

§

impl<'a> UnwindSafe for Record<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.