Re: [PATCH v3 2/3] perf record: Propagate exit status of a command line workload

2014-05-08 Thread Namhyung Kim
Hi Peter, On Wed, 7 May 2014 19:35:32 +0200, Peter Zijlstra wrote: > On Wed, May 07, 2014 at 07:19:14PM +0200, Stephane Eranian wrote: >> > $ while :; do ./foo /bin/sleep 5 ; done >> > >> > and try and break out using ^C >> > >> What I usually do here is hit ^Z, then kill the job. >> But I agree

Re: [PATCH v3 2/3] perf record: Propagate exit status of a command line workload

2014-05-08 Thread Namhyung Kim
Hi Peter, On Wed, 7 May 2014 19:35:32 +0200, Peter Zijlstra wrote: On Wed, May 07, 2014 at 07:19:14PM +0200, Stephane Eranian wrote: $ while :; do ./foo /bin/sleep 5 ; done and try and break out using ^C What I usually do here is hit ^Z, then kill the job. But I agree it would be nicer

Re: [PATCH v3 2/3] perf record: Propagate exit status of a command line workload

2014-05-07 Thread Peter Zijlstra
On Wed, May 07, 2014 at 07:19:14PM +0200, Stephane Eranian wrote: > > $ while :; do ./foo /bin/sleep 5 ; done > > > > and try and break out using ^C > > > What I usually do here is hit ^Z, then kill the job. > But I agree it would be nicer to handle this case automatically. So that used to work.

Re: [PATCH v3 2/3] perf record: Propagate exit status of a command line workload

2014-05-07 Thread Stephane Eranian
On Wed, May 7, 2014 at 5:04 PM, Peter Zijlstra wrote: > On Wed, Apr 30, 2014 at 09:24:08AM +0900, Namhyung Kim wrote: >> Hi Jiri and Peter, >> >> On Tue, 29 Apr 2014 13:37:47 +0200, Jiri Olsa wrote: >> > On Tue, Apr 29, 2014 at 01:19:39PM +0200, Peter Zijlstra wrote: >> >> On Tue, Apr 29, 2014 at

Re: [PATCH v3 2/3] perf record: Propagate exit status of a command line workload

2014-05-07 Thread Jiri Olsa
On Wed, Apr 30, 2014 at 09:24:08AM +0900, Namhyung Kim wrote: > Hi Jiri and Peter, > > On Tue, 29 Apr 2014 13:37:47 +0200, Jiri Olsa wrote: > > On Tue, Apr 29, 2014 at 01:19:39PM +0200, Peter Zijlstra wrote: > >> On Tue, Apr 29, 2014 at 12:56:54PM +0200, Jiri Olsa wrote: > >> > > >> >

Re: [PATCH v3 2/3] perf record: Propagate exit status of a command line workload

2014-05-07 Thread Peter Zijlstra
On Wed, Apr 30, 2014 at 09:24:08AM +0900, Namhyung Kim wrote: > Hi Jiri and Peter, > > On Tue, 29 Apr 2014 13:37:47 +0200, Jiri Olsa wrote: > > On Tue, Apr 29, 2014 at 01:19:39PM +0200, Peter Zijlstra wrote: > >> On Tue, Apr 29, 2014 at 12:56:54PM +0200, Jiri Olsa wrote: > >> > > >> >

Re: [PATCH v3 2/3] perf record: Propagate exit status of a command line workload

2014-05-07 Thread Peter Zijlstra
On Wed, Apr 30, 2014 at 09:24:08AM +0900, Namhyung Kim wrote: Hi Jiri and Peter, On Tue, 29 Apr 2014 13:37:47 +0200, Jiri Olsa wrote: On Tue, Apr 29, 2014 at 01:19:39PM +0200, Peter Zijlstra wrote: On Tue, Apr 29, 2014 at 12:56:54PM +0200, Jiri Olsa wrote: perf_counter tools:

Re: [PATCH v3 2/3] perf record: Propagate exit status of a command line workload

2014-05-07 Thread Jiri Olsa
On Wed, Apr 30, 2014 at 09:24:08AM +0900, Namhyung Kim wrote: Hi Jiri and Peter, On Tue, 29 Apr 2014 13:37:47 +0200, Jiri Olsa wrote: On Tue, Apr 29, 2014 at 01:19:39PM +0200, Peter Zijlstra wrote: On Tue, Apr 29, 2014 at 12:56:54PM +0200, Jiri Olsa wrote: perf_counter tools:

Re: [PATCH v3 2/3] perf record: Propagate exit status of a command line workload

2014-05-07 Thread Stephane Eranian
On Wed, May 7, 2014 at 5:04 PM, Peter Zijlstra pet...@infradead.org wrote: On Wed, Apr 30, 2014 at 09:24:08AM +0900, Namhyung Kim wrote: Hi Jiri and Peter, On Tue, 29 Apr 2014 13:37:47 +0200, Jiri Olsa wrote: On Tue, Apr 29, 2014 at 01:19:39PM +0200, Peter Zijlstra wrote: On Tue, Apr 29,

