linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: tip-bot for Jiri Olsa <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, paulus@samba.org, acme@redhat.com,
	eranian@google.com, hpa@zytor.com, mingo@kernel.org,
	jolsa@kernel.org, a.p.zijlstra@chello.nl, namhyung@kernel.org,
	jolsa@redhat.com, fweisbec@gmail.com, dsahern@gmail.com,
	tglx@linutronix.de
Subject: [tip:perf/core] perf: Do not check PERF_EVENT_STATE_EXIT on syscall read path
Date: Tue, 16 Sep 2014 03:58:02 -0700	[thread overview]
Message-ID: <tip-c88f2096136416b261bd3647cc260935f6e95805@git.kernel.org> (raw)
In-Reply-To: <20140908143107.GG17728@krava.brq.redhat.com>

Commit-ID:  c88f2096136416b261bd3647cc260935f6e95805
Gitweb:     http://git.kernel.org/tip/c88f2096136416b261bd3647cc260935f6e95805
Author:     Jiri Olsa <jolsa@redhat.com>
AuthorDate: Mon, 8 Sep 2014 16:31:07 +0200
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Tue, 16 Sep 2014 10:30:36 +0200

perf: Do not check PERF_EVENT_STATE_EXIT on syscall read path

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>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Acked-by: Stephane Eranian <eranian@google.com>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: David Ahern <dsahern@gmail.com>
Link: http://lkml.kernel.org/r/20140908143107.GG17728@krava.brq.redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 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 f917dec..733c616 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -3601,8 +3601,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)

      parent reply	other threads:[~2014-09-16 10:58 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
2014-09-10 13:49         ` Stephane Eranian
2014-09-15 10:29           ` Stephane Eranian
2014-09-16 10:58       ` tip-bot for Jiri Olsa [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=tip-c88f2096136416b261bd3647cc260935f6e95805@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@redhat.com \
    --cc=dsahern@gmail.com \
    --cc=eranian@google.com \
    --cc=fweisbec@gmail.com \
    --cc=hpa@zytor.com \
    --cc=jolsa@kernel.org \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=paulus@samba.org \
    --cc=tglx@linutronix.de \
    /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).