summaryrefslogtreecommitdiffstats
path: root/src/intel/perf/gen_perf.c
diff options
context:
space:
mode:
authorMark Janes <[email protected]>2019-06-26 11:43:20 -0700
committerMark Janes <[email protected]>2019-08-07 21:33:55 -0700
commit79ded7cc8f0b146bdf153f12093b6b6766fcf06b (patch)
tree7d2e81ca74c38e39365dbe27ef9cd9b76b740863 /src/intel/perf/gen_perf.c
parentf57c8a6dc110e7701233f159ce166c63ea75ff5f (diff)
intel/perf: move close_perf into perf
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/intel/perf/gen_perf.c')
-rw-r--r--src/intel/perf/gen_perf.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/intel/perf/gen_perf.c b/src/intel/perf/gen_perf.c
index f6e145627f5..99f9cd7e097 100644
--- a/src/intel/perf/gen_perf.c
+++ b/src/intel/perf/gen_perf.c
@@ -903,3 +903,18 @@ gen_perf_snapshot_statistics_registers(void *context,
offset_in_bytes + i * sizeof(uint64_t));
}
}
+
+void
+gen_perf_close(struct gen_perf_context *perfquery,
+ const struct gen_perf_query_info *query)
+{
+ if (perfquery->oa_stream_fd != -1) {
+ close(perfquery->oa_stream_fd);
+ perfquery->oa_stream_fd = -1;
+ }
+ if (query->kind == GEN_PERF_QUERY_TYPE_RAW) {
+ struct gen_perf_query_info *raw_query =
+ (struct gen_perf_query_info *) query;
+ raw_query->oa_metrics_set_id = 0;
+ }
+}