devlib icon indicating copy to clipboard operation
devlib copied to clipboard

Perf collector indiscriminately kills processes

Open douglas-raillard-arm opened this issue 8 months ago • 1 comments

The PerfCollector class uses the following pattern:

    def reset(self):
        self.target.killall(self.perf_type, as_root=self.target.is_rooted)

This is not great as self.perf_type can be set to perf, so the class ends up indiscriminately killing all perf processes on the system, possibly as root. This is not a very good neighborly behavior. Instead, it should spawn a process (e.g. with Target.background()) and kill that process specifically, without interfering with resources it does not own.

douglas-raillard-arm avatar May 20 '25 16:05 douglas-raillard-arm