diff --git a/projects/roctracer/test/tool/tracer_tool.cpp b/projects/roctracer/test/tool/tracer_tool.cpp index 7f22776660..b819fd0a1d 100644 --- a/projects/roctracer/test/tool/tracer_tool.cpp +++ b/projects/roctracer/test/tool/tracer_tool.cpp @@ -398,16 +398,19 @@ void hip_api_flush_cb(hip_api_trace_entry_t* entry) { const hip_api_data_t* data = &(entry->data); const timestamp_t begin_timestamp = entry->begin; const timestamp_t end_timestamp = entry->end; - std::ostringstream oss; \ + std::ostringstream oss; + std::ostringstream oss2; const char* str = (domain != ACTIVITY_DOMAIN_EXT_API) ? roctracer_op_string(domain, cid, 0) : strdup("MARK"); oss << std::dec << begin_timestamp << ":" << end_timestamp << " " << entry->pid << ":" << entry->tid << " " << str; + oss2 << std::dec << + begin_timestamp << ":" << end_timestamp << " " << entry->pid << ":" << entry->tid; if (domain == ACTIVITY_DOMAIN_HIP_API) { #if HIP_PROF_HIP_API_STRING const char* str = hipApiString((hip_api_id_t)cid, data); - fprintf(hip_api_file_handle, "%s\n", str); + fprintf(hip_api_file_handle, "%s %s\n", oss2.str().c_str(), str); #else // !HIP_PROF_HIP_API_STRING switch (cid) { case HIP_API_ID_hipMemcpy: