All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <ak@linux.intel.com>
To: David Ahern <dsahern@gmail.com>
Cc: Andi Kleen <andi@firstfloor.org>,
	acme@ghostprotocols.net, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] perf, tools: Stop perf stat -p when profiled process exits v2
Date: Thu, 13 Sep 2012 08:52:18 -0700	[thread overview]
Message-ID: <20120913155218.GE4092@tassilo.jf.intel.com> (raw)
In-Reply-To: <5050A21A.3030102@gmail.com>

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

      reply	other threads:[~2012-09-13 15:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-12 14:40 [PATCH] perf, tools: Stop perf stat -p when profiled process exits v2 Andi Kleen
2012-09-12 14:54 ` David Ahern
2012-09-13 15:52   ` Andi Kleen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120913155218.GE4092@tassilo.jf.intel.com \
    --to=ak@linux.intel.com \
    --cc=acme@ghostprotocols.net \
    --cc=andi@firstfloor.org \
    --cc=dsahern@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.