intel/perf: move get_free_sample_buf into perf

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
Mark Janes
2019-05-30 18:30:25 -07:00
parent e08a69b7f4
commit 31758bd36c
3 changed files with 22 additions and 21 deletions

View File

@@ -824,3 +824,22 @@ gen_perf_query_get_metric_id(struct gen_perf_config *perf,
}
return query->oa_metrics_set_id;
}
struct oa_sample_buf *
gen_perf_get_free_sample_buf(struct gen_perf_context *perf_ctx)
{
struct exec_node *node = exec_list_pop_head(&perf_ctx->free_sample_buffers);
struct oa_sample_buf *buf;
if (node)
buf = exec_node_data(struct oa_sample_buf, node, link);
else {
buf = ralloc_size(perf_ctx->perf, sizeof(*buf));
exec_node_init(&buf->link);
buf->refcount = 0;
buf->len = 0;
}
return buf;
}