intel/perf: move close_perf into perf

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
Mark Janes
2019-06-26 11:43:20 -07:00
parent f57c8a6dc1
commit 79ded7cc8f
3 changed files with 20 additions and 18 deletions

View File

@@ -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;
}
}