From 47622cfac2a29ae40229e61a65017e91ec21f45c Mon Sep 17 00:00:00 2001 From: Elieva Pignat Date: Mon, 26 Feb 2018 11:28:46 +0000 Subject: [PATCH] Loadtracking.py: Cgroups test userspace freezing update The class _PELTTaskGroupsTest(LisaTest) has been updated to freeze the userspace as expected by the new syntax. Namely, the userspace is freezed in a "with" statement to catch error and unfreeze correctly in this case. Signed-off-by: Elieva Pignat --- tests/eas/load_tracking.py | 43 +++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 24 deletions(-) diff --git a/tests/eas/load_tracking.py b/tests/eas/load_tracking.py index 379aada1d..d73a0710f 100644 --- a/tests/eas/load_tracking.py +++ b/tests/eas/load_tracking.py @@ -972,30 +972,25 @@ class _PELTTaskGroupsTest(LisaTest): # Freeze userspace tasks cls._log.info('Freezing userspace tasks') - te.target.cgroups.freeze(Executor.critical_tasks[te.target.os]) - - cls._log.info('FTrace events collection enabled') - te.ftrace.start() - - # Run tasks - cls._log.info('Running the tasks') - # Run all tasks in background and wait for completion - for se in cls.root_group.iter_nodes(): - if se.is_task: - # Run tasks - se.wload.run(out_dir=test_dir, cpus=se.cpus, - cgroup=se.parent.name, background=True) - sleep(max_duration) - - te.ftrace.stop() - - trace_file = os.path.join(test_dir, 'trace.dat') - te.ftrace.get_trace(trace_file) - cls._log.info('Collected FTrace binary trace: %s', trace_file) - - # Un-freeze userspace tasks - cls._log.info('Un-freezing userspace tasks') - te.target.cgroups.freeze(thaw=True) + with te.freeze_userspace(): + cls._log.info('FTrace events collection enabled') + te.ftrace.start() + + # Run tasks + cls._log.info('Running the tasks') + # Run all tasks in background and wait for completion + for se in cls.root_group.iter_nodes(): + if se.is_task: + # Run tasks + se.wload.run(out_dir=test_dir, cpus=se.cpus, + cgroup=se.parent.name, background=True) + sleep(max_duration) + + te.ftrace.stop() + + trace_file = os.path.join(test_dir, 'trace.dat') + te.ftrace.get_trace(trace_file) + cls._log.info('Collected FTrace binary trace: %s', trace_file) # Extract trace cls.trace = Trace(None, test_dir, te.ftrace.events) -- GitLab