Re: [PATCH] perf: prevent kill(0, SIGTERM);

Arnaldo Carvalho de Melo
2010-06-17T20:21:00Z

Em Wed, Jun 09, 2010 at 06:38:00PM +1000, Ian Munsie escreveu:
> At exit, perf record will kill the process it was profiling by sending a
> SIGTERM to child_pid (if it had been initialised), but in certain
> situations child_pid may be 0 and perf would mistakenly kill more
> processes than intended.
>
> child_pid is set to the return of fork() to either 0 or the pid of the
> child. Ordinarily this would not present an issue as the child calls
> execvp to spawn the process to be profilled and would therefore never
> run it's sig_atexit and never attempt to kill pid 0.

before:

[root@emilia mingo]# perf record bla
bla: No such file or directory
Terminated

after:

[root@emilia mingo]# perf record bla
bla: No such file or directory
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.006 MB perf.data (~259 samples) ]
[root@emilia mingo]#

Got it, queuing it in perf/urgent,

Thanks!

- Arnaldo