From: Maynard J. <may...@us...> - 2012-09-28 14:27:54
|
On 09/27/2012 04:08 PM, Carl E. Love wrote: > OProfile testsuite, fix perf kill command > > The operf user tool expects to get a kill -SIGINT signal. However > the SIGINT signal can not be sent from a script, it must come from > the command line. Hence the pkill -P command was used to kill the > parent and children processes. A bug was found in that the pkill > command kills operf without letting it completely finish the data > processing and exit cleanly. This issue actually was found when > testing a patch that is currently under development to check for > specific symbols. The kill -INT signal can be sent from the script > and is properly caught by operf. When operf catches the INT signal > it shuts down cleanly rather then exiting immediatly. This patch > fixes the current kill command to make sure operf exits cleanly. > > Signed-off-by: Carl Love <ce...@us...> > --- > testsuite/oprofile-operf/oprofile-operf-run.exp | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/testsuite/oprofile-operf/oprofile-operf-run.exp b/testsuite/oprofile-operf/oprofile-operf-run.exp > index 2e54ec7..bbb68f0 100644 > --- a/testsuite/oprofile-operf/oprofile-operf-run.exp > +++ b/testsuite/oprofile-operf/oprofile-operf-run.exp > @@ -94,7 +94,7 @@ proc do_test {ctrs} { > set filename "/tmp/operf_create_stop.zzzz" > set fileId [open $filename "w"] > puts $fileId "#!/bin/bash" > - puts $fileId "echo -n \"pkill -9 -P \" > /tmp/operf_stop.zzzz " > + puts $fileId "echo -n \"kill -s INT \" > /tmp/operf_stop.zzzz " Yes, this works much nicer to cleanly stop operf. Patch committed. Thanks! -Maynard > > # Get the process id to kill > puts $fileId "cat /tmp/operf_out.zzzz | grep \"kill\" | cut -d\"\'\" -f2 | cut -d\" \" -f3 >> /tmp/operf_stop.zzzz " |