Received: by 10.223.185.111 with SMTP id b44csp76393wrg; Fri, 9 Mar 2018 01:13:33 -0800 (PST) X-Google-Smtp-Source: AG47ELs7LZoJ+KyKX71WFD4KGyeeRVgMDaBblm3zuwGrX8VRjsKnJWVtl05P2aSqZVIl73InSlP+ X-Received: by 10.99.67.1 with SMTP id q1mr7373002pga.365.1520586813718; Fri, 09 Mar 2018 01:13:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520586813; cv=none; d=google.com; s=arc-20160816; b=RZMe0/ChvjCGFop06onZQo9PTkx5Xii4GHncowc3FSofnDOj8t5+/Pr88swcfmKPMQ 13Sv937UpQXZGZNuDsfdMm7hOG6YA6tBIsQGUUEQoC75rpu4oL6UeK47OGsulDfcpPky p34Wc+6HFvCEsBHSitORq0XtYSfTadJ/EoSjIhJWxBDZkHzWvrKcgEjjxsAJrkgKK87K zFvhITwXWf9mQMtNKpthj5ItfxQVRDTejT8oGEx31WI1RFY3fZ4jFqoFmzbjtpuSUEHh 8hfoFbDY4/3PMzJ9phak1bB3D6vj+sOwhrj+zbL9Pw0gCN5wqebWW6QcO09neXY7Pzec vhyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:arc-authentication-results; bh=IGu1Xuq6ZqmrPevrenvxSYpK6oVYzmFKTUH+oy0rlIY=; b=vz0Bg3znMEUeeWV4gFwMLkgyiWpiP7an4LDI6jAEC+PQZwTFNOO0F5iG9diMlyZCtH 33eHgbEd5kSRUMJTOGZtoIN0N0RRkElYza8jfpSadnICnbjkTtYEe53NAWCRTt20xKUC IRrL8aXvlVuHD+Z2yyd9LxXo4JHcsDR3AsTvo+nQcG1lze4mAKHuPYOBSoJt3Wn/SnBu RVE69SRQZILgt7nNvSFTYTrOsLCFX0CFRi5p7R0evBJD0HiD1CgWLXcn36sIjTyFnhpU 35ctorwBksR3N+OHK9FQSiYBnnXLoTyNqW7Um7oMv2+5oaYw+WXrSHFpAoiP8DOX+2p7 6NZw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n13-v6si515564plp.795.2018.03.09.01.13.19; Fri, 09 Mar 2018 01:13:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751613AbeCIJKj (ORCPT + 99 others); Fri, 9 Mar 2018 04:10:39 -0500 Received: from terminus.zytor.com ([198.137.202.136]:49597 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751169AbeCIJKh (ORCPT ); Fri, 9 Mar 2018 04:10:37 -0500 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTP id w299AFng032016; Fri, 9 Mar 2018 01:10:15 -0800 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w299AEBR032013; Fri, 9 Mar 2018 01:10:14 -0800 Date: Fri, 9 Mar 2018 01:10:14 -0800 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Kan Liang Message-ID: Cc: vincent.weaver@maine.edu, kan.liang@linux.intel.com, alexander.shishkin@linux.intel.com, mingo@kernel.org, eranian@google.com, acme@redhat.com, jolsa@redhat.com, peterz@infradead.org, linux-kernel@vger.kernel.org, hpa@zytor.com, torvalds@linux-foundation.org, tglx@linutronix.de Reply-To: torvalds@linux-foundation.org, hpa@zytor.com, linux-kernel@vger.kernel.org, tglx@linutronix.de, alexander.shishkin@linux.intel.com, vincent.weaver@maine.edu, kan.liang@linux.intel.com, acme@redhat.com, eranian@google.com, peterz@infradead.org, jolsa@redhat.com, mingo@kernel.org In-Reply-To: <1518474035-21006-5-git-send-email-kan.liang@linux.intel.com> References: <1518474035-21006-5-git-send-email-kan.liang@linux.intel.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf/x86/intel: Fix PMU read for auto-reload Git-Commit-ID: ceb90d9e0248947839a0ff4bee98cf28695a6020 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: ceb90d9e0248947839a0ff4bee98cf28695a6020 Gitweb: https://git.kernel.org/tip/ceb90d9e0248947839a0ff4bee98cf28695a6020 Author: Kan Liang AuthorDate: Mon, 12 Feb 2018 14:20:34 -0800 Committer: Ingo Molnar CommitDate: Fri, 9 Mar 2018 08:22:22 +0100 perf/x86/intel: Fix PMU read for auto-reload Auto-reload events needs to be specially handled in event count read. Auto-reload is only available for intel_pmu. Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Cc: Alexander Shishkin Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Stephane Eranian Cc: Thomas Gleixner Cc: Vince Weaver Cc: acme@kernel.org Fixes: b8241d20699e ("perf/x86/intel: Implement batched PEBS interrupt handling (large PEBS interrupt threshold)") Link: http://lkml.kernel.org/r/1518474035-21006-5-git-send-email-kan.liang@linux.intel.com Signed-off-by: Ingo Molnar --- arch/x86/events/intel/core.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c index 1ba7ca7b675d..41c68d337e84 100644 --- a/arch/x86/events/intel/core.c +++ b/arch/x86/events/intel/core.c @@ -2060,6 +2060,14 @@ static void intel_pmu_del_event(struct perf_event *event) intel_pmu_pebs_del(event); } +static void intel_pmu_read_event(struct perf_event *event) +{ + if (event->hw.flags & PERF_X86_EVENT_AUTO_RELOAD) + intel_pmu_auto_reload_read(event); + else + x86_perf_event_update(event); +} + static void intel_pmu_enable_fixed(struct hw_perf_event *hwc) { int idx = hwc->idx - INTEL_PMC_IDX_FIXED; @@ -3503,6 +3511,7 @@ static __initconst const struct x86_pmu intel_pmu = { .disable = intel_pmu_disable_event, .add = intel_pmu_add_event, .del = intel_pmu_del_event, + .read = intel_pmu_read_event, .hw_config = intel_pmu_hw_config, .schedule_events = x86_schedule_events, .eventsel = MSR_ARCH_PERFMON_EVENTSEL0,