From: Ingo Molnar <mingo@kernel.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Namhyung Kim <namhyung@kernel.org>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Jiri Olsa <jolsa@redhat.com>, Paul Mackerras <paulus@samba.org>,
Namhyung Kim <namhyung.kim@lge.com>,
LKML <linux-kernel@vger.kernel.org>,
Stephane Eranian <eranian@google.com>,
David Ahern <dsahern@gmail.com>
Subject: Re: [PATCH v5 1/2] perf record: Propagate exit status of a command line workload
Date: Thu, 8 May 2014 10:42:46 +0200 [thread overview]
Message-ID: <20140508084246.GA1659@gmail.com> (raw)
In-Reply-To: <20140508082350.GG2844@laptop.programming.kicks-ass.net>
* Peter Zijlstra <peterz@infradead.org> wrote:
> On Thu, May 08, 2014 at 04:59:53PM +0900, 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 exit handlers and run/call them directly in
> > the __cmd_record(). I don't see any reason why those are in a form of
> > exit handlers in the first place. Also it cleaned up the resource
> > management code in record__exit().
> >
> > With this change, perf record returns the child exit status in case of
> > normal termination and send signal to itself when terminated by signal.
> >
> > Example run of Stephane's case:
> >
> > $ perf record true && echo yes || echo no
> > [ perf record: Woken up 1 times to write data ]
> > [ perf record: Captured and wrote 0.013 MB perf.data (~589 samples) ]
> > yes
> >
> > $ perf record false && echo yes || echo no
> > [ perf record: Woken up 1 times to write data ]
> > [ perf record: Captured and wrote 0.013 MB perf.data (~589 samples) ]
> > no
> >
> > Jiri's case (error in parent):
> >
> > $ perf record -m 10G true && echo yes || echo no
> > rounding mmap pages size to 17179869184 bytes (4194304 pages)
> > failed to mmap with 12 (Cannot allocate memory)
> > no
> >
> > And Peter's case (interrupted by signal):
> >
> > $ while :; do perf record sleep 1; done
> > ^C[ perf record: Woken up 1 times to write data ]
> > [ perf record: Captured and wrote 0.014 MB perf.data (~593 samples) ]
>
> Thanks!
>
> Acked-by: Peter Zijlstra <peterz@infradead.org>
Very nice!
Acked-by: Ingo Molnar <mingo@kernel.org>
Thanks,
Ingo
next prev parent reply other threads:[~2014-05-08 8:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-08 7:59 [PATCH v5 1/2] perf record: Propagate exit status of a command line workload Namhyung Kim
2014-05-08 7:59 ` [PATCH v5 2/2] perf tools: Get rid of on_exit() feature test Namhyung Kim
2014-05-08 8:23 ` [PATCH v5 1/2] perf record: Propagate exit status of a command line workload Peter Zijlstra
2014-05-08 8:42 ` Ingo Molnar [this message]
2014-05-08 10:32 ` Jiri Olsa
2014-05-09 0:11 ` Namhyung Kim
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140508084246.GA1659@gmail.com \
--to=mingo@kernel.org \
--cc=acme@kernel.org \
--cc=dsahern@gmail.com \
--cc=eranian@google.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=namhyung.kim@lge.com \
--cc=namhyung@kernel.org \
--cc=paulus@samba.org \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.