From: Lionel Landwerlin Date: Mon, 16 Dec 2019 13:42:55 +0000 (+0200) Subject: intel/perf: report query split for mdapi X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=44ffeb4fee8a38f9e526749eee163cbff89dea25;p=mesa.git intel/perf: report query split for mdapi Also forgotten in the initial implementation. v2: Report begin timestamp scaled by the timestamp frequency (Windows behavior) v3: Rename split to disjoint to match GL terminology (Tapani) Signed-off-by: Lionel Landwerlin Cc: Acked-by: Tapani Pälli Tested-by: Marge Bot Part-of: --- diff --git a/src/intel/perf/gen_perf.c b/src/intel/perf/gen_perf.c index fa6afb41807..421dfb8db52 100644 --- a/src/intel/perf/gen_perf.c +++ b/src/intel/perf/gen_perf.c @@ -2372,6 +2372,12 @@ accumulate_oa_reports(struct gen_perf_context *perf_ctx, gen_perf_query_result_accumulate(&query->oa.result, query->queryinfo, last, report); + } else { + /* We're not adding the delta because we've identified it's not + * for the context we filter for. We can consider that the + * query was split. + */ + query->oa.result.query_disjoint = true; } last = report; diff --git a/src/intel/perf/gen_perf.h b/src/intel/perf/gen_perf.h index 28df75c5bb1..b0af49ffb2c 100644 --- a/src/intel/perf/gen_perf.h +++ b/src/intel/perf/gen_perf.h @@ -118,6 +118,11 @@ struct gen_perf_query_result { * Timestamp of the query. */ uint64_t begin_timestamp; + + /** + * Whether the query was interrupted by another workload (aka preemption). + */ + bool query_disjoint; }; struct gen_perf_query_counter { diff --git a/src/intel/perf/gen_perf_mdapi.c b/src/intel/perf/gen_perf_mdapi.c index 0f35671930f..4c70d1f0207 100644 --- a/src/intel/perf/gen_perf_mdapi.c +++ b/src/intel/perf/gen_perf_mdapi.c @@ -54,6 +54,7 @@ gen_perf_query_result_write_mdapi(void *data, uint32_t data_size, gen_device_info_timebase_scale(devinfo, result->accumulator[0]); mdapi_data->CoreFrequency = freq_end; mdapi_data->CoreFrequencyChanged = freq_end != freq_start; + mdapi_data->SplitOccured = result->query_disjoint; return sizeof(*mdapi_data); } case 8: { @@ -73,7 +74,8 @@ gen_perf_query_result_write_mdapi(void *data, uint32_t data_size, mdapi_data->ReportsCount = result->reports_accumulated; mdapi_data->TotalTime = gen_device_info_timebase_scale(devinfo, result->accumulator[0]); - mdapi_data->BeginTimestamp = result->begin_timestamp; + mdapi_data->BeginTimestamp = + gen_device_info_timebase_scale(devinfo, result->begin_timestamp); mdapi_data->GPUTicks = result->accumulator[1]; mdapi_data->CoreFrequency = freq_end; mdapi_data->CoreFrequencyChanged = freq_end != freq_start; @@ -81,6 +83,7 @@ gen_perf_query_result_write_mdapi(void *data, uint32_t data_size, (result->slice_frequency[0] + result->slice_frequency[1]) / 2ULL; mdapi_data->UnsliceFrequency = (result->unslice_frequency[0] + result->unslice_frequency[1]) / 2ULL; + mdapi_data->SplitOccured = result->query_disjoint; return sizeof(*mdapi_data); } case 9: @@ -102,7 +105,8 @@ gen_perf_query_result_write_mdapi(void *data, uint32_t data_size, mdapi_data->ReportsCount = result->reports_accumulated; mdapi_data->TotalTime = gen_device_info_timebase_scale(devinfo, result->accumulator[0]); - mdapi_data->BeginTimestamp = result->begin_timestamp; + mdapi_data->BeginTimestamp = + gen_device_info_timebase_scale(devinfo, result->begin_timestamp); mdapi_data->GPUTicks = result->accumulator[1]; mdapi_data->CoreFrequency = freq_end; mdapi_data->CoreFrequencyChanged = freq_end != freq_start; @@ -110,6 +114,7 @@ gen_perf_query_result_write_mdapi(void *data, uint32_t data_size, (result->slice_frequency[0] + result->slice_frequency[1]) / 2ULL; mdapi_data->UnsliceFrequency = (result->unslice_frequency[0] + result->unslice_frequency[1]) / 2ULL; + mdapi_data->SplitOccured = result->query_disjoint; return sizeof(*mdapi_data); } default: