linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Jiri Olsa <jolsa@redhat.com>
Cc: Stephane Eranian <eranian@google.com>,
	LKML <linux-kernel@vger.kernel.org>,
	"mingo@elte.hu" <mingo@elte.hu>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Namhyung Kim <namhyung@kernel.org>,
	"ak@linux.intel.com" <ak@linux.intel.com>,
	David Ahern <dsahern@gmail.com>
Subject: Re: [PATCH] perf: Do not check PERF_EVENT_STATE_EXIT on syscall read path
Date: Mon, 8 Sep 2014 17:22:06 +0200	[thread overview]
Message-ID: <20140908152206.GH6758@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <20140908143107.GG17728@krava.brq.redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1406 bytes --]

On Mon, Sep 08, 2014 at 04:31:07PM +0200, Jiri Olsa wrote:
> Revert PERF_EVENT_STATE_EXIT check on read syscall path.
> It breaks standard way to read counter, which is to open
> the counter, wait for the monitored process to die and
> read the counter.
> 
> Reported-by: Stephane Eranian <eranian@google.com>
> Acked-by: Stephane Eranian <eranian@google.com>
> Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
> Cc: Frederic Weisbecker <fweisbec@gmail.com>
> Cc: Ingo Molnar <mingo@kernel.org>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
> Cc: Stephane Eranian <eranian@google.com>
> Signed-off-by: Jiri Olsa <jolsa@kernel.org>

Thanks! 

> ---
>  kernel/events/core.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/kernel/events/core.c b/kernel/events/core.c
> index d8cb4d21a346..6d1c9ce1643e 100644
> --- a/kernel/events/core.c
> +++ b/kernel/events/core.c
> @@ -3600,8 +3600,7 @@ perf_read_hw(struct perf_event *event, char __user *buf, size_t count)
>  	 * error state (i.e. because it was pinned but it couldn't be
>  	 * scheduled on to the CPU at some point).
>  	 */
> -	if ((event->state == PERF_EVENT_STATE_ERROR) ||
> -	    (event->state == PERF_EVENT_STATE_EXIT))
> +	if (event->state == PERF_EVENT_STATE_ERROR)
>  		return 0;
>  
>  	if (count < event->read_size)
> -- 
> 1.8.3.1
> 

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2014-09-08 15:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-08 12:35 [BUG] perf: cannot read counts in per-process mode in 3.17-rcX Stephane Eranian
2014-09-08 12:49 ` Jiri Olsa
2014-09-08 13:21   ` Stephane Eranian
2014-09-08 14:31     ` [PATCH] perf: Do not check PERF_EVENT_STATE_EXIT on syscall read path Jiri Olsa
2014-09-08 15:22       ` Peter Zijlstra [this message]
2014-09-10 13:49         ` Stephane Eranian
2014-09-15 10:29           ` Stephane Eranian
2014-09-16 10:58       ` [tip:perf/core] " tip-bot for Jiri Olsa

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=20140908152206.GH6758@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=acme@redhat.com \
    --cc=ak@linux.intel.com \
    --cc=dsahern@gmail.com \
    --cc=eranian@google.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=namhyung@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).