Skip to content

Commit b5f3661

Browse files
pietos01-armmarcbonnici
authored andcommitted
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.
1 parent 4c8f243 commit b5f3661

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

devlib/trace/perf.py

+4
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,11 @@ def start(self):
104104
self.target.kick_off(command)
105105

106106
def stop(self):
107+
self.target.killall('perf', signal='SIGINT',
108+
as_root=self.target.is_rooted)
109+
# perf doesn't transmit the signal to its sleep call so handled here:
107110
self.target.killall('sleep', as_root=self.target.is_rooted)
111+
# NB: we hope that no other "important" sleep is on-going
108112

109113
# pylint: disable=arguments-differ
110114
def get_trace(self, outdir):

0 commit comments

Comments
 (0)