Path: blob/21.2-virgl/src/intel/perf/intel_perf_query.h
4547 views
/*1* Copyright © 2019 Intel Corporation2*3* Permission is hereby granted, free of charge, to any person obtaining a4* copy of this software and associated documentation files (the "Software"),5* to deal in the Software without restriction, including without limitation6* the rights to use, copy, modify, merge, publish, distribute, sublicense,7* and/or sell copies of the Software, and to permit persons to whom the8* Software is furnished to do so, subject to the following conditions:9*10* The above copyright notice and this permission notice (including the next11* paragraph) shall be included in all copies or substantial portions of the12* Software.13*14* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR15* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,16* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL17* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER18* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING19* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS20* IN THE SOFTWARE.21*/2223#ifndef INTEL_PERF_QUERY_H24#define INTEL_PERF_QUERY_H2526#include <stdint.h>2728#ifdef __cplusplus29extern "C" {30#endif3132struct intel_device_info;3334struct intel_perf_config;35struct intel_perf_context;36struct intel_perf_query_object;3738bool39intel_perf_open(struct intel_perf_context *perf_ctx,40int metrics_set_id,41int report_format,42int period_exponent,43int drm_fd,44uint32_t ctx_id,45bool enable);4647void48intel_perf_close(struct intel_perf_context *perfquery,49const struct intel_perf_query_info *query);5051bool intel_perf_oa_stream_ready(struct intel_perf_context *perf_ctx);5253ssize_t54intel_perf_read_oa_stream(struct intel_perf_context *perf_ctx,55void* buf,56size_t nbytes);5758struct intel_perf_context *intel_perf_new_context(void *parent);5960void intel_perf_init_context(struct intel_perf_context *perf_ctx,61struct intel_perf_config *perf_cfg,62void * mem_ctx, /* ralloc context */63void * ctx, /* driver context (eg, brw_context) */64void * bufmgr, /* eg brw_bufmgr */65const struct intel_device_info *devinfo,66uint32_t hw_ctx,67int drm_fd);6869const struct intel_perf_query_info* intel_perf_query_info(const struct intel_perf_query_object *);7071struct intel_perf_config *intel_perf_config(struct intel_perf_context *ctx);7273int intel_perf_active_queries(struct intel_perf_context *perf_ctx,74const struct intel_perf_query_info *query);7576struct intel_perf_query_object *77intel_perf_new_query(struct intel_perf_context *, unsigned query_index);787980bool intel_perf_begin_query(struct intel_perf_context *perf_ctx,81struct intel_perf_query_object *query);82void intel_perf_end_query(struct intel_perf_context *perf_ctx,83struct intel_perf_query_object *query);84void intel_perf_wait_query(struct intel_perf_context *perf_ctx,85struct intel_perf_query_object *query,86void *current_batch);87bool intel_perf_is_query_ready(struct intel_perf_context *perf_ctx,88struct intel_perf_query_object *query,89void *current_batch);90void intel_perf_delete_query(struct intel_perf_context *perf_ctx,91struct intel_perf_query_object *query);92void intel_perf_get_query_data(struct intel_perf_context *perf_ctx,93struct intel_perf_query_object *query,94void *current_batch,95int data_size,96unsigned *data,97unsigned *bytes_written);9899void intel_perf_dump_query_count(struct intel_perf_context *perf_ctx);100void intel_perf_dump_query(struct intel_perf_context *perf_ctx,101struct intel_perf_query_object *obj,102void *current_batch);103104#ifdef __cplusplus105} // extern "C"106#endif107108#endif /* INTEL_PERF_QUERY_H */109110111