From a50bbaef5da6a7bd117ad75dd98a51d4f991c8a9 Mon Sep 17 00:00:00 2001 From: Evgeny Date: Tue, 17 Dec 2019 11:39:52 -0600 Subject: [PATCH] fixing stat file names eexpression Change-Id: I4b99c4bef08fe31a4ab5c8e7167b49d8cd62d79b --- bin/tblextr.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/bin/tblextr.py b/bin/tblextr.py index 490cdb8b2b..2c4e442b26 100755 --- a/bin/tblextr.py +++ b/bin/tblextr.py @@ -446,6 +446,10 @@ else: statfile = re.sub(r'\.csv$', '.stats.csv', csvfile) jsonfile = re.sub(r'\.csv$', '.json', csvfile) + hsa_statfile = re.sub(r'\.stats\.csv$', r'.hsa_stats.csv', statfile) + hip_statfile = re.sub(r'\.stats\.csv$', r'.hip_stats.csv', statfile) + kfd_statfile = re.sub(r'\.stats\.csv$', r'.kfd_stats.csv', statfile) + with open(dbfile, mode='w') as fd: fd.truncate() db = SQLiteDB(dbfile) @@ -494,9 +498,8 @@ else: dform.gen_kernel_json_trace(db, 'A', GPU_BASE_PID, START_US, jsonfile) if hsa_trace_found: - statfile = re.sub(r'stats', r'hsa_stats', statfile) dform.post_process_data(db, 'HSA') - dform.gen_table_bins(db, 'HSA', statfile, 'Name', 'DurationNs') + dform.gen_table_bins(db, 'HSA', hsa_statfile, 'Name', 'DurationNs') dform.gen_api_json_trace(db, 'HSA', START_US, jsonfile) if hsa_activity_found: @@ -504,18 +507,16 @@ else: dform.gen_api_json_trace(db, 'COPY', START_US, jsonfile) if hip_trace_found: - statfile = re.sub(r'stats', r'hip_stats', statfile) dform.post_process_data(db, 'HIP') - dform.gen_table_bins(db, 'HIP', statfile, 'Name', 'DurationNs') + dform.gen_table_bins(db, 'HIP', hip_statfile, 'Name', 'DurationNs') dform.gen_api_json_trace(db, 'HIP', START_US, jsonfile) dform.post_process_data(db, 'OPS') dform.gen_ops_json_trace(db, 'OPS', GPU_BASE_PID, START_US, jsonfile) if kfd_trace_found: - statfile = re.sub(r'stats', r'kfd_stats', statfile) dform.post_process_data(db, 'KFD') - dform.gen_table_bins(db, 'KFD', statfile, 'Name', 'DurationNs') + dform.gen_table_bins(db, 'KFD', kfd_statfile, 'Name', 'DurationNs') dform.gen_api_json_trace(db, 'KFD', START_US, jsonfile) if any_trace_found: