From d29f658e7b8ec6f30414a65f71fce8528833395a Mon Sep 17 00:00:00 2001 From: Patrick Bellasi Date: Tue, 26 Apr 2016 16:42:56 +0100 Subject: [PATCH 1/2] libs/wlgen/workload: use shutils to sandbox a task into a CGroup When running a workload into a CGroup, we can use the new utility function cgroup_run_into() introduced by the recent update of devlib::shutils. Signed-off-by: Patrick Bellasi --- libs/wlgen/wlgen/workload.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/libs/wlgen/wlgen/workload.py b/libs/wlgen/wlgen/workload.py index 5ef334826..a93155bea 100644 --- a/libs/wlgen/wlgen/workload.py +++ b/libs/wlgen/wlgen/workload.py @@ -207,7 +207,7 @@ class Workload(object): # Prepend eventually required taskset command if self.cgroup and self.cgroup_cmd == '': - self.cgroup_cmd = '{0:s}/cgroup_run_into.sh {1:s}'\ + self.cgroup_cmd = 'cgroups_run_into {1:s}'\ .format(self.target.executables_directory, self.cgroup) self.command = '{0:s} \'{1:s}\''\ @@ -236,8 +236,12 @@ class Workload(object): logging.info('%14s - %s', 'WlGen', self.command) # Run command and wait for it to complete - results = self.target.execute(self.command, - timeout=None, as_root=as_root) + if cgroup: + results = self.target._execute_util(self.command, + as_root=True) + else: + results = self.target.execute(self.command, + timeout=None, as_root=as_root) # print type(results) self.output['executor'] = results -- GitLab From 81f8b13c6ab163bd9471090ecef0d2dc21a0615d Mon Sep 17 00:00:00 2001 From: Patrick Bellasi Date: Thu, 28 Apr 2016 15:14:08 +0100 Subject: [PATCH 2/2] submodules/devlib: pull updates on cgroups API Adds improved support for CGroups API and other fixes. Signed-off-by: Patrick Bellasi --- libs/devlib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/devlib b/libs/devlib index 741157c00..1dc1e1364 160000 --- a/libs/devlib +++ b/libs/devlib @@ -1 +1 @@ -Subproject commit 741157c0001d8aa6ae39115024398ce1cd9f1c0a +Subproject commit 1dc1e1364c205b4814e664b521f54ec07e446d9d -- GitLab