From 4e691bd30701d0c5d015dfb1e8595a07922e5c7f Mon Sep 17 00:00:00 2001 From: Evgeny Date: Fri, 14 Aug 2020 12:06:37 -0500 Subject: [PATCH] passing filename to mem_manager dump Change-Id: I95cb99a69c4d2f8e55a063388d46a7f7b196f6bd [ROCm/rocprofiler commit: 5511a969e70bb192c9aea9172274d5630db82be2] --- projects/rocprofiler/bin/mem_manager.py | 11 +++++------ projects/rocprofiler/bin/tblextr.py | 3 ++- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/projects/rocprofiler/bin/mem_manager.py b/projects/rocprofiler/bin/mem_manager.py index 8b616cc6ca..e87c4bca19 100755 --- a/projects/rocprofiler/bin/mem_manager.py +++ b/projects/rocprofiler/bin/mem_manager.py @@ -188,17 +188,15 @@ class MemManager: m = hipMemcpy_ptrn_kind.match(args) if m: - direction = switcher.get(m.group(1), "unknown") + direction = switcher.get(m.group(1), "unknown") copy_line = str(start_time) + DELIM + str(end_time) + DELIM + pid + DELIM + tid + DELIM + event + DELIM + 'Direction=' + direction + DELIM + 'SrcType=' + srcptr_type + DELIM + 'DstType=' + dstptr_type + DELIM + "Size=" + str(size) + DELIM + "BW=" + str(round(bandwidth, 2)) + DELIM + 'Async=' + str(is_async) self.memcopies[recordid] = copy_line return copy_line; - def dump_data(self): - # To create “MM” table in DB on the finish - table_name = "MM" - file_name = os.environ['PWD'] + '/results.memcopy_info.csv' + def dump_data(self, table_name, file_name): + # To create memcopy info table in DB print("File '" + file_name + "' is generating") table_handle = self.db.add_table(table_name, mm_table_descr) @@ -212,5 +210,6 @@ class MemManager: else: rec_vals_array.append(rec) self.db.insert_entry(table_handle, rec_vals_array) - # To dump the MM table as CSV + + # To dump the memcopy info table as CSV self.db.dump_csv(table_name, file_name) diff --git a/projects/rocprofiler/bin/tblextr.py b/projects/rocprofiler/bin/tblextr.py index 1b39a415b0..4ccc92e937 100755 --- a/projects/rocprofiler/bin/tblextr.py +++ b/projects/rocprofiler/bin/tblextr.py @@ -672,6 +672,7 @@ else: kfd_statfile = re.sub(r'\.stats\.csv$', r'.kfd_stats.csv', statfile) ops_statfile = statfile copy_statfile = re.sub(r'\.stats\.csv$', r'.copy_stats.csv', statfile) + memcopy_info_file = re.sub(r'\.stats\.csv$', r'.memcopy_info.csv', statfile) sysinfo_file = re.sub(r'\.stats\.csv$', r'.sysinfo.txt', statfile) metadata_gen(sysinfo_file, 'rocminfo') @@ -778,7 +779,7 @@ else: db.close_json(jsonfile); if mcopy_data_enabled: - memory_manager.dump_data() + memory_manager.dump_data('MM', memcopy_info_file) db.close()