pub struct ProfilePacket {
pub strings: Vec<InternedString>,
pub mappings: Vec<Mapping>,
pub frames: Vec<Frame>,
pub callstacks: Vec<Callstack>,
pub process_dumps: Vec<ProcessHeapSamples>,
pub continued: Option<bool>,
pub index: Option<u64>,
}
Expand description
The packet emitted by heapprofd for each heap snapshot. A snapshot can involve more than one ProfilePacket if the snapshot is big (when |continued| is true). The cardinality and grouping is as follows: A ProfilePacket contains:
- 1+ per-process heap snapshots (ProcessHeapSamples). Normally there is only one heap per process (the main malloc/free heap), but there can be more if the process is using the heapprofd API to profile custom allocators.
- Globally interned strings, mappings and frames (to allow de-duplicating frames/mapping in common between different processes). A ProcessHeapSamples contains:
- The process and heap identifier.
- A number of HeapSample, one for each callsite that had some alloc/frees.
- Statistics about heapprofd internals (e.g., sampling/unwinding timings). A HeapSample contains statistics about callsites:
- Total number of bytes allocated and freed from that callsite.
- Total number of alloc/free calls sampled.
- Stats at the local maximum when dump_at_max = true. See https://perfetto.dev/docs/data-sources/native-heap-profiler for more.
Fields§
§strings: Vec<InternedString>
The following interning tables are only used in Android version Q. In newer versions, these tables are in InternedData (see protos/perfetto/trace/interned_data) and are shared across multiple ProfilePackets. For backwards compatibility, consumers need to first look up interned data in the tables within the ProfilePacket, and then, if they are empty, look up in the InternedData instead.
mappings: Vec<Mapping>
§frames: Vec<Frame>
§callstacks: Vec<Callstack>
§process_dumps: Vec<ProcessHeapSamples>
§continued: Option<bool>
If this is true, the next ProfilePacket in this package_sequence_id is a continuation of this one. To get all samples for a process, accummulate its ProcessHeapSamples.samples until you see continued=false.
index: Option<u64>
Index of this ProfilePacket on its package_sequence_id. Can be used to detect dropped data. Verify these are consecutive.
Implementations§
Trait Implementations§
Source§impl Clone for ProfilePacket
impl Clone for ProfilePacket
Source§fn clone(&self) -> ProfilePacket
fn clone(&self) -> ProfilePacket
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ProfilePacket
impl Debug for ProfilePacket
Source§impl Default for ProfilePacket
impl Default for ProfilePacket
Source§impl Message for ProfilePacket
impl Message for ProfilePacket
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
Source§fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
Source§fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
Source§fn decode<B>(buf: B) -> Result<Self, DecodeError>
fn decode<B>(buf: B) -> Result<Self, DecodeError>
Source§fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
Source§fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
self
. Read moreSource§fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
self
.