ROCm / rocprofiler

ROC profiler library. Profiling with perf-counters and derived metrics.
https://rocm.docs.amd.com/projects/rocprofiler/en/latest/
MIT License
126 stars 46 forks source link

Error when statfile path contains 'stats' #8

Closed stanleytsang-amd closed 4 years ago

stanleytsang-amd commented 4 years ago

If rocprofiler is used where the current working directory contains the expression 'stats' then rocprofiler errors out because it does a regular expression match and replace on 'stats':

When run with --hip-trace:

Traceback (most recent call last): File "/home/WORKSPACE/statsang/rocprofiler_pkg/bin/tblextr.py", line 499, in dform.gen_table_bins(db, 'HIP', statfile, 'Name', 'DurationNs') File "/home/WORKSPACE/statsang/rocprofiler_pkg/bin/dform.py", line 24, in gen_table_bins gen_data_bins(db, outfile) File "/home/WORKSPACE/statsang/rocprofiler_pkg/bin/dform.py", line 19, in gen_data_bins db.dump_csv('C', outfile) File "/home/WORKSPACE/statsang/rocprofiler_pkg/bin/sqlitedb.py", line 95, in dump_csv with open(file_name, mode='w') as fd: IOError: [Errno 2] No such file or directory: '/home/hip_statsang/WORKSPACE/rccl-tests/output.hip_stats.csv' Data extracting error: /tmp/rpl_data_191204_153135_49168/input_results_191204_153135/'

Please strengthen the regular expression match/replace to account for the case where the target path contains 'stats', (or when the user has a cursed username like me). Thank you.

eshcherb commented 4 years ago

Fixed: commit 3eb4a67 to 'amd-master' branch.