协议
计数器
在 fuchsia.kernel/kernel-counter.fidl 中定义
用于检索 kcounter 信息的协议。
GetInspectVmo
检索包含汇总 kcounter 数据的 VMO。buffer 中返回的 vmo 采用“inspect-vmo”格式,其他地方有相关文档。
请求
<EMPTY>
响应
| 名称 | 类型 |
|---|---|
status |
zx/Result
|
buffer |
fuchsia.mem/Buffer
|
UpdateInspectVmo
请求更新之前返回的 VMO 缓冲区的数据。如果数据最近已经更新,则可能不会更新(更新频率不固定,但大约每隔几秒更新一次)。
请求
<EMPTY>
响应
| 名称 | 类型 |
|---|---|
status |
zx/Result
|
CpuResource
在 fuchsia.kernel/cpu-resource.fidl 中定义
用于提供具有基本 ZX_RSRC_SYSTEM_CPU_BASE 的 ZX_RSRC_KIND_SYSTEM 的协议。
获取
获取 CPU 资源句柄。
请求
<EMPTY>
响应
| 名称 | 类型 |
|---|---|
resource |
handle<resource>
|
DebugBroker
在 fuchsia.kernel/kernel-debug.fidl 中定义
代表调用方与特权调试系统调用进行交互。
SendDebugCommand
将调试命令传递给内核 shell。 查看 zx_debug_send_command 系统调用处理,以查找有效值。
请求
| 名称 | 类型 |
|---|---|
command |
string:1024
|
响应
| 名称 | 类型 |
|---|---|
status |
zx/Result
|
SetTracingEnabled
设置是启用还是停用内核跟踪 (ktrace)。
请求
| 名称 | 类型 |
|---|---|
enabled |
bool
|
响应
| 名称 | 类型 |
|---|---|
status |
zx/Result
|
DebugResource
在 fuchsia.kernel/debug-resource.fidl 中定义
用于提供具有基本 ZX_RSRC_SYSTEM_DEBUG_BASE 的 ZX_RSRC_KIND_SYSTEM 的协议。
获取
获取调试资源句柄。
请求
<EMPTY>
响应
| 名称 | 类型 |
|---|---|
resource |
handle<resource>
|
DebuglogResource
在 fuchsia.kernel/debuglog-resource.fidl 中定义
用于提供具有基本 ZX_RSRC_SYSTEM_DEBUGLOG_BASE 的 ZX_RSRC_KIND_SYSTEM 的协议。
获取
获取 debuglog 资源句柄。
请求
<EMPTY>
响应
| 名称 | 类型 |
|---|---|
resource |
handle<resource>
|
EnergyInfoResource
在 fuchsia.kernel/energy-info-resource.fidl 中定义
用于提供具有基本 ZX_RSRC_SYSTEM_ENERGY_INFO_BASE 的 ZX_RSRC_KIND_SYSTEM 的协议。
获取
获取 EnergyInfo 资源句柄。
请求
<EMPTY>
响应
| 名称 | 类型 |
|---|---|
resource |
handle<resource>
|
HypervisorResource
在 fuchsia.kernel/hypervisor-resource.fidl 中定义
用于提供 Hypervisor 资源的协议。
获取
获取 Hypervisor 资源句柄。
请求
<EMPTY>
响应
| 名称 | 类型 |
|---|---|
resource |
handle<resource>
|
InfoResource
在 fuchsia.kernel/info-resource.fidl 中定义
用于提供具有基本 ZX_RSRC_SYSTEM_INFO_BASE 的 ZX_RSRC_KIND_SYSTEM 的协议。
获取
获取信息资源句柄。
请求
<EMPTY>
响应
| 名称 | 类型 |
|---|---|
resource |
handle<resource>
|
IommuResource
在 fuchsia.kernel/iommu-resource.fidl 中定义
用于提供具有基本 ZX_RSRC_SYSTEM_IOMMU_BASE 的 ZX_RSRC_KIND_SYSTEM 的协议。
获取
获取 iommu 资源句柄。
请求
<EMPTY>
响应
| 名称 | 类型 |
|---|---|
resource |
handle<resource>
|
IoportResource
在 fuchsia.kernel/ioport-resource.fidl 中定义
用于为 IO 端口资源提供对所有有效范围的访问权限的协议。
获取
获取 IO 端口资源句柄。
请求
<EMPTY>
响应
| 名称 | 类型 |
|---|---|
resource |
handle<resource>
|
IrqResource
在 fuchsia.kernel/irq-resource.fidl 中定义
用于提供可访问所有有效范围的 IRQ 资源的协议。
获取
获取 IRQ 资源句柄。
请求
<EMPTY>
响应
| 名称 | 类型 |
|---|---|
resource |
handle<resource>
|
MmioResource
在 fuchsia.kernel/mmio-resource.fidl 中定义
用于提供可访问所有有效范围的 MMIO 资源的协议。
获取
获取 MMIO 资源句柄。
请求
<EMPTY>
响应
| 名称 | 类型 |
|---|---|
resource |
handle<resource>
|
MsiResource
在 fuchsia.kernel/msi-resource.fidl 中定义
用于提供具有基本 ZX_RSRC_SYSTEM_MSI_BASE 的 ZX_RSRC_KIND_SYSTEM 的协议。
获取
获取 MSI 资源句柄。
请求
<EMPTY>
响应
| 名称 | 类型 |
|---|---|
resource |
handle<resource>
|
PowerResource
在 fuchsia.kernel/power-resource.fidl 中定义
用于提供具有基本 ZX_RSRC_SYSTEM_POWER_BASE 的 ZX_RSRC_KIND_SYSTEM 的协议。
获取
获取电源资源句柄。
请求
<EMPTY>
响应
| 名称 | 类型 |
|---|---|
resource |
handle<resource>
|
ProfileResource
在 fuchsia.kernel/profile-resource.fidl 中定义
用于提供具有基本 ZX_RSRC_SYSTEM_PROFILE_BASE 的 ZX_RSRC_KIND_SYSTEM 的协议。
获取
获取配置文件资源句柄。
请求
<EMPTY>
响应
| 名称 | 类型 |
|---|---|
resource |
handle<resource>
|
RootJob
在 fuchsia.kernel/root-job.fidl 中定义
用于提供根作业的协议。
TODO(https://fxbug.dev/42109098):请勿在未先咨询 Zircon 团队的情况下使用此功能。
获取
获取根 job。
请求
<EMPTY>
响应
| 名称 | 类型 |
|---|---|
job |
handle<job>
|
RootJobForInspect
在 fuchsia.kernel/root-job.fidl 中定义
用于为根作业提供受限权限的协议,具体包括: INSPECT | ENUMERATE | DUPLICATE | TRANSFER
获取
获取根 job。
请求
<EMPTY>
响应
| 名称 | 类型 |
|---|---|
job |
handle<job>
|
SamplingResource
在 fuchsia.kernel/sampling-resource.fidl 中定义
用于提供具有基本 ZX_RSRC_SYSTEM_SAMPLING_BASE 的 ZX_RSRC_KIND_SYSTEM 的协议。
获取
获取采样资源句柄。
请求
<EMPTY>
响应
| 名称 | 类型 |
|---|---|
resource |
handle<resource>
|
SmcResource
在 fuchsia.kernel/smc-resource.fidl 中定义
用于为 SMC 资源提供对所有有效范围的访问权限的协议。
获取
获取 SMC 资源句柄。
请求
<EMPTY>
响应
| 名称 | 类型 |
|---|---|
resource |
handle<resource>
|
StallResource
在 fuchsia.kernel/stall-resource.fidl 中定义
用于向应能够测量和接收卡顿通知的程序提供具有基本 ZX_RSRC_SYSTEM_STALL_BASE 的 ZX_RSRC_KIND_SYSTEM 的协议。
获取
获取停滞资源句柄。
请求
<EMPTY>
响应
| 名称 | 类型 |
|---|---|
resource |
handle<resource>
|
统计信息
在 fuchsia.kernel/kernel-stats.fidl 中定义
用于提供内核统计信息的协议。这大致是 ZX_INFO_KMEM_STATS 和 ZX_INFO_CPU_STATS 主题的 zx_object_get_info 的封装容器,目前需要非常强大的“根资源”功能才能获取。只想获取统计信息的程序不应提供该功能,而应改用此服务。如果协议因某种原因无法检索统计信息(这将是不可恢复的错误),则会关闭通道。
GetCpuLoad
获取指定时长内每个 CPU 的平均负载百分比 (0.0 - 100.0)。
负载的计算公式为 (100 - %idle),其中 %idle 是 idle_time(来自 PerCpuStats)在一段时间内的百分比值。
请求
| 名称 | 类型 |
|---|---|
duration |
zx/Duration
|
响应
| 名称 | 类型 |
|---|---|
per_cpu_load |
vector<float32>:512
|
GetCpuStats
请求
<EMPTY>
响应
| 名称 | 类型 |
|---|---|
stats |
CpuStats
|
GetMemoryStats
请求
<EMPTY>
响应
| 名称 | 类型 |
|---|---|
stats |
MemoryStats
|
GetMemoryStatsCompression
请求
<EMPTY>
响应
| 名称 | 类型 |
|---|---|
payload |
MemoryStatsCompression
|
GetMemoryStatsExtended
已弃用
请求
<EMPTY>
响应
| 名称 | 类型 |
|---|---|
stats |
MemoryStatsExtended
|
TracingResource
在 fuchsia.kernel/tracing-resource.fidl 中定义
用于提供具有基本 ZX_RSRC_SYSTEM_TRACING_BASE 的 ZX_RSRC_KIND_SYSTEM 的协议。
获取
获取跟踪资源句柄。
请求
<EMPTY>
响应
| 名称 | 类型 |
|---|---|
resource |
handle<resource>
|
VmexResource
在 fuchsia.kernel/vmex-resource.fidl 中定义
用于向应能够将 VMO 标记为可执行文件的程序提供具有基本 ZX_RSRC_SYSTEM_VMEX_BASE 的 ZX_RSRC_KIND_SYSTEM 的协议。
获取
获取 VMEX 资源句柄。
请求
<EMPTY>
响应
| 名称 | 类型 |
|---|---|
resource |
handle<resource>
|
STRUCTS
CpuStats
在 fuchsia.kernel/kernel-stats.fidl 中定义
| 字段 | 类型 | 说明 | 默认 |
|---|---|---|---|
actual_num_cpus |
uint64
|
这是实际设备上的 CPU 总数。这可能与矢量 |
无默认应用 |
per_cpu_stats |
vector<PerCpuStats>:512?
|
无默认应用 |
TABLES
MemoryStats
在 fuchsia.kernel/kernel-stats.fidl 中定义
| 序数 | 字段 | 类型 | 说明 |
|---|---|---|---|
1 |
total_bytes |
uint64
|
|
2 |
free_bytes |
uint64
|
|
3 |
wired_bytes |
uint64
|
|
4 |
total_heap_bytes |
uint64
|
|
5 |
free_heap_bytes |
uint64
|
|
6 |
vmo_bytes |
uint64
|
|
7 |
mmu_overhead_bytes |
uint64
|
|
8 |
ipc_bytes |
uint64
|
|
9 |
other_bytes |
uint64
|
|
10 |
free_loaned_bytes |
uint64
|
Added: HEAD
|
11 |
cache_bytes |
uint64
|
Added: HEAD
|
12 |
slab_bytes |
uint64
|
Added: HEAD
|
13 |
zram_bytes |
uint64
|
Added: HEAD
|
14 |
vmo_reclaim_total_bytes |
uint64
|
Added: HEAD
|
15 |
vmo_reclaim_newest_bytes |
uint64
|
Added: HEAD
|
16 |
vmo_reclaim_oldest_bytes |
uint64
|
Added: HEAD
|
17 |
vmo_reclaim_disabled_bytes |
uint64
|
Added: HEAD
|
18 |
vmo_discardable_locked_bytes |
uint64
|
Added: HEAD
|
19 |
vmo_discardable_unlocked_bytes |
uint64
|
Added: HEAD
|
MemoryStatsCompression
在 fuchsia.kernel/kernel-stats.fidl 中定义
| 序数 | 字段 | 类型 | 说明 |
|---|---|---|---|
1 |
uncompressed_storage_bytes |
uint64
|
|
2 |
compressed_storage_bytes |
uint64
|
|
3 |
compressed_fragmentation_bytes |
uint64
|
|
4 |
compression_time |
zx/Duration
|
|
5 |
decompression_time |
zx/Duration
|
|
6 |
total_page_compression_attempts |
uint64
|
|
7 |
failed_page_compression_attempts |
uint64
|
|
8 |
total_page_decompressions |
uint64
|
|
9 |
compressed_page_evictions |
uint64
|
|
10 |
eager_page_compressions |
uint64
|
|
11 |
memory_pressure_page_compressions |
uint64
|
|
12 |
critical_memory_page_compressions |
uint64
|
|
13 |
pages_decompressed_unit_ns |
uint64
|
|
14 |
pages_decompressed_within_log_time |
array<uint64, 8>
|
MemoryStatsExtended
在 fuchsia.kernel/kernel-stats.fidl 中定义
已弃用
| 序数 | 字段 | 类型 | 说明 |
|---|---|---|---|
1 |
total_bytes |
uint64
|
|
2 |
free_bytes |
uint64
|
|
3 |
wired_bytes |
uint64
|
|
4 |
total_heap_bytes |
uint64
|
|
5 |
free_heap_bytes |
uint64
|
|
6 |
vmo_bytes |
uint64
|
|
7 |
vmo_pager_total_bytes |
uint64
|
|
8 |
vmo_pager_newest_bytes |
uint64
|
|
9 |
vmo_pager_oldest_bytes |
uint64
|
|
10 |
vmo_discardable_locked_bytes |
uint64
|
|
11 |
vmo_discardable_unlocked_bytes |
uint64
|
|
12 |
mmu_overhead_bytes |
uint64
|
|
13 |
ipc_bytes |
uint64
|
|
14 |
other_bytes |
uint64
|
PerCpuStats
在 fuchsia.kernel/kernel-stats.fidl 中定义
| 序数 | 字段 | 类型 | 说明 |
|---|---|---|---|
1 |
cpu_number |
uint32
|
|
2 |
flags |
uint32
|
|
3 |
idle_time |
zx/Duration
|
|
4 |
reschedules |
uint64
|
|
5 |
context_switches |
uint64
|
|
6 |
irq_preempts |
uint64
|
|
7 |
yields |
uint64
|
|
8 |
ints |
uint64
|
|
9 |
timer_ints |
uint64
|
|
10 |
timers |
uint64
|
|
11 |
page_faults |
uint64
|
|
12 |
exceptions |
uint64
|
|
13 |
syscalls |
uint64
|
|
14 |
reschedule_ipis |
uint64
|
|
15 |
generic_ipis |
uint64
|
|
16 |
normalized_busy_time |
zx/Duration
|
Added: HEAD
|
17 |
active_energy_consumption_nj |
uint64
|
Added: HEAD
|
18 |
idle_energy_consumption_nj |
uint64
|
Added: HEAD
|
常量
| 名称 | 值 | 类型 | 说明 |
|---|---|---|---|
| DEBUG_COMMAND_MAX |
1024
|
uint32 |
命令字符串中的最大字节数 |