mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-02-22 04:49:00 +00:00
commit
b1f607ef70
@ -233,6 +233,8 @@ class TraceCmdInstrument(Instrument):
|
|||||||
# Therefore timout for the pull command must also be adjusted
|
# Therefore timout for the pull command must also be adjusted
|
||||||
# accordingly.
|
# accordingly.
|
||||||
self._pull_timeout = (self.stop_time - self.start_time) # pylint: disable=attribute-defined-outside-init
|
self._pull_timeout = (self.stop_time - self.start_time) # pylint: disable=attribute-defined-outside-init
|
||||||
|
if self._pull_timeout < 60:
|
||||||
|
self._pull_timeout = 60
|
||||||
self.device.pull_file(self.output_file, context.output_directory, timeout=self._pull_timeout)
|
self.device.pull_file(self.output_file, context.output_directory, timeout=self._pull_timeout)
|
||||||
context.add_iteration_artifact('bintrace', OUTPUT_TRACE_FILE, kind='data',
|
context.add_iteration_artifact('bintrace', OUTPUT_TRACE_FILE, kind='data',
|
||||||
description='trace-cmd generated ftrace dump.')
|
description='trace-cmd generated ftrace dump.')
|
||||||
|
@ -173,6 +173,24 @@ def regex_body_parser(regex, flags=0):
|
|||||||
return regex_parser_func
|
return regex_parser_func
|
||||||
|
|
||||||
|
|
||||||
|
def sched_switch_parser(event, text):
|
||||||
|
"""
|
||||||
|
Sched switch output may be presented in a couple of different formats. One is handled
|
||||||
|
by a regex. The other format can *almost* be handled by the default parser, if it
|
||||||
|
weren't for the ``==>`` that appears in the middle.
|
||||||
|
"""
|
||||||
|
if text.count('=') == 2: # old format
|
||||||
|
regex = re.compile(
|
||||||
|
r'(?P<prev_comm>\S.*):(?P<prev_pid>\d+) \[(?P<prev_prio>\d+)\] (?P<status>\S+)'
|
||||||
|
r' ==> '
|
||||||
|
r'(?P<next_comm>\S.*):(?P<next_pid>\d+) \[(?P<next_prio>\d+)\]'
|
||||||
|
)
|
||||||
|
parser_func = regex_body_parser(regex)
|
||||||
|
return parser_func(event, text)
|
||||||
|
else: # there are more than two "=" -- new format
|
||||||
|
return default_body_parser(event, text.replace('==>', ''))
|
||||||
|
|
||||||
|
|
||||||
# Maps event onto the corresponding parser for its body text. A parser may be
|
# Maps event onto the corresponding parser for its body text. A parser may be
|
||||||
# a callable with signature
|
# a callable with signature
|
||||||
#
|
#
|
||||||
@ -182,11 +200,7 @@ def regex_body_parser(regex, flags=0):
|
|||||||
# regex). In case of a string/regex, its named groups will be used to populate
|
# regex). In case of a string/regex, its named groups will be used to populate
|
||||||
# the event's attributes.
|
# the event's attributes.
|
||||||
EVENT_PARSER_MAP = {
|
EVENT_PARSER_MAP = {
|
||||||
'sched_switch': re.compile(
|
'sched_switch': sched_switch_parser,
|
||||||
r'(?P<prev_comm>\S.*):(?P<prev_pid>\d+) \[(?P<prev_prio>\d+)\] (?P<status>\S+)'
|
|
||||||
r' ==> '
|
|
||||||
r'(?P<next_comm>\S.*):(?P<next_pid>\d+) \[(?P<next_prio>\d+)\]'
|
|
||||||
),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TRACE_EVENT_REGEX = re.compile(r'^\s+(?P<thread>\S+.*?\S+)\s+\[(?P<cpu_id>\d+)\]\s+(?P<ts>[\d.]+):\s+'
|
TRACE_EVENT_REGEX = re.compile(r'^\s+(?P<thread>\S+.*?\S+)\s+\[(?P<cpu_id>\d+)\]\s+(?P<ts>[\d.]+):\s+'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user