zet_metric_type_t {
...
ZET_METRIC_TYPE_EXP_EVENT_NO_VALUE
Metric type: have only timestamp and value has no meaning.
ZET_METRIC_TYPE_EXP_EVENT_START
Metric type: the first event of a start/stop event pair.
ZET_METRIC_TYPE_EXP_EVENT_END
Metric type: the second event of a start/stop event pair.
ZET_METRIC_TYPE_EXP_EVENT_INSTANT
Metric type: instance event (non-paired).
ZET_METRIC_TYPE_EXP_EVENT_ MONOTHONIC_WRAPS_VALUE
Metric type: value of the event is a monotonic increasing value that can wrap around.
}
Return the list of the decodable metrics that can be collected in the tracer for the which the metric decoder handle was provided. The decodable metrics handles returned by this API are only valid to decode metrics raw data with zetMetricTracerDecodeExp(). Decodable metric handles are not valid to compare with metrics handles included in metric groups.
Parameter
Description
hMetricDecoder
[in] handle of the metrics decoder object
pCount
[in,out] pointer to number of decodable metric in the hMetricDecoder handle. If count is zero, then the driver shall update the value with the total number of decodable metrics available in the decoder. if count is greater than zero but less than the total number of decodable metrics available in the decoder, then only that number will be returned. if count is greater than the number of decodable metrics available in the decoder, then the driver shall update the value with the actual number of decodable metrics available.
phMetrics
[in,out] [range(0, pCount)] array of handles of decodable metrics in the hMetricDecoder handle provided
Decode raw events collected from a tracer into list of ze_metric_entry_exp_t
Parameter
Description
hMetricDecoder
[in] handle of the metrics decoder object
prawDataSize
[in,out] size in bytes of raw data buffer. If pMetricEntriesCount is greater than zero but less than total number of decodable metrics available in the raw data buffer, then driver shall update this value with actual number of raw data bytes processed.
pRawData
[in][range(0, rawDataSize)] buffer of raw data to decode
metricCount
[in] number of decodable metrics in the tracer for which the hMetricDecoder handle was provided. See zetMetricDecoderGetDecodableMetricsExp(). If metricCount is greater than zero but less than the number decodable metrics available in the raw data buffer, then driver shall only decode those
phMetric
[in] [range(0, metricCount)] array of handles of decodable metrics in the decoder for which the hMetricDecoder handle was provided. Metrics handles are expected to be for decodable metrics, see zetMetricDecoderGetDecodableMetrics ()
pMetricEntriesCount
[in,out] pointer to number of decodable metric entries to be decoded. If count is zero, then the driver shall update the value with the total number of decodable metric entries to be decoded. If count is greater than zero but less than the total number available in the raw data, then only that number of results will be decoded. if count is greater than the number available in the raw data buffer, then the driver shall update the value with the actual number of decodable metric entries to be decoded
pMetricEntries
[in,out] [in,out][optional][range(0, * pMetricEntriesCount)] buffer of decoded metric entries
Summary
Extend the support of tracer metrics (https://github.com/oneapi-src/level-zero-spec/issues/285) to allow decoding raw events.
Details
Motivation
Extend users visibility of the raw data collected to allow retrieving in a format that allows parsing.
Interoperability with Other APIs
Raw data retrieved by zetMetricTracerReadDataExp() can be used as input to an API that decodes it to a format that allows parsing.
Proposed APIs
New Enumerations
Extend the metrics types https://spec.oneapi.io/level-zero/latest/tools/api.html#_CPPv417zet_metric_type_t
New Handles
zet_metric_decoder_exp_handle_t
Metric tracer decoder handle
New Structures
zet_metric_entry_exp_t
New Functions
zetMetricDecoderCreateExp
Create a metric decoder for a given metric tracer.
zetMetricDecoderDestroyExp
Destroy the metric decoder.
zetMetricDecoderGetDecodableMetricsExp
Return the list of the decodable metrics that can be collected in the tracer for the which the metric decoder handle was provided. The decodable metrics handles returned by this API are only valid to decode metrics raw data with zetMetricTracerDecodeExp(). Decodable metric handles are not valid to compare with metrics handles included in metric groups.
zetMetricTracerDecodeExp
Decode raw events collected from a tracer into list of ze_metric_entry_exp_t
Usage Example
Extend example provided in https://github.com/oneapi-src/level-zero-spec/issues/285 with decoder APIs