通訊協定
取樣機制
定義於 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
|
建構 ID,用於識別模組建構作業的字串。 |
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 彈性
定義於 fuchsia.memory.sampler/sampler.fidl
| 序數 | Variant | 類型 | 說明 |
|---|---|---|---|
1 |
record_allocation |
RecordAllocationEvent
|
|
2 |
record_deallocation |
RecordDeallocationEvent
|
常數
| 名稱 | 值 | 類型 | 說明 |
|---|---|---|---|
| BUILD_ID_BYTES |
20
|
uint32 |
建構 ID 是長度為 20 個位元組的序列。 |