[lkml]   [2012]   [Sep]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] perf, tools: Stop perf stat -p when profiled process exits v2
On 9/12/12 8:40 AM, Andi Kleen wrote:
> - while(!done) sleep(1);
> + char piddir[40];
> + if ( && access("/proc", X_OK) == 0)
> + snprintf(piddir, sizeof piddir, "/proc/%d", atoi(;

else path has piddir not set. Also as Namyhung pointed out
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.

Perhaps a more generic perf_target__is_alive function is needed that can
check if the given tid(s) or pid(s) have terminated.


 \ /
  Last update: 2012-09-12 17:42    [W:0.034 / U:0.412 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site