aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSeongJae Park <sj@kernel.org>2024-04-14 08:46:34 -0700
committerSeongJae Park <sj@kernel.org>2024-04-14 08:46:34 -0700
commit1ba1e664b67fbc6578634a63da2b749ae514e54b (patch)
treedf2f24310aa6708fc2b2f6330b6436ab89be2a35
parent74b975820aac98c0b3ebff8580ab9ff1dd44a8c2 (diff)
downloaddamo-1ba1e664b67fbc6578634a63da2b749ae514e54b.tar.gz
_damo_records.poll_target_pids(): Return False if there's no real thing to do
__poll_target_pids() is for both adding child processes to targets and checking if the target processes are terminated. However, the target processes termination check is done by waiting for kdamonds termination. Skip unnecessary work if not requested. Signed-off-by: SeongJae Park <sj@kernel.org>
-rw-r--r--_damo_records.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/_damo_records.py b/_damo_records.py
index 16c3cba6..9bd8d653 100644
--- a/_damo_records.py
+++ b/_damo_records.py
@@ -636,6 +636,9 @@ def __poll_target_pids(handle):
return True
def poll_target_pids(handle):
+ if (not handle.poll_add_child_tasks and
+ handle.mem_footprint_snapshots is None):
+ return False
rc = __poll_target_pids(handle)
if rc is True and handle.mem_footprint_snapshots is not None:
record_mem_footprint(handle.kdamonds, handle.mem_footprint_snapshots)