Re: [PATCH] perf, tools: Stop perf stat -p when profiled processexits v2

From: Andi Kleen
Date: Thu Sep 13 2012 - 11:52:12 EST


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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/