diff --git a/CHANGELOG.md b/CHANGELOG.md index c828450ede..9b5b3f2caa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -103,6 +103,7 @@ Full documentation for ROCprofiler-SDK is available at [Click Here](source/docs/ - Support `--marker-trace` on application linked against old (roctracer) ROCTx (i.e. `libroctx64.so`) - Replaced deprecated hipHostMalloc and hipHostFree functions with hipExtHostAlloc and hipFreeHost in when ROCm version is greater than or equal to 6.3 - Updated `rocprofv3` `--help` options. +- Adding start and end timestamp columns to the counter collection csv output. ### Fixes diff --git a/source/docs/how-to/using-rocprofv3.rst b/source/docs/how-to/using-rocprofv3.rst index e8f1a6163f..fef9e267d9 100644 --- a/source/docs/how-to/using-rocprofv3.rst +++ b/source/docs/how-to/using-rocprofv3.rst @@ -616,11 +616,11 @@ To collect counters for the kernels matching the filters specified in the preced rocprofv3 -i input.yml -- $ cat pass_1/312_counter_collection.csv - "Correlation_Id","Dispatch_Id","Agent_Id","Queue_Id","Process_Id","Thread_Id","Grid_Size","Kernel_Name","Workgroup_Size","LDS_Block_Size","Scratch_Size","VGPR_Count","SGPR_Count","Counter_Name","Counter_Value" - 4,4,1,1,36499,36499,1048576,"divide_kernel(float*, float const*, float const*, int, int)",64,0,0,12,16,"SQ_WAVES",16384 - 8,8,1,2,36499,36499,1048576,"divide_kernel(float*, float const*, float const*, int, int)",64,0,0,12,16,"SQ_WAVES",16384 - 12,12,1,3,36499,36499,1048576,"divide_kernel(float*, float const*, float const*, int, int)",64,0,0,12,16,"SQ_WAVES",16384 - 16,16,1,4,36499,36499,1048576,"divide_kernel(float*, float const*, float const*, int, int)",64,0,0,12,16,"SQ_WAVES",16384 + "Correlation_Id","Dispatch_Id","Agent_Id","Queue_Id","Process_Id","Thread_Id","Grid_Size","Kernel_Name","Workgroup_Size","LDS_Block_Size","Scratch_Size","VGPR_Count","SGPR_Count","Counter_Name","Counter_Value","Start_Timestamp","End_Timestamp" + 4,4,1,1,36499,36499,1048576,"divide_kernel(float*, float const*, float const*, int, int)",64,0,0,12,16,"SQ_WAVES",16384,2228955885095594,2228955885119754 + 8,8,1,2,36499,36499,1048576,"divide_kernel(float*, float const*, float const*, int, int)",64,0,0,12,16,"SQ_WAVES",16384,2228955885095594,2228955885119754 + 12,12,1,3,36499,36499,1048576,"divide_kernel(float*, float const*, float const*, int, int)",64,0,0,12,16,"SQ_WAVES",16384,2228955892986914,2228955893006114 + 16,16,1,4,36499,36499,1048576,"divide_kernel(float*, float const*, float const*, int, int)",64,0,0,12,16,"SQ_WAVES",16384,2228955892986914,2228955893006114 .. _output-file-fields: diff --git a/source/lib/rocprofiler-sdk-tool/csv.hpp b/source/lib/rocprofiler-sdk-tool/csv.hpp index cd5d71c652..64b5f12b05 100644 --- a/source/lib/rocprofiler-sdk-tool/csv.hpp +++ b/source/lib/rocprofiler-sdk-tool/csv.hpp @@ -102,7 +102,7 @@ struct csv_encoder using api_csv_encoder = csv_encoder<7>; using agent_info_csv_encoder = csv_encoder<53>; using kernel_trace_csv_encoder = csv_encoder<18>; -using counter_collection_csv_encoder = csv_encoder<16>; +using counter_collection_csv_encoder = csv_encoder<18>; using memory_copy_csv_encoder = csv_encoder<7>; using marker_csv_encoder = csv_encoder<7>; using list_basic_metrics_csv_encoder = csv_encoder<5>; diff --git a/source/lib/rocprofiler-sdk-tool/generateCSV.cpp b/source/lib/rocprofiler-sdk-tool/generateCSV.cpp index 5c6379ce55..96ded3704c 100644 --- a/source/lib/rocprofiler-sdk-tool/generateCSV.cpp +++ b/source/lib/rocprofiler-sdk-tool/generateCSV.cpp @@ -483,7 +483,9 @@ generate_csv(tool_table* too "VGPR_Count", "SGPR_Count", "Counter_Name", - "Counter_Value"}}; + "Counter_Value", + "Start_Timestamp", + "End_Timestamp"}}; for(const auto& record : data) { auto kernel_id = record.dispatch_data.dispatch_info.kernel_id; @@ -525,7 +527,9 @@ generate_csv(tool_table* too record.arch_vgpr_count, record.sgpr_count, itr.first, - itr.second); + itr.second, + record.dispatch_data.start_timestamp, + record.dispatch_data.end_timestamp); } ofs << row_ss.str(); } diff --git a/tests/counter-collection/validate.py b/tests/counter-collection/validate.py index 43a31eb62c..532bf9055e 100644 --- a/tests/counter-collection/validate.py +++ b/tests/counter-collection/validate.py @@ -60,6 +60,7 @@ def test_counter_values(input_data): agent = get_agent(agent_id) scaling_factor = get_scaling_factor(agent_id) assert agent is not None, f"itr={itr}\nagent={agent}" + assert itr["start_timestamp"] < itr["end_timestamp"] for ritr in itr["records"]: value = ritr["counter_value"] if int(round(value, 0)) > 0: