From 541764daadccc3bba7c933b79e89d1d62b074015 Mon Sep 17 00:00:00 2001 From: Sriraksha Nagaraj Date: Thu, 23 Jun 2022 20:14:20 +0000 Subject: [PATCH] SWDEV-323976 - changes in the scripts to display copy activity in the trace output Change-Id: If8f7df3668c075a8f21508c796220693be9b40d3 [ROCm/rocprofiler commit: b0152e00919ba7122f2d33b6f3411222af496281] --- projects/rocprofiler/bin/merge_traces.sh | 7 ++++--- projects/rocprofiler/bin/tblextr.py | 5 ++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/projects/rocprofiler/bin/merge_traces.sh b/projects/rocprofiler/bin/merge_traces.sh index a1b042f323..dd68b41923 100755 --- a/projects/rocprofiler/bin/merge_traces.sh +++ b/projects/rocprofiler/bin/merge_traces.sh @@ -74,9 +74,10 @@ if ! [ -d "${OUTPUT_DIR}" ] ; then fi echo "Processing directories: $INPUT_DIRS" -for file in begin_ts_file hcc_ops_trace hsa_handles hip_api_trace roctx_trace hsa_api_trace results; do - find ${INPUT_DIRS} -type f -regextype sed -regex ".*/[0-9]\{1,\}_${file}\.txt" \ - -not -path "${OUTPUT_DIR}/*" | xargs cat > "${OUTPUT_DIR}/${file}.txt" +for file in begin_ts_file hcc_ops_trace hsa_handles hip_api_trace roctx_trace hsa_api_trace results async_copy_trace; do + res=$(find ${INPUT_DIRS} -type f -regextype sed -regex ".*/[0-9]\{1,\}_${file}\.txt" \ + -not -path "${OUTPUT_DIR}/*") + test -n "${res}" && cat ${res} > "${OUTPUT_DIR}/${file}.txt" done if ! [ -d "${BIN_DIR}" ] ; then diff --git a/projects/rocprofiler/bin/tblextr.py b/projects/rocprofiler/bin/tblextr.py index fb85fcfb87..ab81add68d 100755 --- a/projects/rocprofiler/bin/tblextr.py +++ b/projects/rocprofiler/bin/tblextr.py @@ -376,7 +376,6 @@ def fill_api_db(table_name, db, indir, api_name, api_pid, dep_pid, dep_list, dep range_start_times = {} copy_csv = '' - copy_index = 0 ptrn_val = re.compile(r'(\d+):(\d+) (\d+):(\d+) ([^\(]+)(\(.*)$') hip_mcopy_ptrn = re.compile(r'hipMemcpy|hipMemset') @@ -527,8 +526,7 @@ def fill_api_db(table_name, db, indir, api_name, api_pid, dep_pid, dep_list, dep op_found = 1 stream_id = thread_id - hsa_patch_data[(copy_index, proc_id)] = thread_id - copy_index += 1 + hsa_patch_data[(corr_id, proc_id)] = thread_id if op_found: roctx_msg = '' @@ -652,6 +650,7 @@ def fill_copy_db(table_name, db, indir): #if not pid in dep_proc: dep_proc[pid] = { 'pid': HSA_PID, 'from': [], 'to': {}, 'id': [] } dep_str = dep_proc[sect_id] dep_str['to'][corr_id] = to_us + dep_str['id'].append(corr_id) return 1 #############################################################