[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20190106155748.GD31228@krava>
Date: Sun, 6 Jan 2019 16:57:48 +0100
From: Jiri Olsa <jolsa@...hat.com>
To: "Jin, Yao" <yao.jin@...ux.intel.com>
Cc: acme@...nel.org, jolsa@...nel.org, peterz@...radead.org,
mingo@...hat.com, alexander.shishkin@...ux.intel.com,
Linux-kernel@...r.kernel.org, ak@...ux.intel.com,
kan.liang@...el.com, yao.jin@...el.com
Subject: Re: [PATCH] perf stat: Poll for monitored tasks being alive in fork
mode
On Sun, Jan 06, 2019 at 10:02:18PM +0800, Jin, Yao wrote:
SNIP
> > ---
> > diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
> > index acfd48db52dd..c322cb271180 100644
> > --- a/tools/perf/builtin-stat.c
> > +++ b/tools/perf/builtin-stat.c
> > @@ -583,6 +583,14 @@ static int __run_perf_stat(int argc, const char **argv, int run_idx)
> > if (interval || timeout) {
> > while (!waitpid(child_pid, &status, WNOHANG)) {
> > + if (!is_target_alive(&target, evsel_list->threads)) {
> > + int pid = child_pid;
> > +
> > + if (pid != -1)
> > + kill(pid, SIGTERM);
> > + break;
> > + }
> > +
> > nanosleep(&ts, NULL);
> > if (timeout)
> > break;
> >
>
> Hi Jiri,
>
> I think your patch is good. At least, we can avoid the case of kill(-1,
> SIGTERM).
>
> BTW, you post this patch or I re-post it, both fine for me. :)
please post it
thanks,
jirka
Powered by blists - more mailing lists