lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5050A21A.3030102@gmail.com>
Date:	Wed, 12 Sep 2012 08:54:18 -0600
From:	David Ahern <dsahern@...il.com>
To:	Andi Kleen <andi@...stfloor.org>
CC:	acme@...stprotocols.net, linux-kernel@...r.kernel.org,
	Andi Kleen <ak@...ux.intel.com>
Subject: Re: [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 (target.pid && access("/proc", X_OK) == 0)
> +			snprintf(piddir, sizeof piddir, "/proc/%d", atoi(target.pid));

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

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

David
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