class ClockDriver
Defined at line 75 of file ../../src/devices/clock/drivers/clock/clock.h
Public Members
static const char[] kDriverName
Public Methods
void ClockDriver (fdf::DriverStartArgs start_args, fdf::UnownedSynchronizedDispatcher dispatcher)
Defined at line 81 of file ../../src/devices/clock/drivers/clock/clock.h
zx::result<> Start ()
Defined at line 384 of file ../../src/devices/clock/drivers/clock/clock.cc
void CheckIfReady ()
Defined at line 438 of file ../../src/devices/clock/drivers/clock/clock.cc
fpromise::promise<inspect::Inspector> PowerObservabilityInspectCallback ()
Generates Inspect data for power observability. This intends to match the exact format generated
by the library at `//sdk/lib/power/state_recorder` which will allow us to use the same tooling.
The reason for not using that library currently is that it stores all live data directly in the
inspect library instead of populating it lazily. That causes it to use too much memory and limits
the history we get out of it. This instead uses a space efficient storage that it can convert
into the inspect format when needed.
The data is structured as follows:
{
"power_observability_state_recorders": {
"clock_rates:<name_or_id>:0x<id>": {
"metadata": {
"name": "clock_rate",
"type": "numeric",
"units": "hz",
"range": {
"min_inc":
<minimum
rate across all clocks>,
"max_inc":
<maximum
rate across all clocks>
}
},
"history": {
"0": { "@time":
<timestamp
>, "value":
<rate
in Hz> },
"1": { "@time":
<timestamp
>, "value":
<rate
in Hz> },
...
}
},
"clock_states:<name_or_id>:0x<id>": {
"metadata": {
"name": "clock_state",
"type": "enum",
"states": {
"disabled": 0,
"enabled": 1
}
},
"history": {
"0": { "@time":
<timestamp
>, "value":
<
0 or 1> },
"1": { "@time":
<timestamp
>, "value":
<
0 or 1> },
...
}
},
...
}
}
Defined at line 499 of file ../../src/devices/clock/drivers/clock/clock.cc
uint8_t GetDataForRate (uint64_t rate)
Defined at line 592 of file ../../src/devices/clock/drivers/clock/clock.cc
uint64_t GetRateForData (uint8_t data)
Defined at line 608 of file ../../src/devices/clock/drivers/clock/clock.cc