PROTOCOLS
Collector
Defined in fuchsia.memory.heapdump.client/client.fidl
Protocol to request and retrieve memory profiles.
DownloadStoredSnapshot
Retrieves a stored snapshot.
Request
| Name | Type |
|---|---|
payload |
CollectorDownloadStoredSnapshotRequest
|
ListStoredSnapshots
Retrieves the list of all the available stored snapshots.
Request
| Name | Type |
|---|---|
payload |
CollectorListStoredSnapshotsRequest
|
TakeLiveSnapshot
Obtains a snapshot of the current live allocations in an instrumented process.
Request
| Name | Type |
|---|---|
payload |
CollectorTakeLiveSnapshotRequest
|
SnapshotReceiver
Defined in fuchsia.memory.heapdump.client/client.fidl
Protocol to transmit snapshot(s) as a stream of elements.
Batch
Delivers a batch of snapshot elements.
It will be called for each batch of elements, and finally with an empty batch to indicate that all data has been sent.
If multi_process was set to true, two extra batches will be sent to
enclose each snapshot:
- A batch with exactly one SnapshotHeader at the beginning.
- An empty batch at the end.
Request
| Name | Type |
|---|---|
batch |
vector<SnapshotElement>
|
Response
<EMPTY>
ReportError
Reports an error. No other batches or errors will follow.
Request
| Name | Type |
|---|---|
error |
CollectorError
|
Response
<EMPTY>
StoredSnapshotIterator
Defined in fuchsia.memory.heapdump.client/client.fidl
Protocol to retrieve a list of StoredSnapshots.
GetNext
Retrieves the next batch of StoredSnapshots elements.
An empty response signals the end of the list.
Request
<EMPTY>
Response
| Name | Type |
|---|---|
payload |
StoredSnapshotIterator_GetNext_Result
|
STRUCTS
BuildId
Defined in fuchsia.memory.heapdump.client/client.fidl
An ELF build ID.
| Field | Type | Description | Default |
|---|---|---|---|
value |
vector<uint8>:32
|
No default |
StoredSnapshotIterator_GetNext_Response
Defined in fuchsia.memory.heapdump.client/client.fidl
| Field | Type | Description | Default |
|---|---|---|---|
batch |
vector<StoredSnapshot>
|
No default |
ENUMS
CollectorError flexible
Type: uint32
Defined in fuchsia.memory.heapdump.client/client.fidl
The reason why a method failed.
| Name | Value | Description |
|---|---|---|
PROCESS_SELECTOR_UNSUPPORTED |
1 |
The given ProcessSelector value is not supported. |
PROCESS_SELECTOR_NO_MATCH |
2 |
The given ProcessSelector value does not match any process. |
PROCESS_SELECTOR_AMBIGUOUS |
3 |
The given ProcessSelector value matches more than one process but the requested operation needs a unique match. |
LIVE_SNAPSHOT_FAILED |
4 |
Failed to take a live snapshot. |
STORED_SNAPSHOT_NOT_FOUND |
5 |
The requested StoredSnapshot does not exist. |
TABLES
Allocation
Defined in fuchsia.memory.heapdump.client/client.fidl
One or more allocated memory blocks.
| Ordinal | Field | Type | Description |
|---|---|---|---|
1 |
address |
uint64
|
Address of the memory block. |
2 |
size |
uint64
|
Total memory blocks size, in bytes. |
3 |
stack_trace_key |
StackTraceKey
|
Stack trace of the allocation site. |
4 |
timestamp |
zx/InstantMono
|
Allocation timestamp. |
5 |
thread_info_key |
ThreadInfoKey
|
Allocating thread. |
6 |
count |
uint64
|
Number of allocated memory blocks that have been aggregated into this element. 1 by default. Added: 29
|
BlockContents
Defined in fuchsia.memory.heapdump.client/client.fidl
The contents of an allocated memory block.
In order to avoid exceeding the channel's maximum message size, bigger blocks can be split in chunks. Receivers should be prepared to handle multiple BlockContents with the same address and reassemble them by concatenating their payloads. Each block's reassembled size always matches the size field of the corresponding Allocation.
| Ordinal | Field | Type | Description |
|---|---|---|---|
1 |
address |
uint64
|
The address of the corresponding memory block. |
2 |
contents |
vector<uint8>
|
The payload. |
CollectorDownloadStoredSnapshotRequest resource
Defined in fuchsia.memory.heapdump.client/client.fidl
| Ordinal | Field | Type | Description |
|---|---|---|---|
1 |
snapshot_id |
uint32
|
The identifier of the snapshot to be downloaded. The list of the available snapshots can be retrieved with ListStoredSnapshots. Required. |
2 |
receiver |
client_end:SnapshotReceiver
|
Where the elements of the requested snapshot will be sent to. Required. |
CollectorListStoredSnapshotsRequest resource
Defined in fuchsia.memory.heapdump.client/client.fidl
| Ordinal | Field | Type | Description |
|---|---|---|---|
1 |
iterator |
server_end:StoredSnapshotIterator
|
The server_end of the StoredSnapshotIterator that will be used to retrieve the results. Required. |
2 |
process_selector |
ProcessSelector
|
If present, only retrieve snapshots that refer to matching processes. |
CollectorTakeLiveSnapshotRequest resource
Defined in fuchsia.memory.heapdump.client/client.fidl
| Ordinal | Field | Type | Description |
|---|---|---|---|
1 |
process_selector |
ProcessSelector
|
The instrumented process(es) to operate on. If not set, any process will be considered a match. |
2 |
receiver |
client_end:SnapshotReceiver
|
Where the elements of the requested snapshot will be sent to. Required. |
3 |
with_contents |
bool
|
Whether the snapshot should include the contents of each memory block. If not set, false is assumed. |
4 |
multi_process |
bool
|
Whether this call is allowed to take a snapshot of more than one process and, therefore, return more than one snapshot. If not set, false is assumed. If set to true, each snapshot will be preceded by a SnapshotHeader. Added: HEAD
|
ExecutableRegion
Defined in fuchsia.memory.heapdump.client/client.fidl
A memory region containing code loaded from an ELF file.
| Ordinal | Field | Type | Description |
|---|---|---|---|
1 |
address |
uint64
|
The address of the memory region. |
2 |
size |
uint64
|
Region size, in bytes. |
3 |
file_offset |
uint64
|
The file offset corresponding to the first byte within the region. |
4 |
build_id |
BuildId
|
The build ID of the ELF file. |
5 |
vaddr |
uint64
|
The address of the memory region relative to the file's load address. Added: 27
|
6 |
name |
string
|
Description of the memory region (e.g. ELF soname or VMO name). Added: 27
|
SnapshotHeader
Defined in fuchsia.memory.heapdump.client/client.fidl
Marks the beginning of a new snapshot.
Note: this element is only present in live snapshots taken with
multi_process set to true.
| Ordinal | Field | Type | Description |
|---|---|---|---|
1 |
process_name |
string:32
|
ZX_PROP_NAME of the process the snapshot is about. |
2 |
process_koid |
zx/Koid
|
Koid of the process. |
StackTrace
Defined in fuchsia.memory.heapdump.client/client.fidl
A stack trace.
In order to avoid exceeding the channel's maximum message size, stack traces can be split in multiple chunks. Receivers should be prepared to handle multiple StackTrace elements with the same key and reassemble them by concatenating their program addresses.
| Ordinal | Field | Type | Description |
|---|---|---|---|
1 |
stack_trace_key |
StackTraceKey
|
A number that uniquely identifies this stack trace within the parent snapshot. |
2 |
program_addresses |
vector<uint64>
|
The program counters corresponding to stack each frame. Entries are listed in reverse call order: the first entry refers to the leaf frame, and the last entry refers to the frame at the root of the call stack. |
StoredSnapshot
Defined in fuchsia.memory.heapdump.client/client.fidl
A snapshot that is stored on the device and that can be downloaded.
Application-initiated snapshots belong to this category.
| Ordinal | Field | Type | Description |
|---|---|---|---|
1 |
snapshot_id |
uint32
|
A number that uniquely identifies this snapshot within a Collector. |
2 |
snapshot_name |
string:32
|
The name given to this snapshot. |
3 |
process_koid |
zx/Koid
|
The koid of the process that this snapshot refers to. |
4 |
process_name |
string:32
|
The name of the process that this snapshot refers to. |
ThreadInfo
Defined in fuchsia.memory.heapdump.client/client.fidl
Information on a given thread.
Note: Under some circumstances, more than one entry could exist for a given koid (e.g. if the thread changed its name between different allocations).
| Ordinal | Field | Type | Description |
|---|---|---|---|
1 |
thread_info_key |
ThreadInfoKey
|
A number that uniquely identifies this entry within the parent snapshot. |
2 |
koid |
zx/Koid
|
The koid of the thread that this entry refers to. |
3 |
name |
string:32
|
The name of the thread that this entry refers to. |
UNIONS
ProcessSelector flexible
Defined in fuchsia.memory.heapdump.client/client.fidl
Filter to restrict an operation to a subset of the available processes.
| Ordinal | Variant | Type | Description |
|---|---|---|---|
1 |
by_name |
string:32
|
Matches any process with the given ZX_PROP_NAME. |
2 |
by_koid |
zx/Koid
|
Matches the process with the given koid. ZX_KOID_KERNEL(1) stands for the kernel. |
SnapshotElement flexible
Defined in fuchsia.memory.heapdump.client/client.fidl
An element that is part of a snapshot.
| Ordinal | Variant | Type | Description |
|---|---|---|---|
1 |
allocation |
Allocation
|
|
2 |
stack_trace |
StackTrace
|
|
3 |
executable_region |
ExecutableRegion
|
|
4 |
block_contents |
BlockContents
|
|
5 |
thread_info |
ThreadInfo
|
|
6 |
snapshot_header |
SnapshotHeader
|
Added: HEAD
|
StoredSnapshotIterator_GetNext_Result strict
Defined in fuchsia.memory.heapdump.client/client.fidl
| Ordinal | Variant | Type | Description |
|---|---|---|---|
1 |
response |
StoredSnapshotIterator_GetNext_Response
|
|
2 |
err |
CollectorError
|
CONSTANTS
| Name | Value | Type | Description |
|---|---|---|---|
| MAX_BUILD_ID_LENGTH |
32
|
uint32 |
ALIASES
| Name | Value | Description |
|---|---|---|
| StackTraceKey |
uint64 |
|
| ThreadInfoKey |
uint64 |