From 8a48820deabf1c6f8e04a0fc0280a8cba65822fe Mon Sep 17 00:00:00 2001 From: Patrick Bellasi Date: Wed, 14 Dec 2016 11:32:16 +0000 Subject: [PATCH 1/2] wlgen/rta: fix exception on ulimit failures If for any case the ulimit command should fails than we throw an exception which can be avoided by just assuming a safe default for max_rtprio. Signed-off-by: Patrick Bellasi --- libs/wlgen/wlgen/rta.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libs/wlgen/wlgen/rta.py b/libs/wlgen/wlgen/rta.py index e779e8345..14200d0b2 100644 --- a/libs/wlgen/wlgen/rta.py +++ b/libs/wlgen/wlgen/rta.py @@ -90,7 +90,11 @@ class RTA(Workload): log.info('CPU%d calibration...', cpu) - max_rtprio = int(target.execute('ulimit -Hr').split('\r')[0]) + try: + ulimit = target.execute('ulimit -Hr') + max_rtprio = int(ulimit.split('\r')[0]) + except TargetError: + max_rtprio = 0 log.debug('Max RT prio: %d', max_rtprio) if max_rtprio > 10: max_rtprio = 10 -- GitLab From 0381e3c35fd4a3d38753458b80f385772fa11a92 Mon Sep 17 00:00:00 2001 From: Patrick Bellasi Date: Wed, 14 Dec 2016 11:37:11 +0000 Subject: [PATCH 2/2] utils/env: fix cpufreq initialization on x86 platforms Since Intel platforms do not expose the list of OPPs we can safely empty initialise the list of cluster frequencies. This should allow to properly initialise cpufreq on these platforms as well. Signed-off-by: Patrick Bellasi --- libs/utils/env.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/libs/utils/env.py b/libs/utils/env.py index bed90ee7d..e64b4c6f6 100644 --- a/libs/utils/env.py +++ b/libs/utils/env.py @@ -31,6 +31,7 @@ from wlgen import RTA from energy import EnergyMeter from conf import JsonConf +from devlib import TargetError from devlib.utils.misc import memoized from trappy.stats.Topology import Topology @@ -603,8 +604,13 @@ class TestEnv(ShareState): # Try loading frequencies using the cpufreq module for cluster_id in self.platform['clusters']: core_id = self.platform['clusters'][cluster_id][0] - self.platform['freqs'][cluster_id] = \ - self.target.cpufreq.list_frequencies(core_id) + try: + self.platform['freqs'][cluster_id] = \ + self.target.cpufreq.list_frequencies(core_id) + except TargetError: + # Intel plataforms do not expose the list of OPPs, + # thus let's just keep this list empty initialized. + self.platform['freqs'][cluster_id] = [] else: self._log.warning('Unable to identify cluster frequencies') -- GitLab