From 90cfe92b05b259d68a780bd3b7603a09c7e28c6b Mon Sep 17 00:00:00 2001 From: Evgeny Date: Mon, 12 Oct 2020 16:47:17 -0500 Subject: [PATCH] hip async ops api detection fix Change-Id: I039caf278214ded95c1ef4d06a872d888ac19573 --- bin/tblextr.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/bin/tblextr.py b/bin/tblextr.py index ce1ff34800..82b310dcfe 100755 --- a/bin/tblextr.py +++ b/bin/tblextr.py @@ -347,12 +347,12 @@ def fill_api_db(table_name, db, indir, api_name, api_pid, dep_pid, dep_list, dep if (hsa_activity_found): copy_raws = db.table_get_raws('COPY') copy_csv = '' copy_index = 0 - op_found = 0 file_name = indir + '/' + api_name + '_api_trace.txt' ptrn_val = re.compile(r'(\d+):(\d+) (\d+):(\d+) ([^\(]+)(\(.*)$') hip_mcopy_ptrn = re.compile(r'hipMemcpy') - ptrn_ac = re.compile(r'hsa_amd_memory_async_copy') + hip_wait_event_ptrn = re.compile(r'WaitEvent') + hsa_mcopy_ptrn = re.compile(r'hsa_amd_memory_async_copy') ptrn_fixformat = re.compile(r'(\d+:\d+ \d+:\d+ \w+)\(\s*(.*)\)$') ptrn_fixkernel = re.compile(r'\s+kernel=(.*)$') ptrn_multi_kernel = re.compile(r'(.*):(\d+)$') @@ -424,6 +424,9 @@ def fill_api_db(table_name, db, indir, api_name, api_pid, dep_pid, dep_list, dep (rec_vals[5], found) = set_field(record_args, 'stream', stream_id) if found == 0: fatal('set_field() failed for "stream", args: "' + record_args + '"') + # asyncronous opeartion API found + op_found = 0 + # extract kernel name string (kernel_str, kernel_found) = get_field(record_args, 'kernel') if kernel_found == 0: kernel_str = '' @@ -433,7 +436,7 @@ def fill_api_db(table_name, db, indir, api_name, api_pid, dep_pid, dep_list, dep ops_patch_data[(corr_id, proc_id)] = (stream_id, kernel_str) # dependencies filling - if ptrn_ac.match(record_name) or hip_mcopy_ptrn.match(record_name): + if hsa_mcopy_ptrn.match(record_name) or hip_mcopy_ptrn.match(record_name): op_found = 1 # memcopy data @@ -446,6 +449,10 @@ def fill_api_db(table_name, db, indir, api_name, api_pid, dep_pid, dep_list, dep copy_csv += str(copy_index) + ', ' + copy_line + '\n' copy_index += 1 + # HIP WaitEvent APIs + if hip_wait_event_ptrn.search(record_name): + op_found = 1 + if op_found: beg_ns = int(rec_vals[0]) end_ns = int(rec_vals[1])