Google is committed to advancing racial equity for Black communities. See how.

fuchsia.hardware.ram.metrics

PROTOCOLS

Device

Defined in fuchsia.hardware.ram.metrics/metrics.fidl

Interface to obtain memory bandwidth usage measurements from hardware cycle counters. The interface supports up to 6 hardware counters (called channels) which aggregate up to 64 unique buses (called ports).

An example of a possible configuration: channel[0] <- A53x4 + M3x1 channel[1] <- gpu channel[2] <- vpu + h264_decoder + hdmi channel[3] <- image_isp + h264_encoder

The number of channels and which bit patterns to use for each port are hardware specific.

MeasureBandwidth

Trigger one measurement. This can be called again before the reply arrives but it won't be serviced until previous requests are completed.

The return on success is the measurement.

The return on failure are as follows: ZX_ERR_INVALID_ARGS : The BandwidthMeasurementConfig values are incorrect. ZX_ERR_NOT_SUPPORTED : The BandwidthMeasurementConfig values are not supported by the hardware. ZX_ERR_SHOULD_WAIT : Too many requests pending. A future request might succeed. Other errors indicate internal failure.

Request

NameType
config BandwidthMeasurementConfig

Response

NameType
result Device_MeasureBandwidth_Result

STRUCTS

BandwidthInfo

Defined in fuchsia.hardware.ram.metrics/metrics.fidl

NameTypeDescriptionDefault
timestamp zx/time No default
frequency uint64 No default
bytes_per_cycle uint64 No default
channels [8] No default
total GrantedCyclesResult No default

BandwidthMeasurementConfig

Defined in fuchsia.hardware.ram.metrics/metrics.fidl

Configures bus hardware to make one measurement.

NameTypeDescriptionDefault
cycles_to_measure uint64

How many bus cycles to perform the measurement over.

No default
channels uint64[8]

Contains which ports to aggregate for each channel.

No default

Device_MeasureBandwidth_Response

Defined in fuchsia.hardware.ram.metrics/metrics.fidl

NameTypeDescriptionDefault
info BandwidthInfo No default

GrantedCyclesResult

Defined in fuchsia.hardware.ram.metrics/metrics.fidl

Contains the actual cycles granted to each channel. Not all hardware supports all 3 counters. If a counter is not supported the value returned is zero.

NameTypeDescriptionDefault
read_cycles uint64 No default
write_cycles uint64 No default
readwrite_cycles uint64 No default

UNIONS

Device_MeasureBandwidth_Result

Defined in fuchsia.hardware.ram.metrics/metrics.fidl

NameTypeDescription
response Device_MeasureBandwidth_Response
err zx/status

CONSTANTS

NameValueTypeDescription
MAX_COUNT_CHANNELS 8 uint32