aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSeongJae Park <sj38.park@gmail.com>2024-04-06 10:30:08 -0700
committerSeongJae Park <sj38.park@gmail.com>2024-04-06 10:30:08 -0700
commit0eb15256dc1fc9dc48779824d46e2c49798c0b73 (patch)
tree5442298d0b6a2f11e0ca58310f735ae2505da98e
parentfb0472fd863817feb949c80540b73e818f19693c (diff)
downloaddamo-0eb15256dc1fc9dc48779824d46e2c49798c0b73.tar.gz
_damo_records: Cleanup comments and layout
Signed-off-by: SeongJae Park <sj38.park@gmail.com>
-rw-r--r--_damo_records.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/_damo_records.py b/_damo_records.py
index 99487a36..bced6b4e 100644
--- a/_damo_records.py
+++ b/_damo_records.py
@@ -500,12 +500,6 @@ def update_records_file(file_path, file_format, file_permission=None,
# memory footprint recording
-
-def save_mem_footprint(snapshots, filepath, file_permission):
- with open(filepath, 'w') as f:
- json.dump([s.to_kvpairs() for s in snapshots], f, indent=4)
- os.chmod(filepath, file_permission)
-
# Meaning of the fileds of MemFootprint are as below.
#
# ======== =============================== ==============================
@@ -574,8 +568,12 @@ def record_mem_footprint(kdamonds, snapshots):
pids.append(target.pid)
snapshots.append(MemFootprintsSnapshot(pids))
+def save_mem_footprint(snapshots, filepath, file_permission):
+ with open(filepath, 'w') as f:
+ json.dump([s.to_kvpairs() for s in snapshots], f, indent=4)
+ os.chmod(filepath, file_permission)
-# for recording
+# record-polling
def pid_running(pid):
'''pid should be string'''
@@ -643,6 +641,8 @@ def poll_target_pids(handle):
record_mem_footprint(handle.kdamonds, handle.mem_footprint_snapshots)
return rc
+# for recording
+
class RecordingHandle:
file_path = None
file_format = None