From 78dd4711106c33dfb4d55e6303ac63be55323e39 Mon Sep 17 00:00:00 2001 From: SrirakshaNag <104580803+SrirakshaNag@users.noreply.github.com> Date: Wed, 10 Jan 2024 09:43:28 -0600 Subject: [PATCH] Fixing bugs in tracing tool output (#349) * Fixing bugs in tracing tool output * source formatting (clang-format v11) (#350) Co-authored-by: SrirakshaNag * correcting the formatting to match csv format * source formatting (clang-format v11) (#353) Co-authored-by: SrirakshaNag --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: SrirakshaNag --- source/lib/rocprofiler-sdk-tool/tool.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/source/lib/rocprofiler-sdk-tool/tool.cpp b/source/lib/rocprofiler-sdk-tool/tool.cpp index 3345e82565..79834a55fd 100644 --- a/source/lib/rocprofiler-sdk-tool/tool.cpp +++ b/source/lib/rocprofiler-sdk-tool/tool.cpp @@ -132,7 +132,8 @@ auto& get_hsa_api_file() { static auto _v = - output_file{"hsa_api_trace", {"KERNEL_NAME", "BEGIN_TS", "END_TS", "CORRELATION_ID"}}; + output_file{"hsa_api_trace", + {"DOMAIN", "FUNCTION", "START_TIMESTAMP", "END_TIMESTAMP", "CORRELATION_ID"}}; return _v; } @@ -175,9 +176,7 @@ struct hsa_api_trace_entry_t hsa_api_trace_entry_t(rocprofiler_timestamp_t begin, rocprofiler_timestamp_t end, rocprofiler_callback_tracing_record_t tracer_record, - std::string_view name - - ) + std::string_view name) : valid(TRACE_ENTRY_INIT) , record(tracer_record) , begin_timestamp(begin) @@ -202,11 +201,14 @@ TracerFlushRecord(void* data, rocprofiler_callback_tracing_kind_t kind) if(kind == ROCPROFILER_CALLBACK_TRACING_HSA_API) { auto* entry = reinterpret_cast(data); - get_hsa_api_file() << "\"" << entry->api_name << "\"" - << "," << entry->begin_timestamp << ":" << entry->end_timestamp << " " + get_hsa_api_file() << "ACTIVITY_DOMAIN_HSA_API" + << "," + << "\"" << entry->api_name << "\"" + << "," << entry->begin_timestamp << "," << entry->end_timestamp << "," << entry->record.correlation_id.internal << '\n'; } } + void rocprofiler_tracing_callback(rocprofiler_callback_tracing_record_t record, rocprofiler_user_data_t* user_data,