> On April 2, 2015, 5:24 p.m., Ian Downes wrote: > > src/linux/perf.cpp, line 188 > > <https://reviews.apache.org/r/32699/diff/1/?file=911392#file911392line188> > > > > I thought about this again, and it won't be sufficient for perf: we use > > perf with a child sleep process to control the sample duration, e.g., "perf > > stat -a --event cycles -- sleep 123", and killing perf does not kill the > > sleep process. I tested this in a shell so it may not be identical > > behavior, but DEATHSIG is not preserved across a fork so it likely is the > > same. > > > > {noformat} > > [idownes@hostname ~]$ sudo perf stat -a --event cycles -- sleep 123 > > ... different shell ... > > [idownes@hostname ~]$ pgrep sleep | xargs ps > > PID TTY STAT TIME COMMAND > > 57461 pts/0 S+ 0:00 sleep 123 > > [idownes@hostname ~]$ sudo pkill perf > > [idownes@hostname ~]$ pgrep sleep | xargs ps > > PID TTY STAT TIME COMMAND > > 57461 pts/0 S 0:00 sleep 123 > > {noformat} > > > > This does not apply to the `du` usecase which is a single process. > > > > What *may* work for perf, but is not clearly documented in the prctl > > manpage, is to run the processes in a process group and use -SIGKILL as the > > DEATHSIG. Depending on how this was implemented, this might signal the > > entire process group?
I checked the kernel code. This won't work. ::kill(-pid, SIGKILL) is the one that kill a process group (not ::kill(pid, -SIGKILL) :)) - Jie ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/32699/#review78678 ----------------------------------------------------------- On March 31, 2015, 8:14 p.m., Jie Yu wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/32699/ > ----------------------------------------------------------- > > (Updated March 31, 2015, 8:14 p.m.) > > > Review request for mesos, Ben Mahler, Ian Downes, and Vinod Kone. > > > Bugs: MESOS-2462 > https://issues.apache.org/jira/browse/MESOS-2462 > > > Repository: mesos > > > Description > ------- > > Set death signal for the perf subprocess. > > > Diffs > ----- > > src/linux/perf.cpp 863aa4a972289a59f57e93cd06ba2bf9df949fe2 > > Diff: https://reviews.apache.org/r/32699/diff/ > > > Testing > ------- > > sudo make check > > > Thanks, > > Jie Yu > >