Message ID | 1464987812-14360-2-git-send-email-nleeder@codeaurora.org (mailing list archive) |
---|---|
State | Not Applicable, archived |
Delegated to: | Andy Gross |
Headers | show |
On Fri, Jun 03, 2016 at 05:03:31PM -0400, Neil Leeder wrote: > 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. This is inadequate; it fails to what the problem is and why this is a good solution. -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
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;
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(-)