1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-01-31 18:21:14 +00:00

perf: updating binaries and adding option to force install

This commit is contained in:
Sergei Trofimov 2015-06-26 14:19:15 +01:00
parent 85c78e6566
commit d6cebc46ce
3 changed files with 9 additions and 3 deletions

View File

@ -84,12 +84,18 @@ class PerfInstrument(Instrument):
description="""Provides labels for pref output. If specified, the number of description="""Provides labels for pref output. If specified, the number of
labels must match the number of ``optionstring``\ s. labels must match the number of ``optionstring``\ s.
"""), """),
Parameter('force_install', kind=bool, default=False,
description="""
always install perf binary even if perf is already present on the device.
"""),
] ]
def on_run_init(self, context): def on_run_init(self, context):
if not self.device.is_installed('perf'): if not self.device.is_installed('perf') or self.force_install:
binary = context.resolver.get(Executable(self, self.device.abi, 'perf')) binary = context.resolver.get(Executable(self, self.device.abi, 'perf'))
self.device.install(binary) self.binary = self.device.install(binary)
else:
self.binary = 'perf'
self.commands = self._build_commands() self.commands = self._build_commands()
def setup(self, context): def setup(self, context):
@ -161,7 +167,7 @@ class PerfInstrument(Instrument):
def _build_perf_command(self, options, events, label): def _build_perf_command(self, options, events, label):
event_string = ' '.join(['-e {}'.format(e) for e in events]) event_string = ' '.join(['-e {}'.format(e) for e in events])
command = PERF_COMMAND_TEMPLATE.format('perf', command = PERF_COMMAND_TEMPLATE.format(self.binary,
options or '', options or '',
event_string, event_string,
self._get_device_outfile(label)) self._get_device_outfile(label))