From 5d3f0a0e9eebbb2a2d8de5743262ae887a66c4fc Mon Sep 17 00:00:00 2001 From: gobhardw Date: Tue, 19 Sep 2023 23:40:54 +0530 Subject: [PATCH] Fixing kernel-trace for file plugin Change-Id: I9853e7e10da2f0812c69fe5242a9be34c78496f7 --- plugin/file/file.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugin/file/file.cpp b/plugin/file/file.cpp index 1278b6ae99..a3f8793109 100644 --- a/plugin/file/file.cpp +++ b/plugin/file/file.cpp @@ -228,7 +228,6 @@ class file_plugin_t { if (type == output_type_t::COUNTER) { if (kernel_dispatches_header_written_.load(std::memory_order_relaxed)) return; output_file = get_output_file(output_type_t::COUNTER); - *output_file << "Dispatch_ID,GPU_ID,Queue_ID,Queue_Index,PID,TID,GRD,WGR,LDS,SCR,Arch_VGPR," "ACCUM_VGPR,SGPR,Wave_Size,SIG,OBJ,Kernel_Name,Start_Timestamp,End_Timestamp," @@ -323,6 +322,7 @@ class file_plugin_t { void FlushProfilerRecord(const rocprofiler_record_profiler_t* profiler_record, rocprofiler_session_id_t session_id, rocprofiler_buffer_id_t buffer_id) { + std::lock_guard lock(writing_lock); WriteHeader(output_type_t::COUNTER, ACTIVITY_DOMAIN_NUMBER); size_t name_length = 0; @@ -360,6 +360,9 @@ class file_plugin_t { } *output_file << '\n'; } + else{ //kernel trace condition + *output_file << '\n'; + } *output_file << std::to_string(profiler_record->header.id.handle) << "," << std::to_string(profiler_record->gpu_id.handle) << ","