Messages in this thread | | | Date | Thu, 13 Sep 2012 08:52:18 -0700 | From | Andi Kleen <> | Subject | Re: [PATCH] perf, tools: Stop perf stat -p when profiled process exits v2 |
| |
On Wed, Sep 12, 2012 at 08:54:18AM -0600, David Ahern wrote: > On 9/12/12 8:40 AM, Andi Kleen wrote: > >- while(!done) sleep(1); > >+ char piddir[40]; > >+ if (target.pid && access("/proc", X_OK) == 0) > >+ snprintf(piddir, sizeof piddir, "/proc/%d", atoi(target.pid)); > > else path has piddir not set.
It doesn't need to be set for else?
> target.pid can have multiple pids in it, so this fails if a user > specified -p pid1,pid2 -- it will only check if the first process > died.
Ok. I suppose can make it simply not check for that case.
-Andi
| |