fuchsia.kernel

新增日期:7

通訊協定

計數器

定義於 fuchsia.kernel/kernel-counter.fidl

擷取 kcounter 資訊的通訊協定。

GetInspectVmo

擷取含有匯總 Kcounter 資料的 VMO。buffer 中傳回的 vmo 會採用「inspect-vmo」格式,記載於其他地方。

要求

<EMPTY>

回應

名稱類型
status zx/Status
buffer fuchsia.mem/Buffer

UpdateInspectVmo

要求更新先前傳回的 VMO 緩衝區資料。如果資料最近已更新,系統可能不會更新這些資料 (更新頻率限制為未指定速率,但約每幾秒)。

要求

<EMPTY>

回應

名稱類型
status zx/Status

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

將偵錯指令傳遞至核心殼層。查看 zx_debug_send_command 系統呼叫處理功能,尋找有效的值。

要求

名稱類型
command string[1024]

回應

名稱類型
status zx/Status

SetTracingEnabled

設定啟用或停用核心追蹤 (ktrace)。

要求

名稱類型
enabled bool

回應

名稱類型
status zx/Status

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 的通訊協定。

已新增:HEAD

取得

取得偵錯記錄檔的資源控制代碼。

已新增:HEAD

要求

<EMPTY>

回應

名稱類型
resource handle<resource>

EnergyInfoResource

定義於 fuchsia.kernel/energy-info-resource.fidl

透過基準 ZX_RSRC_SYSTEM_ENERGY_INFO_BASE 提供 ZX_RSRC_KIND_SYSTEM 的通訊協定。

已新增:HEAD

取得

取得 EnergyInfo 資源控制代碼。

已新增:HEAD

要求

<EMPTY>

回應

名稱類型
resource handle<resource>

FramebufferResource

定義於 fuchsia.kernel/framebuffer-resource.fidl

透過基準 ZX_RSRC_SYSTEM_FRAMEBUFFER_BASE 提供 ZX_RSRC_KIND_SYSTEM 的通訊協定。

已新增:HEAD

取得

取得 framebuffer 資源控制代碼。

已新增:HEAD

要求

<EMPTY>

回應

名稱類型
resource handle<resource>

HypervisorResource

定義於 fuchsia.kernel/hypervisor-resource.fidl

提供管理程序資源的通訊協定。

取得

取得管理程序資源控制代碼。

要求

<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 的通訊協定。

已新增:HEAD

取得

取得 iommu 資源控點。

已新增:HEAD

要求

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

MexecResource

定義於 fuchsia.kernel/mexec-resource.fidl

透過基準 ZX_RSRC_SYSTEM_MEXEC_BASE 提供 ZX_RSRC_KIND_SYSTEM 的通訊協定。

已新增:HEAD

取得

resource 的形式取得 MEXEC 資源控制代碼。

已新增:HEAD

要求

<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 的通訊協定。

已新增:HEAD

取得

取得 MSI 資源控制代碼。

已新增:HEAD

要求

<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 的通訊協定。

已新增:HEAD

取得

取得設定檔資源控制代碼。

已新增:HEAD

要求

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

SmcResource

定義於 fuchsia.kernel/smc-resource.fidl

用於提供 SMC 資源存取所有有效範圍的通訊協定。

取得

取得 SMC 資源控制代碼。

要求

<EMPTY>

回應

名稱類型
resource handle<resource>

統計資料

定義於 fuchsia.kernel/kernel-stats.fidl

提供核心統計資料的通訊協定。這大約是針對 ZX_INFO_KMEM_STATS、ZX_INFO_KMEM_STATS_EXTENDED 和 ZX_INFO_CPU_STATS 主題的 zx_object_get_info 包裝函式,現在需要強大的「根資源」功能能力取得。因此,只想取得統計資料的程式應改用這項服務,而非終止該能力。如果通訊協定因故無法擷取統計資料 (會發生無法復原的錯誤),就會關閉管道。

GetCpuLoad

取得指定時間範圍內,每個 CPU 以百分比 (0.0 - 100.0) 表示的平均負載。

負載的計算方式為 (100 - %idle),其中 %idle 是一段時間內閒置時間 (從 PerCpuStats) 的百分比值。

要求

名稱類型
duration zx/Duration

回應

名稱類型
per_cpu_load vector<float32>[512]

GetCpuStats

要求

<EMPTY>

回應

名稱類型
stats CpuStats

GetMemoryStats

要求

<EMPTY>

回應

名稱類型
stats MemoryStats

GetMemoryStatsCompression

新增時間:16 天

要求

<EMPTY>

回應

名稱類型
payload MemoryStatsCompression

GetMemoryStatsExtended

要求

<EMPTY>

回應

名稱類型
stats MemoryStatsExtended

VmexResource

定義於 fuchsia.kernel/vmex-resource.fidl

針對應能將 VMO 標示為可執行程式的程式,提供含有基礎 ZX_RSRC_SYSTEM_VMEX_BASEZX_RSRC_KIND_SYSTEM 的通訊協定。

取得

取得 VMEX 資源控制代碼。

要求

<EMPTY>

回應

名稱類型
resource handle<resource>

結構化

CpuStats

定義於 fuchsia.kernel/kernel-stats.fidl

廣闊類型說明預設
actual_num_cpus uint64

這是實際裝置上的 CPU 總數。這可能與向量 per_cpu_stats 的長度不同,因為基礎系統呼叫不會傳回所有 CPU 的統計資料。

無預設
per_cpu_stats vector<PerCpuStats>[512]? 無預設

資料表

MemoryStats

定義於 fuchsia.kernel/kernel-stats.fidl

序數廣闊類型說明
total_bytes uint64
free_bytes uint64
wired_bytes uint64
total_heap_bytes uint64
free_heap_bytes uint64
vmo_bytes uint64
mmu_overhead_bytes uint64
ipc_bytes uint64
other_bytes uint64

MemoryStatsCompression

定義於 fuchsia.kernel/kernel-stats.fidl

新增時間:16 天

序數廣闊類型說明
uncompressed_storage_bytes uint64
compressed_storage_bytes uint64
compressed_fragmentation_bytes uint64
compression_time zx/Duration
decompression_time zx/Duration
total_page_compression_attempts uint64
failed_page_compression_attempts uint64
total_page_decompressions uint64
compressed_page_evictions uint64
eager_page_compressions uint64
memory_pressure_page_compressions uint64
critical_memory_page_compressions uint64
pages_decompressed_unit_ns uint64
pages_decompressed_within_log_time uint64[8]

MemoryStatsExtended

定義於 fuchsia.kernel/kernel-stats.fidl

序數廣闊類型說明
total_bytes uint64
free_bytes uint64
wired_bytes uint64
total_heap_bytes uint64
free_heap_bytes uint64
vmo_bytes uint64
vmo_pager_total_bytes uint64
vmo_pager_newest_bytes uint64
vmo_pager_oldest_bytes uint64
vmo_discardable_locked_bytes uint64
vmo_discardable_unlocked_bytes uint64
mmu_overhead_bytes uint64
ipc_bytes uint64
other_bytes uint64

PerCpuStats

定義於 fuchsia.kernel/kernel-stats.fidl

序數廣闊類型說明
cpu_number uint32
flags uint32
idle_time zx/Duration
reschedules uint64
context_switches uint64
irq_preempts uint64
yields uint64
ints uint64
timer_ints uint64
timers uint64
page_faults uint64
exceptions uint64
syscalls uint64
reschedule_ipis uint64
generic_ipis uint64

業者

名稱類型說明
DEBUG_COMMAND_MAX 1024 uint32

指令字串的位元組數上限