SWDEV-301667 - Reset profiler correlation_id_

- The correlation_id had random junk values which we were inserting in
the dispatch AQL packet even when no profiler was attached but if we had
a valid timestamp.
- Also make sure we dont even write the reserved2 field in the AQL
packet if no profiler attached.

Change-Id: Icdb7493198c1bb5e2d786a97e027288660854cd7


[ROCm/clr commit: 9a6ddae7b2]
Этот коммит содержится в:
Saleel Kudchadker
2024-01-25 02:10:15 +00:00
коммит произвёл Maneesh Gupta
родитель 3445b57a43
Коммит cc0b04cc60
3 изменённых файлов: 6 добавлений и 2 удалений
+2 -1
Просмотреть файл
@@ -865,7 +865,8 @@ bool VirtualGPU::dispatchGenericAqlPacket(
// If profiling is enabled, store the correlation ID in the dispatch packet. The profiler can
// retrieve this correlation ID to attribute waves to specific dispatch locations.
if (std::is_same<decltype(packet), hsa_kernel_dispatch_packet_t*>::value) {
if (std::is_same<decltype(packet), hsa_kernel_dispatch_packet_t*>::value &&
activity_prof::IsEnabled(OP_ID_DISPATCH)) {
auto dispatchPacket = reinterpret_cast<hsa_kernel_dispatch_packet_t*>(packet);
dispatchPacket->reserved2 = timestamp_->command().profilingInfo().correlation_id_;
}
+3 -1
Просмотреть файл
@@ -158,7 +158,9 @@ bool Event::setStatus(int32_t status, uint64_t timeStamp) {
releaseResources();
}
if (profilingInfo().enabled_) activity_prof::ReportActivity(command());
if (profilingInfo().enabled_ && activity_prof::IsEnabled(OP_ID_DISPATCH)) {
activity_prof::ReportActivity(command());
}
// Broadcast all the waiters.
if (referenceCount() > 1) {
+1
Просмотреть файл
@@ -126,6 +126,7 @@ class Event : public RuntimeObject {
submitted_ = 0ULL;
start_ = 0ULL;
end_ = 0ULL;
correlation_id_ = 0ULL;
}
} profilingInfo_;