lkml.org 
[lkml]   [2019]   [Jan]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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

\
 
 \ /
  Last update: 2019-01-06 16:58    [W:0.060 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site