fuchsia.kernel

Added: 7

PROTOCOLS

Counter

Defined in fuchsia.kernel/kernel-counter.fidl

Protocol for retrieving kcounter information.

GetInspectVmo

Retrives a VMO containining summarized kcounter data. The vmo returned in buffer is in "inspect-vmo" format, documented elsewhere.

Request

<EMPTY>

Response

NameType
status zx/Status
buffer fuchsia.mem/Buffer

UpdateInspectVmo

Request that the previously-returned VMO buffer's data be updated. The data may not be updated if it was already recently updated (updates are limited to an unspecified rate, but approximately every few seconds).

Request

<EMPTY>

Response

NameType
status zx/Status

CpuResource

Defined in fuchsia.kernel/cpu-resource.fidl

Protocol for providing a ZX_RSRC_KIND_SYSTEM with base ZX_RSRC_SYSTEM_CPU_BASE.

Get

Get a CPU resource handle.

Request

<EMPTY>

Response

NameType
resource handle<resource>

DebugBroker

Defined in fuchsia.kernel/kernel-debug.fidl

Acts on behalf of the caller to interact with privileged debug system calls.

SendDebugCommand

Pass debug command through to the kernel shell. Look at zx_debug_send_command syscall handling to find valid values.

Request

NameType
command string[1024]

Response

NameType
status zx/Status

SetTracingEnabled

Sets whether kernel tracing (ktrace) is enabled or disabled.

Request

NameType
enabled bool

Response

NameType
status zx/Status

DebugResource

Defined in fuchsia.kernel/debug-resource.fidl

Protocol for providing a ZX_RSRC_KIND_SYSTEM with base ZX_RSRC_SYSTEM_DEBUG_BASE.

Get

Get a debug resource handle.

Request

<EMPTY>

Response

NameType
resource handle<resource>

EnergyInfoResource

Defined in fuchsia.kernel/energy-info-resource.fidl

Protocol for providing a ZX_RSRC_KIND_SYSTEM with base ZX_RSRC_SYSTEM_ENERGY_INFO_BASE.

Added: HEAD

Get

Get an EnergyInfo resource handle.

Added: HEAD

Request

<EMPTY>

Response

NameType
resource handle<resource>

FramebufferResource

Defined in fuchsia.kernel/framebuffer-resource.fidl

Protocol for providing a ZX_RSRC_KIND_SYSTEM with base ZX_RSRC_SYSTEM_FRAMEBUFFER_BASE.

Added: HEAD

Get

Get a framebuffer resource handle.

Added: HEAD

Request

<EMPTY>

Response

NameType
resource handle<resource>

HypervisorResource

Defined in fuchsia.kernel/hypervisor-resource.fidl

Protocol for providing the hypervisor resource.

Get

Get a hypervisor resource handle.

Request

<EMPTY>

Response

NameType
resource handle<resource>

InfoResource

Defined in fuchsia.kernel/info-resource.fidl

Protocol for providing a ZX_RSRC_KIND_SYSTEM with base ZX_RSRC_SYSTEM_INFO_BASE.

Get

Get an info resource handle.

Request

<EMPTY>

Response

NameType
resource handle<resource>

IommuResource

Defined in fuchsia.kernel/iommu-resource.fidl

Protocol for providing a ZX_RSRC_KIND_SYSTEM with base ZX_RSRC_SYSTEM_IOMMU_BASE.

Added: HEAD

Get

Get an iommu resource handle.

Added: HEAD

Request

<EMPTY>

Response

NameType
resource handle<resource>

IoportResource

Defined in fuchsia.kernel/ioport-resource.fidl

Protocol for providing an IO Port resource with access to all valid ranges.

Get

Get an IO Port resource handle.

Request

<EMPTY>

Response

NameType
resource handle<resource>

IrqResource

Defined in fuchsia.kernel/irq-resource.fidl

Protocol for providing an IRQ resource with access to all valid ranges.

Get

Get an IRQ resource handle.

Request

<EMPTY>

Response

NameType
resource handle<resource>

MexecResource

Defined in fuchsia.kernel/mexec-resource.fidl

Protocol for providing a ZX_RSRC_KIND_SYSTEM with base ZX_RSRC_SYSTEM_MEXEC_BASE.

Added: HEAD

Get

Get an MEXEC resource handle as resource.

Added: HEAD

Request

<EMPTY>

Response

NameType
resource handle<resource>

MmioResource

Defined in fuchsia.kernel/mmio-resource.fidl

Protocol for providing an MMIO resource with access to all valid ranges.

Get

