aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSeongJae Park <sj@kernel.org>2024-04-27 11:12:15 -0700
committerSeongJae Park <sj@kernel.org>2024-04-27 11:12:15 -0700
commitf125ff62424becaf4728bcb9c3aac0ce47863c7e (patch)
treee88ab0e64b7dd426d8aee8270f90e4c89a2a7e61
parent0ab7e6c266f26e73fd94422ec3257481b6dedd2b (diff)
downloaddamo-f125ff62424becaf4728bcb9c3aac0ce47863c7e.tar.gz
_damo_records/poll_target_pids(): Receive required parameters only
Signed-off-by: SeongJae Park <sj@kernel.org>
-rw-r--r--_damo_records.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/_damo_records.py b/_damo_records.py
index a12eeda7..c2412f55 100644
--- a/_damo_records.py
+++ b/_damo_records.py
@@ -715,10 +715,10 @@ def __poll_target_pids(kdamonds, add_childs):
return False
return True
-def poll_target_pids(handle):
+def poll_target_pids(kdamonds, add_childs):
has_pid_target = False
- if handle.kdamonds:
- for kdamond in handle.kdamonds:
+ if kdamonds:
+ for kdamond in kdamonds:
for ctx in kdamond.contexts:
if _damon.target_has_pid(ctx.ops):
has_pid_target = True
@@ -727,7 +727,7 @@ def poll_target_pids(handle):
break
if has_pid_target is False:
return False
- return __poll_target_pids(handle.kdamonds, handle.poll_add_child_tasks)
+ return __poll_target_pids(kdamonds, add_childs)
# for recording
@@ -774,7 +774,8 @@ def start_recording(handle):
if handle.do_profile:
cmd = [PERF, 'record', '-o', '%s.profile' % handle.file_path]
handle.perf_profile_pipe = subprocess.Popen(cmd)
- while poll_target_pids(handle) or _damon.any_kdamond_running():
+ while (poll_target_pids(handle.kdamonds, handle.poll_add_child_tasks) or
+ _damon.any_kdamond_running()):
if handle.mem_footprint_snapshots is not None:
record_mem_footprint(handle.kdamonds,
handle.mem_footprint_snapshots)