Skip to content

Commit

Permalink
trace/perf: Soften POSIX signal for termination
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
pietos01-arm authored and marcbonnici committed May 15, 2019
1 parent 4c8f243 commit b5f3661
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions devlib/trace/perf.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,11 @@ def start(self):
self.target.kick_off(command)

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)
# NB: we hope that no other "important" sleep is on-going

# pylint: disable=arguments-differ
def get_trace(self, outdir):
Expand Down

0 comments on commit b5f3661

Please sign in to comment.