Struct linux_perf_event_reader::RawEventRecord
source · [−]pub struct RawEventRecord<'a> {
pub record_type: RecordType,
pub misc: u16,
pub data: RawData<'a>,
pub parse_info: RecordParseInfo,
}Expand description
An unparsed event record.
This can be converted into a parsed record by calling .parse().
The raw record also provides access to “common data” like the ID, timestamp,
tid etc., i.e. the information that was requested with SampleFormat and
AttrFlags::SAMPLE_ID_ALL.
Fields
record_type: RecordTypeThe record type. Must be a builtin type, i.e. not a user type.
misc: u16The misc value on this record.
data: RawData<'a>The raw bytes in the body of this record.
parse_info: RecordParseInfoThe parse info from our corresponding evnt’s attr.
Implementations
sourceimpl<'a> RawEventRecord<'a>
impl<'a> RawEventRecord<'a>
sourcepub fn new(
record_type: RecordType,
misc: u16,
data: RawData<'a>,
parse_info: RecordParseInfo
) -> Self
pub fn new(
record_type: RecordType,
misc: u16,
data: RawData<'a>,
parse_info: RecordParseInfo
) -> Self
Create a new RawEventRecord. Must only be called if record_type.is_builtin_type() is true.
sourcepub fn common_data(&self) -> Result<CommonData, Error>
pub fn common_data(&self) -> Result<CommonData, Error>
Parse “common data” on this record, see CommonData.
The available information is determined by the event attr, specifically
by the requested SampleFormat and by the
presence of the AttrFlags::SAMPLE_ID_ALL
flag: The SampleFormat determines the available fields, and the
SAMPLE_ID_ALL flag determines the record types on which these fields
are available. If SAMPLE_ID_ALL is set, the requested fields are
available on all records, otherwise only on sample records
(RecordType::SAMPLE).
sourcepub fn parse(&self) -> Result<EventRecord<'a>, Error>
pub fn parse(&self) -> Result<EventRecord<'a>, Error>
Parses this raw record into an EventRecord.
Trait Implementations
sourceimpl<'a> Clone for RawEventRecord<'a>
impl<'a> Clone for RawEventRecord<'a>
sourcefn clone(&self) -> RawEventRecord<'a>
fn clone(&self) -> RawEventRecord<'a>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl<'a> Debug for RawEventRecord<'a>
impl<'a> Debug for RawEventRecord<'a>
sourceimpl<'a> PartialEq<RawEventRecord<'a>> for RawEventRecord<'a>
impl<'a> PartialEq<RawEventRecord<'a>> for RawEventRecord<'a>
sourcefn eq(&self, other: &RawEventRecord<'a>) -> bool
fn eq(&self, other: &RawEventRecord<'a>) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourcefn ne(&self, other: &RawEventRecord<'a>) -> bool
fn ne(&self, other: &RawEventRecord<'a>) -> bool
This method tests for !=.
impl<'a> Eq for RawEventRecord<'a>
impl<'a> StructuralEq for RawEventRecord<'a>
impl<'a> StructuralPartialEq for RawEventRecord<'a>
Auto Trait Implementations
impl<'a> RefUnwindSafe for RawEventRecord<'a>
impl<'a> Send for RawEventRecord<'a>
impl<'a> Sync for RawEventRecord<'a>
impl<'a> Unpin for RawEventRecord<'a>
impl<'a> UnwindSafe for RawEventRecord<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more