From 43cb80d854662ac64a40108cc8a8f8f4d3811984 Mon Sep 17 00:00:00 2001 From: Javi Merino Date: Mon, 26 Apr 2021 16:17:39 +0100 Subject: [PATCH] perf: support report-sample devlib learnt to use report-sample in ARM-software/devlib@fe2fe3ae0470 ("collector/perf: run simpleperf report-sample in the target if requested"). Adapt the perf instrument to use the new parameters of the PerfCollector. --- wa/instruments/perf.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/wa/instruments/perf.py b/wa/instruments/perf.py index 3e1bb95f..fd49e190 100644 --- a/wa/instruments/perf.py +++ b/wa/instruments/perf.py @@ -95,6 +95,11 @@ class PerfInstrument(Instrument): description="""Specifies options to be used to gather report when record command is used. It's highly recommended to use perf_type simpleperf when running on android devices as reporting options are unstable with perf"""), + Parameter('run_report_sample', kind=bool, default=False, description="""If true, run + 'perf/simpleperf report-sample'. It only works with the record command."""), + Parameter('report_sample_options', kind=str, default=None, + description="""Specifies options to pass to report-samples when run_report_sample + is true."""), Parameter('labels', kind=list_of_strs, default=None, global_alias='perf_labels', description="""Provides labels for perf/simpleperf output for each optionstring. @@ -112,12 +117,17 @@ class PerfInstrument(Instrument): self.outdir = None def initialize(self, context): + if self.report_sample_options: + self.run_report_sample = True + self.collector = PerfCollector(self.target, self.perf_type, self.command, self.events, self.optionstring, self.report_option_string, + self.run_report_sample, + self.report_sample_options, self.labels, self.force_install)