<br />

Added: 29

## **PROTOCOLS**

## Sampler

*Defined in [fuchsia.memory.sampler/sampler.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.memory.sampler/sampler.fidl;l=66)*

Interface used to exfiltrate process allocation information.

<br />

### RecordAllocation

Added: HEAD

#### Request

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.memory.sampler#RecordAllocationEvent` |

### RecordDeallocation

Added: HEAD

#### Request

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.memory.sampler#RecordDeallocationEvent` |

### SetProcessInfo

Communicate relevant process information to facilitate symbolization.

#### Request

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.memory.sampler#SamplerSetProcessInfoRequest` |

### SetSharedSocket

Provide a socket for sending allocation records.
Added: HEAD

#### Request

| Name | Type |
|---|---|
| `socket` | `handle<socket>` |

## **TABLES**

### ExecutableSegment

*Defined in [fuchsia.memory.sampler/sampler.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.memory.sampler/sampler.fidl;l=23)*

Address region that corresponds to an executable segment in an ELF module.

<br />

| Ordinal | Field | Type | Description |
|---|---|---|---|
| ### 1 | `start_address` | `uint64` | Start of the region as mapped in memory. |
| ### 2 | `size` | `uint64` | Size of the range of addresses that are part of the region. |
| ### 3 | `relative_address` | `uint64` | Offset of the region in the ELF binary before loading. |

### ModuleMap

*Defined in [fuchsia.memory.sampler/sampler.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.memory.sampler/sampler.fidl;l=15)*

Information necessary for the symbolization of a module.
Represents the subset of an ELF module relevant for the purposes of
the profiler. The main use case for this map is the symbolization of stack traces.

<br />

| Ordinal | Field | Type | Description |
|---|---|---|---|
| ### 1 | `build_id` | `vector<uint8>:20` | Build ID, a string which uniquely identifies a module build. |
| ### 2 | `executable_segments` | `vector<https://fuchsia.dev/reference/fidl/fuchsia.memory.sampler#ExecutableSegment>` | Collection of executable segments. |

### RecordAllocationEvent

*Defined in [fuchsia.memory.sampler/sampler.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.memory.sampler/sampler.fidl;l=39)*
Added: HEAD

<br />

| Ordinal | Field | Type | Description |
|---|---|---|---|
| ### 1 | `address` | `uint64` | Address of the allocation, to uniquely identify it. |
| ### 2 | `stack_trace` | `https://fuchsia.dev/reference/fidl/fuchsia.memory.sampler#StackTrace` | Stack frames collected at the allocation point. |
| ### 3 | `size` | `uint64` | Size (in bytes) of this allocation. |
| ### 4 | `sampling_interval_bytes` | `uint64` | The sampling interval in effect when this allocation was sampled. |

### RecordDeallocationEvent

*Defined in [fuchsia.memory.sampler/sampler.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.memory.sampler/sampler.fidl;l=51)*
Added: HEAD

<br />

| Ordinal | Field | Type | Description |
|---|---|---|---|
| ### 1 | `address` | `uint64` | Address of the deallocation, to uniquely identify it. |
| ### 2 | `stack_trace` | `https://fuchsia.dev/reference/fidl/fuchsia.memory.sampler#StackTrace` | Stack frames collected at the deallocation point. |

### SamplerSetProcessInfoRequest

*Defined in [fuchsia.memory.sampler/sampler.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.memory.sampler/sampler.fidl;l=89)*

| Ordinal | Field | Type | Description |
|---|---|---|---|
| ### 1 | `process_name` | `string:32` |   |
| ### 2 | `module_map` | `vector<https://fuchsia.dev/reference/fidl/fuchsia.memory.sampler#ModuleMap>` |   |

### StackTrace

*Defined in [fuchsia.memory.sampler/sampler.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.memory.sampler/sampler.fidl;l=33)*

A stack trace, as a collection of stack frames.

<br />

| Ordinal | Field | Type | Description |
|---|---|---|---|
| ### 1 | `stack_frames` | `vector<uint64>` | Ordered vector of frame pointers, from the narrower to the wider location. |

## **UNIONS**

### SamplerDatagram [flexible](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.memory.sampler/sampler.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.memory.sampler/sampler.fidl;l=59)*
Added: HEAD

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `record_allocation` | `https://fuchsia.dev/reference/fidl/fuchsia.memory.sampler#RecordAllocationEvent` |   |
| ### 2 | `record_deallocation` | `https://fuchsia.dev/reference/fidl/fuchsia.memory.sampler#RecordDeallocationEvent` |   |

<br />

## **CONSTANTS**

| Name | Value | Type | Description |
|---|---|---|---|
| [BUILD_ID_BYTES](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.memory.sampler/sampler.fidl;l=10) | `20` | `uint32` | A build ID is a 20 bytes long sequence. |