Get an MMIO resource handle.

Request

<EMPTY>

Response

NameType
resource handle<resource>

MsiResource

Defined in fuchsia.kernel/msi-resource.fidl

Protocol for providing a ZX_RSRC_KIND_SYSTEM with base ZX_RSRC_SYSTEM_MSI_BASE.

Added: HEAD

Get

Get an msi resource handle.

Added: HEAD

Request

<EMPTY>

Response

NameType
resource handle<resource>

PowerResource

Defined in fuchsia.kernel/power-resource.fidl

Protocol for providing a ZX_RSRC_KIND_SYSTEM with base ZX_RSRC_SYSTEM_POWER_BASE.

Get

Get a power resource handle.

Request

<EMPTY>

Response

NameType
resource handle<resource>

ProfileResource

Defined in fuchsia.kernel/profile-resource.fidl

Protocol for providing a ZX_RSRC_KIND_SYSTEM with base ZX_RSRC_SYSTEM_PROFILE_BASE.

Added: HEAD

Get

Get a profile resource handle.

Added: HEAD

Request

<EMPTY>

Response

NameType
resource handle<resource>

RootJob

Defined in fuchsia.kernel/root-job.fidl

Protocol for providing the root job.

TODO(https://fxbug.dev/42109098): Do not use this without first consulting the Zircon team.

Get

Get the root job.

Request

<EMPTY>

Response

NameType
job handle<job>

RootJobForInspect

Defined in fuchsia.kernel/root-job.fidl

Protocol for providing the root job with restricted rights, specifically: INSPECT | ENUMERATE | DUPLICATE | TRANSFER

Get

Get the root job.

Request

<EMPTY>

Response

NameType
job handle<job>

SmcResource

Defined in fuchsia.kernel/smc-resource.fidl

Protocol for providing an SMC resource with access to all valid ranges.

Get

Get an SMC resource handle.

Request

<EMPTY>

Response

NameType
resource handle<resource>

Stats

Defined in fuchsia.kernel/kernel-stats.fidl

Protocol for providing kernel stats. This is roughly a wrapper around zx_object_get_info for the ZX_INFO_KMEM_STATS, ZX_INFO_KMEM_STATS_EXTENDED and ZX_INFO_CPU_STATS topics, which today require the very powerful 'Root Resource' capability to obtain. Instead of vending out that capability, programs that just want stats should use this service instead. If for some reason the protocol fails to retrieve stats, which will be an un-recoverable error, it will close the channel.

GetCpuLoad

Gets the average load as a percentage (0.0 - 100.0) from each CPU over the specified duration.

Load is calculated as (100 - %idle), where %idle is the percentage value of idle_time (from PerCpuStats) over a time duration.

Request

NameType
duration zx/Duration

Response

NameType
per_cpu_load vector<float32>[512]

GetCpuStats

Request

<EMPTY>

Response

NameType
stats CpuStats

GetMemoryStats

Request

<EMPTY>

Response

NameType
stats MemoryStats

GetMemoryStatsCompression

Added: 16

Request

<EMPTY>

Response

NameType
payload MemoryStatsCompression

GetMemoryStatsExtended

Request

<EMPTY>

Response

NameType
stats MemoryStatsExtended

VmexResource

Defined in fuchsia.kernel/vmex-resource.fidl

Protocol for providing a ZX_RSRC_KIND_SYSTEM with base ZX_RSRC_SYSTEM_VMEX_BASE to programs that should be able to mark VMOs as executable.

Get

Get a VMEX resource handle.

Request

<EMPTY>

Response

NameType
resource handle<resource>

STRUCTS

CpuStats

Defined in fuchsia.kernel/kernel-stats.fidl

FieldTypeDescriptionDefault
actual_num_cpus uint64

This is the total number of CPUs on the actual device. This may not be the same as the length of the vector per_cpu_stats as it is possible the underlying syscall will not return stats for all CPUs.

No default
per_cpu_stats vector<PerCpuStats>[512]? No default

TABLES

MemoryStats

Defined in fuchsia.kernel/kernel-stats.fidl

OrdinalFieldTypeDescription
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

Defined in fuchsia.kernel/kernel-stats.fidl

Added: 16

OrdinalFieldTypeDescription
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

Defined in fuchsia.kernel/kernel-stats.fidl

OrdinalFieldTypeDescription
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

Defined in fuchsia.kernel/kernel-stats.fidl

OrdinalFieldTypeDescription
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

CONSTANTS

NameValueTypeDescription
DEBUG_COMMAND_MAX 1024 uint32

Maximum number of bytes in a command string