PROTOCOLS
Controller
Defined in fuchsia.perfmon.cpu/perfmon.fidl
GetProperties
Fetch the performance monitor properties of the system.
Request
Name | Type |
---|
Response
Name | Type |
---|---|
properties |
Properties
|
Initialize
Create a trace, allocating the needed trace buffers and other resources.
"other resources" is basically a catch-all for other things that will
be needed. This does not include reserving the events, that is done
later by StageConfig()
.
Request
Name | Type |
---|---|
allocation |
Allocation
|
Response
Name | Type |
---|---|
result |
Controller_Initialize_Result
|
Terminate
Free all trace buffers and any other resources allocated for the trace. This is also done when the connection is closed. Tracing is first stopped if not already stopped. May be called multiple times.
Request
Name | Type |
---|
Response
Name | Type |
---|
GetAllocation
Return the trace allocation configuration, if there is one.
Request
Name | Type |
---|
Response
Name | Type |
---|---|
allocation |
Allocation?
|
StageConfig
Stage performance monitor specification for a cpu.
Must be called with data collection off and after Initialize()
.
Note: This doesn't actually configure the h/w, this just stages
the values for subsequent use by Start()
.
Request
Name | Type |
---|---|
config |
Config
|
Response
Name | Type |
---|---|
result |
Controller_StageConfig_Result
|
GetConfig
Fetch performance monitor specification for a cpu, if it exists.
Must be called with data collection off and after StageConfig()
.
Request
Name | Type |
---|
Response
Name | Type |
---|---|
config |
Config?
|
GetBufferHandle
Return a handle of a trace buffer, if it exists, and if descriptor
is valid.
descriptor
is (0, 1, 2, ..., num_buffers
-1)
Request
Name | Type |
---|---|
descriptor |
uint32
|
Response
Name | Type |
---|---|
vmo |
handle<vmo>?
|
Start
Turn on data collection.
Must be called after Initialize()
+ StageConfig()
and with data
collection off.
Request
Name | Type |
---|
Response
Name | Type |
---|---|
result |
Controller_Start_Result
|
Stop
Turn off data collection.
May be called any time after Initialize()
has been called and before
Terminate()
. If called at other times the call is ignored.
May be called multiple times.
Request
Name | Type |
---|
Response
Name | Type |
---|
STRUCTS
Controller_Initialize_Response
generated
Name | Type | Description | Default |
---|
Controller_StageConfig_Response
generated
Name | Type | Description | Default |
---|
Controller_Start_Response
generated
Name | Type | Description | Default |
---|
Properties
Defined in fuchsia.perfmon.cpu/perfmon.fidl
The properties of this system.
Name | Type | Description | Default |
---|---|---|---|
api_version |
uint16
|
S/W API version = |
No default |
pm_version |
uint16
|
The H/W Performance Monitor version. This is the version defined by the architecture. |
No default |
max_num_events |
uint16
|
The maximum number of events that can be simultaneously supported. The combination of events that can be simultaneously supported is architecture/model specific. |
No default |
max_num_fixed_events |
uint16
|
The maximum number of fixed events that can be simultaneously supported, and their maximum width. These values are for informational/display purposes. |
No default |
max_fixed_counter_width |
uint16
|
No default | |
max_num_programmable_events |
uint16
|
The maximum number of programmable events that can be simultaneously supported, and their maximum width. These values are for informational/display purposes. |
No default |
max_programmable_counter_width |
uint16
|
No default | |
max_num_misc_events |
uint16
|
The maximum number of misc events that can be simultaneously supported, and their maximum width. These values are for informational/display purposes. |
No default |
max_misc_counter_width |
uint16
|
No default | |
flags |
PropertyFlags
|
Various flags. |
No default |
EventConfig
Defined in fuchsia.perfmon.cpu/perfmon.fidl
Name | Type | Description | Default |
---|---|---|---|
event |
EventId
|
Event to collect data for. The values are architecture specific ids. Each event may appear at most once. |
No default |
rate |
EventRate
|
Sampling rate.
|
No default |
flags |
EventConfigFlags
|
Flags for the event. |
No default |
Config
Defined in fuchsia.perfmon.cpu/perfmon.fidl
Passed to StageConfig()
to select the data to be collected.
Name | Type | Description | Default |
---|---|---|---|
events |
[32]
|
Events to collect data for. |
No default |
Allocation
Defined in fuchsia.perfmon.cpu/perfmon.fidl
The allocation configuration for a data collection run. This is generally the first call to allocate resources for a trace, "trace" is used generically here: == "data collection run".
Name | Type | Description | Default |
---|---|---|---|
num_buffers |
uint32
|
The number of buffers to allocate for trace data. This must be #cpus for now. |
No default |
buffer_size_in_pages |
uint32
|
The size of each buffer in 4K pages. Each cpu gets same buffer size. |
No default |
UNIONS
Controller_Initialize_Result
generated
Name | Type | Description |
---|---|---|
response |
Controller_Initialize_Response
|
|
err |
zx/status
|
Controller_StageConfig_Result
generated
Name | Type | Description |
---|---|---|
response |
Controller_StageConfig_Response
|
|
err |
zx/status
|
Controller_Start_Result
generated
Name | Type | Description |
---|---|---|
response |
Controller_Start_Response
|
|
err |
zx/status
|
BITS
PropertyFlags
Type: uint64
Name | Value | Description |
---|---|---|
HAS_LAST_BRANCH | 1 | The architecture supports LBR records (Last Branch Records). |
EventConfigFlags
Type: uint32
Name | Value | Description |
---|---|---|
COLLECT_OS | 1 | Collect data when running in kernel mode. |
COLLECT_USER | 2 | Collect data when running in userspace mode. |
COLLECT_PC | 4 | Collect aspace+pc values. |
IS_TIMEBASE | 8 | If set for an event then the event is used as the "timebase": data for events with a zero rate is collected when data for the timebase event is collected. It is an error to have this set and have the event's rate be zero. At most one event may be the timebase event. |
COLLECT_LAST_BRANCH | 16 | Collect the available set of last branches. Branch data is emitted as LastBranch records. This is only available when the underlying system supports it. |
CONSTANTS
Name | Value | Type | Description |
---|---|---|---|
API_VERSION |
0
|
uint16 |
|
MAX_NUM_EVENTS |
32
|
uint16 |
The maximum number of events we support simultaneously. Typically the h/w supports less than this, e.g., 7 or so. |
TYPE ALIASES
Name | Value | Description |
---|---|---|
EventRate |
uint32 |
|
EventId |
uint16 |