From 34e51e7230649638d11bb52511e3e2711d9485d4 Mon Sep 17 00:00:00 2001 From: Javi Merino Date: Mon, 26 Apr 2021 20:19:15 +0100 Subject: [PATCH] collector/perf: raise an error if report_options or report_sample_options are specified when not using perf/simpleperf record --- devlib/collector/perf.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/devlib/collector/perf.py b/devlib/collector/perf.py index 16ab9e6..b97419e 100644 --- a/devlib/collector/perf.py +++ b/devlib/collector/perf.py @@ -126,6 +126,10 @@ class PerfCollector(CollectorBase): self.command = command else: raise ValueError('Unsupported perf command, must be stat or record') + if report_options and (command != 'record'): + raise ValueError('report_options specified, but command is not record') + if report_sample_options and (command != 'record'): + raise ValueError('report_sample_options specified, but command is not record') self.binary = self.target.get_installed(self.perf_type) if self.force_install or not self.binary: