aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSeongJae Park <sj38.park@gmail.com>2024-04-06 10:36:19 -0700
committerSeongJae Park <sj38.park@gmail.com>2024-04-06 10:36:19 -0700
commitf8ce8267703f83c3a8235fc103340e01e3a90fba (patch)
tree22fe02abdad1f08340e861430608d95cfdc1f722
parent37e1286ea8b36b99db0aca42744669ef2b4a1ec3 (diff)
downloaddamo-f8ce8267703f83c3a8235fc103340e01e3a90fba.tar.gz
_damo_records/finish_recording(): Handle memory footrpint while profile is none
Signed-off-by: SeongJae Park <sj38.park@gmail.com>
-rw-r--r--_damo_records.py16
1 files changed, 7 insertions, 9 deletions
diff --git a/_damo_records.py b/_damo_records.py
index 4c39fa0c..16c3cba6 100644
--- a/_damo_records.py
+++ b/_damo_records.py
@@ -709,15 +709,13 @@ def finish_recording(handle):
print('converting format from perf_data to %s failed (%s)' %
(handle.file_format, err))
- if handle.perf_profile_pipe is None:
- return
-
- try:
- handle.perf_profile_pipe.send_signal(signal.SIGINT)
- except:
- # perf might already finished
- pass
- os.chmod('%s.profile' % handle.file_path, handle.file_permission)
+ if handle.perf_profile_pipe is not None:
+ try:
+ handle.perf_profile_pipe.send_signal(signal.SIGINT)
+ except:
+ # perf might already finished
+ pass
+ os.chmod('%s.profile' % handle.file_path, handle.file_permission)
if handle.mem_footprint_snapshots is not None:
save_mem_footprint(