From 3472ad9612fc3dc2b24414a32ca9abc125539bfe Mon Sep 17 00:00:00 2001 From: Patrick Bellasi Date: Mon, 21 Mar 2016 12:50:11 +0000 Subject: [PATCH 1/2] libs/wlgen/workload: allows FTrace collection also when running in background When a workload is started in background we do not currently properly support the collection of FTrace. An FTrace collection is started but actually not stopped from the WlGen class. This patch allows to start an FTrace collection even when the task runs in background. To achieve that goal we need however to specify a suitable value for end_pause_s, which will be used to define for how long to trace the system while the application is running in background. Signed-off-by: Patrick Bellasi --- libs/wlgen/wlgen/workload.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/libs/wlgen/wlgen/workload.py b/libs/wlgen/wlgen/workload.py index 79de745e8..f5ddfef54 100644 --- a/libs/wlgen/wlgen/workload.py +++ b/libs/wlgen/wlgen/workload.py @@ -227,16 +227,19 @@ class Workload(object): if background: logging.debug('%14s - WlGen [background]: %s', 'WlGen', self.command) self.target.background(self.command, as_root=as_root) - return + self.output['executor'] = '' + + # Start task in foreground + else: - logging.info('%14s - Workload execution START:', 'WlGen') - logging.info('%14s - %s', 'WlGen', self.command) + logging.info('%14s - Workload execution START:', 'WlGen') + 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) - # print type(results) - self.output['executor'] = results + # Run command and wait for it to complete + results = self.target.execute(self.command, + timeout=None, as_root=as_root) + # print type(results) + self.output['executor'] = results # Wait `end_pause` seconds before stopping ftrace if end_pause_s: -- GitLab From c83009d8fc9cf1d836728b6b225eda3a18414e34 Mon Sep 17 00:00:00 2001 From: Patrick Bellasi Date: Mon, 21 Mar 2016 12:52:17 +0000 Subject: [PATCH 2/2] libs/wlgen/workload: fix background execution when CGroups are in use When running into a CGroup, background tasks execution seems to be broken. This patch switches to the usage of a different devlib API to kickoff a background execution for a task which seems to be more robust when CGroup are in use. Signed-off-by: Patrick Bellasi --- libs/wlgen/wlgen/workload.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/wlgen/wlgen/workload.py b/libs/wlgen/wlgen/workload.py index f5ddfef54..5ef334826 100644 --- a/libs/wlgen/wlgen/workload.py +++ b/libs/wlgen/wlgen/workload.py @@ -226,7 +226,7 @@ class Workload(object): # Start task in background if required if background: logging.debug('%14s - WlGen [background]: %s', 'WlGen', self.command) - self.target.background(self.command, as_root=as_root) + self.target.kick_off(self.command, as_root=as_root) self.output['executor'] = '' # Start task in foreground -- GitLab