From: Namhyung Kim <namhyung@kernel.org>
To: Jiri Olsa <jolsa@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Ingo Molnar <mingo@kernel.org>, 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 v6 1/2] perf record: Propagate exit status of a command line workload
Date: Mon, 12 May 2014 09:05:45 +0900 [thread overview]
Message-ID: <87tx8vn9nq.fsf@sejong.aot.lge.com> (raw)
In-Reply-To: <20140511133018.GB2272@krava.brq.redhat.com> (Jiri Olsa's message of "Sun, 11 May 2014 15:30:18 +0200")
Hi Jiri,
On Sun, 11 May 2014 15:30:18 +0200, Jiri Olsa wrote:
> On Fri, May 09, 2014 at 02:14:17PM +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().
>
> so in this last change we keep one exit handler, please update
> the changelog
Okay.
>
>>
>> With this change, perf record returns the child exit status in case of
>> normal termination and send signal to itself when terminated by signal.
>>
>
> SNIP
>
>>
>> out_delete_session:
>> perf_session__delete(session);
>> - return err;
>> + return status;
>
> we dont set status correctly before the 'goto out_delete_session'
> in the following condition:
>
> err = perf_evlist__prepare_workload(rec->evlist, &opts->target,
> argv, file->is_pipe,
> workload_exec_failed_signal);
> if (err < 0) {
> pr_err("Couldn't run the workload!\n");
> goto out_delete_session;
> }
>
> so we dont propagate status correctly in case the above function fails:
>
> [jolsa@krava perf]$ ulimit -n 6
> [jolsa@krava perf]$ ./perf record sleep 100
> failed to create 'go' pipe: Too many open files
> Couldn't run the workload!
> [jolsa@krava perf]$ echo $?
> 0
> [jolsa@krava perf]$
Right. I'll send v7!
Thanks,
Namhyung
prev parent reply other threads:[~2014-05-12 0:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-09 5:14 Namhyung Kim
2014-05-09 5:14 ` [PATCH v6 2/2] perf tools: Get rid of on_exit() feature test Namhyung Kim
2014-05-11 13:30 ` [PATCH v6 1/2] perf record: Propagate exit status of a command line workload Jiri Olsa
2014-05-12 0:05 ` Namhyung Kim [this message]
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=87tx8vn9nq.fsf@sejong.aot.lge.com \
--to=namhyung@kernel.org \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@kernel.org \
--cc=dsahern@gmail.com \
--cc=eranian@google.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung.kim@lge.com \
--cc=paulus@samba.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®