Skip to content

Commit

Permalink
Report summary stats after L0 collector is destructed (#44)
Browse files Browse the repository at this point in the history
* Report summary stats after L0 collector is destructed

* Combine the two checks and fix a typo
  • Loading branch information
zma2 authored Dec 14, 2023
1 parent 166eeba commit c60f92b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion tools/unitrace/src/levelzero/ze_collector.h
Original file line number Diff line number Diff line change
Expand Up @@ -4001,7 +4001,7 @@ class ZeCollector {
}

void AggregateDeviceTimeStats() const {
// do not acquire global_device_time_stats_mutex_. caller dos it.
// do not acquire global_device_time_stats_mutex_. caller does it.
for (auto it = global_device_time_stats_->begin(); it != global_device_time_stats_->end(); it++) {
std::string kname;
if (it->first.tile_ >= 0) {
Expand Down
15 changes: 7 additions & 8 deletions tools/unitrace/src/tracer.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,13 @@ class UniTracer {
~UniTracer() {
total_execution_time_ = correlator_.GetTimestamp();

if (ze_collector_ != nullptr) {
ze_collector_->DisableTracing();
delete ze_collector_;
}

// report after ze_collector_ is destructed
// local stats are sweeped in deconstructor
Report();

ClExtCollector::Destroy();
Expand All @@ -213,14 +220,6 @@ class UniTracer {
cl_gpu_collector_->DisableTracing();
}

if (ze_collector_ != nullptr) {
ze_collector_->DisableTracing();
}

if (ze_collector_ != nullptr) {
delete ze_collector_;
}

if (itt_collector != nullptr){
// Print CCL summary before deleting the object
// If CCL summary is not enbled summary string will be empty
Expand Down

0 comments on commit c60f92b

Please sign in to comment.