From 8030b7001c3f36d00c01d4a78f9dabe1c2e45936 Mon Sep 17 00:00:00 2001 From: Aravind Gopalakrishnan Date: Tue, 11 Jan 2022 07:05:12 +0000 Subject: [PATCH] Fix magic value used to skip odd packets for timestamps Related-To: LOCI-2718 Signed-off-by: Aravind Gopalakrishnan --- level_zero/core/source/event/event_impl.inl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/level_zero/core/source/event/event_impl.inl b/level_zero/core/source/event/event_impl.inl index 0d157f51d1..443ee7a206 100644 --- a/level_zero/core/source/event/event_impl.inl +++ b/level_zero/core/source/event/event_impl.inl @@ -51,6 +51,8 @@ NEO::GraphicsAllocation &EventImp::getAllocation(Device *device) { template ze_result_t EventImp::calculateProfilingData() { + constexpr uint32_t skipL3EventPacketIndex = 2u; + globalStartTS = kernelEventCompletionData[0].getGlobalStartValue(0); globalEndTS = kernelEventCompletionData[0].getGlobalEndValue(0); contextStartTS = kernelEventCompletionData[0].getContextStartValue(0); @@ -58,7 +60,7 @@ ze_result_t EventImp::calculateProfilingData() { for (uint32_t i = 0; i < kernelCount; i++) { for (auto packetId = 0u; packetId < kernelEventCompletionData[i].getPacketsUsed(); packetId++) { - if (this->l3FlushWaApplied && ((packetId % 2) != 0)) { + if (this->l3FlushWaApplied && ((packetId % skipL3EventPacketIndex) != 0)) { continue; } if (globalStartTS > kernelEventCompletionData[i].getGlobalStartValue(packetId)) {