From 0d259be01bc5fd973ba846578e562641548582e6 Mon Sep 17 00:00:00 2001 From: Javi Merino Date: Mon, 1 Feb 2021 17:52:02 +0000 Subject: [PATCH] collector/perf: Run perf as root if the target is rooted If you want to collect events by event id (eg. in simpleperf, "rNNN" with NNN a number), you must run it as root. Otherwise, simpleperf fails with a SIGABRT. Run simpleperf as root by default if the target is rooted to avoid this. --- devlib/collector/perf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devlib/collector/perf.py b/devlib/collector/perf.py index 88a5695..1599963 100644 --- a/devlib/collector/perf.py +++ b/devlib/collector/perf.py @@ -141,7 +141,7 @@ class PerfCollector(CollectorBase): def start(self): for command in self.commands: - self.target.kick_off(command) + self.target.kick_off(command, as_root=self.target.is_rooted) def stop(self): self.target.killall(self.perf_type, signal='SIGINT',