aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSeongJae Park <sj38.park@gmail.com>2024-04-06 09:45:46 -0700
committerSeongJae Park <sj38.park@gmail.com>2024-04-06 09:45:46 -0700
commit9e84be7f490f58571eb9f601906540293df358e4 (patch)
tree4e840a0d2ae9d07733d4e2fbff8c2d7456256848
parent8265ce5386587877e765a2b4eab0eae877cbee55 (diff)
downloaddamo-9e84be7f490f58571eb9f601906540293df358e4.tar.gz
damo_record: Move memory footprints saving to _damo_records
Signed-off-by: SeongJae Park <sj38.park@gmail.com>
-rw-r--r--_damo_records.py7
-rw-r--r--damo_record.py9
2 files changed, 8 insertions, 8 deletions
diff --git a/_damo_records.py b/_damo_records.py
index a60fa89e..f9dd3ee3 100644
--- a/_damo_records.py
+++ b/_damo_records.py
@@ -614,7 +614,7 @@ def start_recording(tracepoint, file_path, file_format, file_permission,
return RecordingHandle(file_path, file_format, file_permission,
monitoring_intervals, pipe, profile_pipe)
-def finish_recording(handle):
+def finish_recording(handle, mem_footprint_snapshots):
try:
handle.perf_pipe.send_signal(signal.SIGINT)
handle.perf_pipe.wait()
@@ -642,6 +642,11 @@ def finish_recording(handle):
pass
os.chmod('%s.profile' % handle.file_path, handle.file_permission)
+ if mem_footprint_snapshots is not None:
+ save_mem_footprint(
+ mem_footprint_snapshots, '%s.mem_footprint' % handle.file_path,
+ handle.file_permission)
+
# for snapshot
def find_install_scheme(scheme_to_find):
diff --git a/damo_record.py b/damo_record.py
index c7aa6511..a174ed2b 100644
--- a/damo_record.py
+++ b/damo_record.py
@@ -37,13 +37,8 @@ def cleanup_exit(exit_code):
print('failed restoring previous kdamonds setup (%s)' % err)
if data_for_cleanup.record_handle:
- _damo_records.finish_recording(data_for_cleanup.record_handle)
-
- if data_for_cleanup.footprint_snapshots is not None:
- _damo_records.save_mem_footprint(
- data_for_cleanup.footprint_snapshots, '%s.mem_footprint' %
- data_for_cleanup.record_handle.file_path,
- data_for_cleanup.record_handle.file_permission)
+ _damo_records.finish_recording(data_for_cleanup.record_handle,
+ data_for_cleanup.footprint_snapshots)
exit(exit_code)