1
0
mirror of https://github.com/ARM-software/devlib.git synced 2025-01-31 10:10:46 +00:00

trace/perf: Soften POSIX signal for termination

Replace the default SIGKILL signal sent to perf to "request" its
termination by a SIGINT, allowing it to handle the signal by cleaning up
before exit. This should address issues regarding corrupted perf.data
output files.
This commit is contained in:
Pierre-Clément Tosi 2019-05-03 11:37:45 +01:00 committed by Marc Bonnici
parent 4c8f2430e2
commit b5f36610ad

View File

@ -104,7 +104,11 @@ class PerfCollector(TraceCollector):
self.target.kick_off(command) self.target.kick_off(command)
def stop(self): def stop(self):
self.target.killall('perf', signal='SIGINT',
as_root=self.target.is_rooted)
# perf doesn't transmit the signal to its sleep call so handled here:
self.target.killall('sleep', as_root=self.target.is_rooted) self.target.killall('sleep', as_root=self.target.is_rooted)
# NB: we hope that no other "important" sleep is on-going
# pylint: disable=arguments-differ # pylint: disable=arguments-differ
def get_trace(self, outdir): def get_trace(self, outdir):