[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CABPqkBS+7Khz=8Z5gb_veQVoovjPwNmUjqnQta=cRuHrcQmy9A@mail.gmail.com>
Date: Wed, 23 Apr 2014 16:40:21 +0200
From: Stephane Eranian <eranian@...gle.com>
To: Namhyung Kim <namhyung@...nel.org>
Cc: Arnaldo Carvalho de Melo <acme@...nel.org>,
Jiri Olsa <jolsa@...hat.com>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Ingo Molnar <mingo@...nel.org>,
Paul Mackerras <paulus@...ba.org>,
Namhyung Kim <namhyung.kim@....com>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 1/2] perf record: Propagate exit status of a command
line workload
On Wed, Apr 23, 2014 at 4:38 PM, Namhyung Kim <namhyung@...nel.org> wrote:
> Hi Stephane,
>
> 2014-04-23 (수), 14:11 +0200, Stephane Eranian:
>> On Wed, Apr 23, 2014 at 8:40 AM, Namhyung Kim <namhyung@...nel.org> wrote:
>> > +out_child:
>> > + if (forks) {
>> > + int exit_status;
>> >
>> > - return 0;
>> > + if (!child_finished)
>> > + kill(rec->evlist->workload.pid, SIGTERM);
>> > +
>> > + wait(&exit_status);
>> > +
>> > + if (err < 0)
>> Not quite this. Although this works with my test case with 'false'.
>> It fails when I tried the opposite test 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) ]
>> no
>>
>> The return code in this case is 255. I tracked it down to err being last set
>> by poll() which got interrupted by SIGCHLD. So I think the err value must
>> be overridden somehow in this case. Maybe something like:
>>
>> err = poll(evsel_list->pollfd, evsel_list->nr_fds, -1);
>> if (err < 0 && errno == EINTR && forks && done)
>> err = 0;
>
> Hmm.. just checking "err < 0 && errno == EINTR" isn't enough?
>
> And I guess the same problem can be occurred during record__mmap_read()
> as it calls record__write() which eventually calls ion() and it seems
> not to handle the above case.. I'll cook a patch for it too.
>
That's true.
Now, do we care about the return value of poll()?
> Thanks,
> Namhyung
>
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists