fuchsia.memory.heapdump.client

Added: 15

PROTOCOLS

Collector

Defined in fuchsia.memory.heapdump.client/client.fidl

Protocol to request and retrieve memory profiles.

DownloadStoredSnapshot

Retrieves a stored snapshot.

Request

NameType
payload CollectorDownloadStoredSnapshotRequest

ListStoredSnapshots

Retrieves the list of all the available stored snapshots.

Request

NameType
payload CollectorListStoredSnapshotsRequest

TakeLiveSnapshot

Obtains a snapshot of the current live allocations in an instrumented process.

Request

NameType
payload CollectorTakeLiveSnapshotRequest

SnapshotReceiver

Defined in fuchsia.memory.heapdump.client/client.fidl

Protocol to transmit a snapshot as a stream of elements.

Batch

Delivers a batch of snapshot elements.

It will be called repeatedly until no elements are left, and then one final time with an empty vector to signal the end of the stream.

Request

NameType
batch vector<SnapshotElement>

Response

<EMPTY>

ReportError

Reports an error. No other batches or errors will follow.

Request

NameType
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

NameType
payload StoredSnapshotIterator_GetNext_Result

STRUCTS

BuildId

Defined in fuchsia.memory.heapdump.client/client.fidl

An ELF build ID.

FieldTypeDescriptionDefault
value vector<uint8>[32] No default

StoredSnapshotIterator_GetNext_Response

Defined in fuchsia.memory.heapdump.client/client.fidl

FieldTypeDescriptionDefault
batch vector<StoredSnapshot> No default

ENUMS

CollectorError flexible

Type: uint32

Defined in fuchsia.memory.heapdump.client/client.fidl

The reason why a method failed.

NameValueDescription
1

The given ProcessSelector value is not supported.

2

The given ProcessSelector value does not match any process.

3

The given ProcessSelector value matches more than one process but the requested operation needs a unique match.

4

Failed to take a live snapshot.

5

The requested StoredSnapshot does not exist.

TABLES

Allocation

Defined in fuchsia.memory.heapdump.client/client.fidl

An allocated memory block.

OrdinalFieldTypeDescription
address uint64

The address of the memory block.

size uint64

Block size, in bytes.

stack_trace_key StackTraceKey

The stack trace of the allocation site.

timestamp zx/Time

Allocation timestamp.

thread_info_key ThreadInfoKey

The allocating thread.

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.

OrdinalFieldTypeDescription
address uint64

The address of the corresponding memory block.

contents vector<uint8>

The payload.

CollectorDownloadStoredSnapshotRequest resource

Defined in fuchsia.memory.heapdump.client/client.fidl

OrdinalFieldTypeDescription
snapshot_id uint32

The identifier of the snapshot to be downloaded.

The list of the available snapshots can be retrieved with ListStoredSnapshots.

Required.

receiver SnapshotReceiver

Where the elements of the requested snapshot will be sent to.

Required.

CollectorListStoredSnapshotsRequest resource

Defined in fuchsia.memory.heapdump.client/client.fidl

OrdinalFieldTypeDescription
iterator server_end<StoredSnapshotIterator>

The server_end of the StoredSnapshotIterator that will be used to retrieve the results.

Required.

process_selector ProcessSelector

If present, only retrieve snapshots that refer to matching processes.

CollectorTakeLiveSnapshotRequest resource

Defined in fuchsia.memory.heapdump.client/client.fidl

OrdinalFieldTypeDescription
process_selector ProcessSelector

The instrumented process to operate on.

Required.

receiver SnapshotReceiver

Where the elements of the requested snapshot will be sent to.

Required.

with_contents bool

Whether the snapshot should include the contents of each memory block.

If not set, false is assumed.

ExecutableRegion

Defined in fuchsia.memory.heapdump.client/client.fidl

A memory region containing code loaded from an ELF file.

OrdinalFieldTypeDescription
address uint64

The address of the memory region.

size uint64

Region size, in bytes.

file_offset uint64

The file offset corresponding to the first byte within the region.

build_id BuildId

The build ID of the ELF file.

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.

OrdinalFieldTypeDescription
stack_trace_key StackTraceKey

A number that uniquely identifies this stack trace within the parent snapshot.

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.

OrdinalFieldTypeDescription
snapshot_id uint32

A number that uniquely identifies this snapshot within a Collector.

snapshot_name string[32]

The name given to this snapshot.

process_koid zx/Koid

The koid of the process that this snapshot refers to.

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).

OrdinalFieldTypeDescription
thread_info_key ThreadInfoKey

A number that uniquely identifies this entry within the parent snapshot.

koid zx/Koid

The koid of the thread that this entry refers to.

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.

OrdinalVariantTypeDescription
by_name string[32]

Matches any process with the given ZX_PROP_NAME.

by_koid zx/Koid

Matches the process with the given koid.

SnapshotElement flexible

Defined in fuchsia.memory.heapdump.client/client.fidl

An element that is part of a snapshot.

OrdinalVariantTypeDescription
allocation Allocation
stack_trace StackTrace
executable_region ExecutableRegion
block_contents BlockContents
thread_info ThreadInfo

StoredSnapshotIterator_GetNext_Result strict

Defined in fuchsia.memory.heapdump.client/client.fidl

OrdinalVariantTypeDescription
response StoredSnapshotIterator_GetNext_Response
err CollectorError

CONSTANTS

NameValueTypeDescription
MAX_BUILD_ID_LENGTH 32 uint32

ALIASES

NameValueDescription
StackTraceKey uint64
ThreadInfoKey uint64