From e2c5d826c0733e2224b5b1c64cc699734f75eead Mon Sep 17 00:00:00 2001 From: Patrick Bellasi Date: Mon, 28 Mar 2016 12:52:05 +0100 Subject: [PATCH 1/2] libs/utils/env: add N5X (bullhead) target support The bullhead kernel does not properly report big.LITTLE CPUs in the output of /proc/cpuinfo. However, since this is a well known device it is safe to provide a custom initialisation of the platform module for that target. This patch defineds the big.LITTLE layout of a Nexus 5X device which can be used by specifying: board = "n5x" in your TestEnv configuration file. Signed-off-by: Patrick Bellasi --- libs/utils/env.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libs/utils/env.py b/libs/utils/env.py index aafb9a6d3..3611530a2 100644 --- a/libs/utils/env.py +++ b/libs/utils/env.py @@ -349,6 +349,16 @@ class TestEnv(ShareState): platform = Platform(model='MT8173') self.__modules = ['bl', 'cpufreq'] + # Initialize N5X device + elif self.conf['board'].upper() == 'N5X': + platform = Platform(model='bullhead', + core_names = ['A53', 'A53', 'A53', 'A53', + 'A57', 'A57'], + core_clusters = [ 0, 0, 0, 0, 1, 1], + big_core = 'A57', + ) + self.__modules = ['bl', 'cpufreq'] + # Initialize default UNKNOWN board else: platform = None -- GitLab From 34f5d28c5ef4415709f75afcc636c37a210f4d02 Mon Sep 17 00:00:00 2001 From: Patrick Bellasi Date: Tue, 29 Mar 2016 10:57:33 +0100 Subject: [PATCH 2/2] libs/utils/trace: add support for systrace trace format TRAPpy provides now support for parsing events from a trace embedded into systrace, which are usually encapsulated into an HTML file. This patch allows to specify which format a trace is and, by default, it assumes that an HTML file contains a systrace format. Signed-off-by: Patrick Bellasi --- libs/utils/trace.py | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/libs/utils/trace.py b/libs/utils/trace.py index 8b1141bb5..961854a11 100644 --- a/libs/utils/trace.py +++ b/libs/utils/trace.py @@ -31,7 +31,9 @@ import logging class Trace(object): - def __init__(self, platform, datadir, events, tasks=None, window=(0,None)): + def __init__(self, platform, datadir, events, + tasks=None, window=(0,None), + trace_format='FTrace'): # The platform used to run the experiments self.platform = platform @@ -39,9 +41,12 @@ class Trace(object): # Folder containing all perf data self.datadir = None - # TRAPpy FTrace object + # TRAPpy Trace object self.ftrace = None + # Trace format + self.trace_format = trace_format + # The time window used to limit trace parsing to self.window = window @@ -71,7 +76,7 @@ class Trace(object): self.datadir = datadir self.__registerTraceEvents(events) - self.__parseTrace(datadir, tasks, window) + self.__parseTrace(datadir, tasks, window, trace_format) self.__computeTimeSpan() def __registerTraceEvents(self, events): @@ -84,10 +89,21 @@ class Trace(object): raise ValueError('Events must be a string or a list of strings') - def __parseTrace(self, path, tasks, window): + def __parseTrace(self, path, tasks, window, trace_format): logging.debug('Loading [sched] events from trace in [%s]...', path) logging.debug("Parsing events: %s", self.events) - self.ftrace = trappy.FTrace(path, scope="custom", events=self.events, window=window) + if trace_format.upper() == 'SYSTRACE' or path.endswith('html'): + logging.info('Parsing SysTrace format...') + self.ftrace = trappy.SysTrace(path, scope="custom", + events=self.events, + window=window) + self.trace_format = 'SysTrace' + elif trace_format.upper() == 'FTRACE': + logging.info('Parsing FTrace format...') + self.ftrace = trappy.FTrace(path, scope="custom", + events=self.events, + window=window) + self.trace_format = 'FTrace' # Check for events available on the parsed trace self.__checkAvailableEvents() @@ -107,8 +123,8 @@ class Trace(object): self.__loadTasksNames(tasks) - def __checkAvailableEvents(self): - for val in trappy.FTrace.get_filters(self.ftrace): + def __checkAvailableEvents(self, key=""): + for val in self.ftrace.get_filters(key): obj = getattr(self.ftrace, val) if len(obj.data_frame): self.available_events.append(val) -- GitLab