xref: /aosp_15_r20/external/mesa3d/src/intel/perf/xe/intel_perf.h (revision 6104692788411f58d303aa86923a9ff6ecaded22)
1 /*
2  * Copyright 2024 Intel Corporation
3  * SPDX-License-Identifier: MIT
4  */
5 
6 #pragma once
7 
8 #include <stdbool.h>
9 #include <stddef.h>
10 #include <stdint.h>
11 
12 struct intel_perf_config;
13 struct intel_perf_registers;
14 
15 uint64_t xe_perf_get_oa_format(struct intel_perf_config *perf);
16 
17 bool xe_oa_metrics_available(struct intel_perf_config *perf, int fd, bool use_register_snapshots);
18 
19 uint64_t xe_add_config(struct intel_perf_config *perf, int fd, const struct intel_perf_registers *config, const char *guid);
20 void xe_remove_config(struct intel_perf_config *perf, int fd, uint64_t config_id);
21 
22 int xe_perf_stream_open(struct intel_perf_config *perf_config, int drm_fd,
23                         uint32_t exec_id, uint64_t metrics_set_id,
24                         uint64_t report_format, uint64_t period_exponent,
25                         bool hold_preemption, bool enable);
26 int xe_perf_stream_set_state(int perf_stream_fd, bool enable);
27 int xe_perf_stream_set_metrics_id(int perf_stream_fd, uint64_t metrics_set_id);
28 int xe_perf_stream_read_samples(struct intel_perf_config *perf_config, int perf_stream_fd,
29                                 uint8_t *buffer, size_t buffer_len);
30