|
|
@ -329,7 +329,7 @@ class BaseStepTraceParser:
|
|
|
|
csv_writer.writerow(self._header)
|
|
|
|
csv_writer.writerow(self._header)
|
|
|
|
for row_data in self._result:
|
|
|
|
for row_data in self._result:
|
|
|
|
csv_writer.writerow(row_data)
|
|
|
|
csv_writer.writerow(row_data)
|
|
|
|
os.chmod(self._output_path, stat.S_IREAD)
|
|
|
|
os.chmod(self._output_path, stat.S_IRUSR)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class GpuStepTraceParser(BaseStepTraceParser):
|
|
|
|
class GpuStepTraceParser(BaseStepTraceParser):
|
|
|
@ -363,7 +363,7 @@ class GpuStepTraceParser(BaseStepTraceParser):
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
with open(output_path, 'w') as json_file:
|
|
|
|
with open(output_path, 'w') as json_file:
|
|
|
|
json.dump(points, json_file)
|
|
|
|
json.dump(points, json_file)
|
|
|
|
os.chmod(output_path, stat.S_IREAD)
|
|
|
|
os.chmod(output_path, stat.S_IRUSR)
|
|
|
|
except (IOError, OSError) as err:
|
|
|
|
except (IOError, OSError) as err:
|
|
|
|
log.warning('Failed to save point info. %s', err)
|
|
|
|
log.warning('Failed to save point info. %s', err)
|
|
|
|
raise ProfilerIOException
|
|
|
|
raise ProfilerIOException
|
|
|
@ -463,7 +463,7 @@ class AscendStepTraceParser(BaseStepTraceParser):
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
with open(output_path, 'w') as json_file:
|
|
|
|
with open(output_path, 'w') as json_file:
|
|
|
|
json.dump(points, json_file)
|
|
|
|
json.dump(points, json_file)
|
|
|
|
os.chmod(output_path, stat.S_IREAD)
|
|
|
|
os.chmod(output_path, stat.S_IRUSR)
|
|
|
|
except (IOError, OSError) as err:
|
|
|
|
except (IOError, OSError) as err:
|
|
|
|
log.warning('Failed to save point info. %s', err)
|
|
|
|
log.warning('Failed to save point info. %s', err)
|
|
|
|
raise ProfilerIOException
|
|
|
|
raise ProfilerIOException
|
|
|
|