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<C: Read + Seek, T: ByteOrder>(
cursor: C,
) -> Result<Vec<Self>, Error>
pub fn parse_event_desc_section<C: Read + Seek, T: ByteOrder>( cursor: C, ) -> 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_simpleperf_attr_section<C: Read + Seek, T: ByteOrder>(
cursor: C,
attr_section: &PerfFileSection,
attr_size: u64,
event_types: &[SimplePerfEventType],
) -> Result<Vec<Self>, Error>
pub fn parse_simpleperf_attr_section<C: Read + Seek, T: ByteOrder>( cursor: C, attr_section: &PerfFileSection, attr_size: u64, event_types: &[SimplePerfEventType], ) -> Result<Vec<Self>, Error>
Parse the attr
section of a perf.data file into a Vec of AttributeDescription
structs,
for files from Simpleperf. These files pack event ID information into the attr
section
and contain event names in the SIMPLEPERF_META_INFO
section.
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
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read more