linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: nleeder@codeaurora.org (Neil Leeder)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] perf: allow add to change event state
Date: Fri,  3 Jun 2016 17:03:31 -0400	[thread overview]
Message-ID: <1464987812-14360-2-git-send-email-nleeder@codeaurora.org> (raw)
In-Reply-To: <1464987812-14360-1-git-send-email-nleeder@codeaurora.org>

When the platform-specific pmu->add function returns
an error, it may have also changed the event's state.
If so, do not override that new state.

Signed-off-by: Neil Leeder <nleeder@codeaurora.org>
---
 kernel/events/core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/events/core.c b/kernel/events/core.c
index c0ded24..95c4cf3d3 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -1952,7 +1952,8 @@ event_sched_in(struct perf_event *event,
 	perf_log_itrace_start(event);
 
 	if (event->pmu->add(event, PERF_EF_START)) {
-		event->state = PERF_EVENT_STATE_INACTIVE;
+		if (event->state == PERF_EVENT_STATE_ACTIVE)
+			event->state = PERF_EVENT_STATE_INACTIVE;
 		event->oncpu = -1;
 		ret = -EAGAIN;
 		goto out;
-- 
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project.

  reply	other threads:[~2016-06-03 21:03 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-03 21:03 [PATCH 0/2] qcom: add l2 cache perf events driver Neil Leeder
2016-06-03 21:03 ` Neil Leeder [this message]
2016-06-03 21:38   ` [PATCH 1/2] perf: allow add to change event state Peter Zijlstra
2016-06-03 21:03 ` [PATCH 2/2] soc: qcom: add l2 cache perf events driver Neil Leeder
2016-06-06  9:51   ` Mark Rutland
2016-06-08 15:16     ` Neil Leeder
2016-06-09 15:56       ` Mark Rutland
2016-06-09 19:41         ` Peter Zijlstra
2016-06-10 22:34           ` Neil Leeder
2016-06-06  9:04 ` [PATCH 0/2] " Mark Rutland
2016-06-08 15:21   ` Neil Leeder
2016-06-08 16:12     ` Mark Rutland
2016-06-08 19:29       ` Neil Leeder

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=1464987812-14360-2-git-send-email-nleeder@codeaurora.org \
    --to=nleeder@codeaurora.org \
    --cc=linux-arm-kernel@lists.infradead.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).