Re: [PATCH v3 2/3] perf record: Propagate exit status of a command line workload

2014-05-07 Thread Peter Zijlstra
On Wed, May 07, 2014 at 07:19:14PM +0200, Stephane Eranian wrote: $ while :; do ./foo /bin/sleep 5 ; done and try and break out using ^C What I usually do here is hit ^Z, then kill the job. But I agree it would be nicer to handle this case automatically. So that used to work. And note

Re: [PATCH v3 2/3] perf record: Propagate exit status of a command line workload

2014-04-29 Thread Namhyung Kim
Hi Jiri and Peter, On Tue, 29 Apr 2014 13:37:47 +0200, Jiri Olsa wrote: > On Tue, Apr 29, 2014 at 01:19:39PM +0200, Peter Zijlstra wrote: >> On Tue, Apr 29, 2014 at 12:56:54PM +0200, Jiri Olsa wrote: >> > >> > perf_counter tools: Propagate signals properly >> > commit

Re: [PATCH v3 2/3] perf record: Propagate exit status of a command line workload

2014-04-29 Thread Peter Zijlstra
On Thu, Apr 24, 2014 at 10:27:33PM +0900, Namhyung Kim wrote: > static void record__sig_exit(int exit_status __maybe_unused, void *arg) > { > - struct record *rec = arg; > - int status; > - > - if (rec->evlist->workload.pid > 0) { > - if (!child_finished) > -

Re: [PATCH v3 2/3] perf record: Propagate exit status of a command line workload

2014-04-29 Thread Jiri Olsa
On Tue, Apr 29, 2014 at 01:33:04PM +0200, Peter Zijlstra wrote: > On Tue, Apr 29, 2014 at 01:19:39PM +0200, Peter Zijlstra wrote: > > On Tue, Apr 29, 2014 at 12:56:54PM +0200, Jiri Olsa wrote: > > > > > > perf_counter tools: Propagate signals properly > > > commit

Re: [PATCH v3 2/3] perf record: Propagate exit status of a command line workload

2014-04-29 Thread Jiri Olsa
On Tue, Apr 29, 2014 at 01:19:39PM +0200, Peter Zijlstra wrote: > On Tue, Apr 29, 2014 at 12:56:54PM +0200, Jiri Olsa wrote: > > > > perf_counter tools: Propagate signals properly > > commit f7b7c26e01e51fe46097e11f179dc71ce7950084 > > Author: Peter Zijlstra > > Date: Wed Jun 10

Re: [PATCH v3 2/3] perf record: Propagate exit status of a command line workload

2014-04-29 Thread Peter Zijlstra
On Tue, Apr 29, 2014 at 01:19:39PM +0200, Peter Zijlstra wrote: > On Tue, Apr 29, 2014 at 12:56:54PM +0200, Jiri Olsa wrote: > > > > perf_counter tools: Propagate signals properly > > commit f7b7c26e01e51fe46097e11f179dc71ce7950084 > > Author: Peter Zijlstra > > Date: Wed Jun 10

Re: [PATCH v3 2/3] perf record: Propagate exit status of a command line workload

2014-04-29 Thread Peter Zijlstra
On Tue, Apr 29, 2014 at 12:56:54PM +0200, Jiri Olsa wrote: > > perf_counter tools: Propagate signals properly > commit f7b7c26e01e51fe46097e11f179dc71ce7950084 > Author: Peter Zijlstra > Date: Wed Jun 10 15:55:59 2009 +0200 > > but I dont think we need to do that But but but, then

Re: [PATCH v3 2/3] perf record: Propagate exit status of a command line workload

2014-04-29 Thread Jiri Olsa
On Thu, Apr 24, 2014 at 10:27:33PM +0900, Namhyung Kim wrote: SNIP > - rec->bytes_written / 24); > +out_child: > + if (forks) { > + int exit_status; > > - return 0; > + if (!child_finished) > + kill(rec->evlist->workload.pid,

Re: [PATCH v3 2/3] perf record: Propagate exit status of a command line workload

2014-04-29 Thread Jiri Olsa
On Thu, Apr 24, 2014 at 10:27:33PM +0900, Namhyung Kim wrote: SNIP > Reported-by: Stephane Eranian > Signed-off-by: Namhyung Kim > --- > tools/perf/builtin-record.c | 121 > ++- > 1 file changed, 51 insertions(+), 70 deletions(-) > > diff --git

Re: [PATCH v3 2/3] perf record: Propagate exit status of a command line workload

2014-04-29 Thread Jiri Olsa
On Thu, Apr 24, 2014 at 10:27:33PM +0900, Namhyung Kim wrote: SNIP Reported-by: Stephane Eranian eran...@google.com Signed-off-by: Namhyung Kim namhy...@kernel.org --- tools/perf/builtin-record.c | 121 ++- 1 file changed, 51 insertions(+), 70

Re: [PATCH v3 2/3] perf record: Propagate exit status of a command line workload

2014-04-29 Thread Jiri Olsa
On Thu, Apr 24, 2014 at 10:27:33PM +0900, Namhyung Kim wrote: SNIP - rec-bytes_written / 24); +out_child: + if (forks) { + int exit_status; - return 0; + if (!child_finished) + kill(rec-evlist-workload.pid, SIGTERM); also

Re: [PATCH v3 2/3] perf record: Propagate exit status of a command line workload

2014-04-29 Thread Peter Zijlstra
On Tue, Apr 29, 2014 at 12:56:54PM +0200, Jiri Olsa wrote: perf_counter tools: Propagate signals properly commit f7b7c26e01e51fe46097e11f179dc71ce7950084 Author: Peter Zijlstra a.p.zijls...@chello.nl Date: Wed Jun 10 15:55:59 2009 +0200 but I dont think we need to do that But

Re: [PATCH v3 2/3] perf record: Propagate exit status of a command line workload

2014-04-29 Thread Peter Zijlstra
On Tue, Apr 29, 2014 at 01:19:39PM +0200, Peter Zijlstra wrote: On Tue, Apr 29, 2014 at 12:56:54PM +0200, Jiri Olsa wrote: perf_counter tools: Propagate signals properly commit f7b7c26e01e51fe46097e11f179dc71ce7950084 Author: Peter Zijlstra a.p.zijls...@chello.nl Date: Wed

Re: [PATCH v3 2/3] perf record: Propagate exit status of a command line workload

2014-04-29 Thread Jiri Olsa
On Tue, Apr 29, 2014 at 01:19:39PM +0200, Peter Zijlstra wrote: On Tue, Apr 29, 2014 at 12:56:54PM +0200, Jiri Olsa wrote: perf_counter tools: Propagate signals properly commit f7b7c26e01e51fe46097e11f179dc71ce7950084 Author: Peter Zijlstra a.p.zijls...@chello.nl Date: Wed

Re: [PATCH v3 2/3] perf record: Propagate exit status of a command line workload

2014-04-29 Thread Jiri Olsa
On Tue, Apr 29, 2014 at 01:33:04PM +0200, Peter Zijlstra wrote: On Tue, Apr 29, 2014 at 01:19:39PM +0200, Peter Zijlstra wrote: On Tue, Apr 29, 2014 at 12:56:54PM +0200, Jiri Olsa wrote: perf_counter tools: Propagate signals properly commit f7b7c26e01e51fe46097e11f179dc71ce7950084

Re: [PATCH v3 2/3] perf record: Propagate exit status of a command line workload

2014-04-29 Thread Peter Zijlstra
On Thu, Apr 24, 2014 at 10:27:33PM +0900, Namhyung Kim wrote: static void record__sig_exit(int exit_status __maybe_unused, void *arg) { - struct record *rec = arg; - int status; - - if (rec-evlist-workload.pid 0) { - if (!child_finished) -

Re: [PATCH v3 2/3] perf record: Propagate exit status of a command line workload

2014-04-29 Thread Namhyung Kim
Hi Jiri and Peter, On Tue, 29 Apr 2014 13:37:47 +0200, Jiri Olsa wrote: On Tue, Apr 29, 2014 at 01:19:39PM +0200, Peter Zijlstra wrote: On Tue, Apr 29, 2014 at 12:56:54PM +0200, Jiri Olsa wrote: perf_counter tools: Propagate signals properly commit

Re: [PATCH v3 2/3] perf record: Propagate exit status of a command line workload

2014-04-25 Thread Stephane Eranian
On Thu, Apr 24, 2014 at 3:27 PM, Namhyung Kim wrote: > Currently perf record doesn't propagate the exit status of a workload > given by the command line. But sometimes it'd useful if it's > propagated so that a monitoring script can handle errors > appropriately. > > To do that, it got rid of

Re: [PATCH v3 2/3] perf record: Propagate exit status of a command line workload

2014-04-25 Thread Stephane Eranian
On Thu, Apr 24, 2014 at 3:27 PM, Namhyung Kim namhy...@kernel.org wrote: Currently perf record doesn't propagate the exit status of a workload given by the command line. But sometimes it'd useful if it's propagated so that a monitoring script can handle errors appropriately. To do that, it

[PATCH v3 2/3] perf record: Propagate exit status of a command line workload

2014-04-24 Thread Namhyung Kim
Currently perf record doesn't propagate the exit status of a workload given by the command line. But sometimes it'd useful if it's propagated so that a monitoring script can handle errors appropriately. To do that, it got rid of exit handlers and run/call them directly in the __cmd_record(). I

[PATCH v3 2/3] perf record: Propagate exit status of a command line workload

2014-04-24 Thread Namhyung Kim
Currently perf record doesn't propagate the exit status of a workload given by the command line. But sometimes it'd useful if it's propagated so that a monitoring script can handle errors appropriately. To do that, it got rid of exit handlers and run/call them directly in the __cmd_record(). I