协议
采样器
在 fuchsia.memory.sampler/sampler.fidl 中定义
用于渗漏进程分配信息的接口。
RecordAllocation
请求
| 名称 | 类型 |
|---|---|
payload |
RecordAllocationEvent
|
RecordDeallocation
请求
| 名称 | 类型 |
|---|---|
payload |
RecordDeallocationEvent
|
SetProcessInfo
传达相关的进程信息,以便进行符号化。
请求
| 名称 | 类型 |
|---|---|
payload |
SamplerSetProcessInfoRequest
|
SetSharedSocket
提供用于发送分配记录的套接字。
请求
| 名称 | 类型 |
|---|---|
socket |
handle<socket>
|
TABLES
ExecutableSegment
在 fuchsia.memory.sampler/sampler.fidl 中定义
与 ELF 模块中的可执行段对应的地址区域。
| 序数 | 字段 | 类型 | 说明 |
|---|---|---|---|
1 |
start_address |
uint64
|
在内存中映射的区域的起始位置。 |
2 |
size |
uint64
|
属于该区域的地址范围的大小。 |
3 |
relative_address |
uint64
|
加载前 ELF 二进制文件中区域的偏移量。 |
ModuleMap
在 fuchsia.memory.sampler/sampler.fidl 中定义
模块符号化所需的信息。 表示与性能分析器相关的 ELF 模块子集。此映射的主要应用场景是堆栈轨迹的符号化。
| 序数 | 字段 | 类型 | 说明 |
|---|---|---|---|
1 |
build_id |
vector<uint8>:20
|
Build ID,一个唯一标识模块 build 的字符串。 |
2 |
executable_segments |
vector<ExecutableSegment>
|
可执行片段的集合。 |
RecordAllocationEvent
在 fuchsia.memory.sampler/sampler.fidl 中定义
| 序数 | 字段 | 类型 | 说明 |
|---|---|---|---|
1 |
address |
uint64
|
分配的地址,用于唯一标识分配。 |
2 |
stack_trace |
StackTrace
|
在分配点收集的堆栈帧。 |
3 |
size |
uint64
|
此分配的大小(以字节为单位)。 |
4 |
sampling_interval_bytes |
uint64
|
对此分配进行采样时生效的采样间隔。 |
RecordDeallocationEvent
在 fuchsia.memory.sampler/sampler.fidl 中定义
| 序数 | 字段 | 类型 | 说明 |
|---|---|---|---|
1 |
address |
uint64
|
解除分配的地址,用于唯一标识解除分配。 |
2 |
stack_trace |
StackTrace
|
在释放点收集的堆栈帧。 |
SamplerSetProcessInfoRequest
在 fuchsia.memory.sampler/sampler.fidl 中定义
| 序数 | 字段 | 类型 | 说明 |
|---|---|---|---|
1 |
process_name |
string:32
|
|
2 |
module_map |
vector<ModuleMap>
|
StackTrace
在 fuchsia.memory.sampler/sampler.fidl 中定义
堆栈轨迹,作为堆栈帧的集合。
| 序数 | 字段 | 类型 | 说明 |
|---|---|---|---|
1 |
stack_frames |
vector<uint64>
|
帧指针的有序向量,从较窄的位置到较宽的位置。 |
UNIONS
SamplerDatagram flexible
在 fuchsia.memory.sampler/sampler.fidl 中定义
| 序数 | 变体 | 类型 | 说明 |
|---|---|---|---|
1 |
record_allocation |
RecordAllocationEvent
|
|
2 |
record_deallocation |
RecordDeallocationEvent
|
常量
| 名称 | 值 | 类型 | 说明 |
|---|---|---|---|
| BUILD_ID_BYTES |
20
|
uint32 |
build ID 是一个长度为 20 字节的序列。 |