Struct linux_perf_data::AttributeDescription
source · pub struct AttributeDescription {
pub attr: PerfEventAttr,
pub name: Option<String>,
pub event_ids: Vec<u64>,
}
Expand description
A single event attr with name and corresponding event IDs.
Fields§
§attr: PerfEventAttr
§name: Option<String>
§event_ids: Vec<u64>
Implementations§
source§impl AttributeDescription
impl AttributeDescription
sourcepub fn parse_event_desc_section<R: Read, T: ByteOrder>(
reader: R
) -> Result<Vec<Self>, Error>
pub fn parse_event_desc_section<R: Read, T: ByteOrder>( reader: R ) -> Result<Vec<Self>, Error>
Parse the HEADER_EVENT_DESC
section of a perf.data file into a Vec of AttributeDescription
structs.
sourcepub fn parse_event_types_section<C: Read + Seek, T: ByteOrder>(
cursor: C,
event_types_section: &PerfFileSection,
attr_size: u64
) -> Result<Vec<Self>, Error>
pub fn parse_event_types_section<C: Read + Seek, T: ByteOrder>( cursor: C, event_types_section: &PerfFileSection, attr_size: u64 ) -> Result<Vec<Self>, Error>
Parse the event_types
section of a perf.data file into a Vec of AttributeDescription
structs.
This section was used in the past but is no longer used.
Only call this function if event_types_section.size is non-zero.
sourcepub fn parse_attr_section<C: Read + Seek, T: ByteOrder>(
cursor: C,
attr_section: &PerfFileSection,
attr_size: u64
) -> Result<Vec<Self>, Error>
pub fn parse_attr_section<C: Read + Seek, T: ByteOrder>( cursor: C, attr_section: &PerfFileSection, attr_size: u64 ) -> Result<Vec<Self>, Error>
Parse the attr
section of a perf.data file into a Vec of AttributeDescription
structs.
This section is used as a last resort because it does not have any
information about event IDs. If multiple events are observed, we will
not be able to know which event record belongs to which attr.
sourcepub fn attributes(&self) -> &PerfEventAttr
pub fn attributes(&self) -> &PerfEventAttr
The event attributes.
Trait Implementations§
source§impl Clone for AttributeDescription
impl Clone for AttributeDescription
source§fn clone(&self) -> AttributeDescription
fn clone(&self) -> AttributeDescription
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl RefUnwindSafe for AttributeDescription
impl Send for AttributeDescription
impl Sync for AttributeDescription
impl Unpin for AttributeDescription
impl UnwindSafe for AttributeDescription
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more