From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751759AbeA2Qcc (ORCPT ); Mon, 29 Jan 2018 11:32:32 -0500 Received: from mga09.intel.com ([134.134.136.24]:11472 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751262AbeA2Qak (ORCPT ); Mon, 29 Jan 2018 11:30:40 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,431,1511856000"; d="scan'208";a="25629346" From: kan.liang@linux.intel.com To: peterz@infradead.org, mingo@redhat.com, linux-kernel@vger.kernel.org Cc: acme@kernel.org, tglx@linutronix.de, jolsa@redhat.com, eranian@google.com, ak@linux.intel.com, Kan Liang Subject: [PATCH V3 2/5] perf/x86: introduce read function for x86_pmu Date: Mon, 29 Jan 2018 08:29:30 -0800 Message-Id: <1517243373-355481-3-git-send-email-kan.liang@linux.intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517243373-355481-1-git-send-email-kan.liang@linux.intel.com> References: <1517243373-355481-1-git-send-email-kan.liang@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kan Liang Large PEBS needs to be specially handled in event count read. Signed-off-by: Kan Liang --- arch/x86/events/core.c | 2 ++ arch/x86/events/perf_event.h | 1 + 2 files changed, 3 insertions(+) diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c index 140d332..acd7ffc 100644 --- a/arch/x86/events/core.c +++ b/arch/x86/events/core.c @@ -1884,6 +1884,8 @@ early_initcall(init_hw_perf_events); static inline void x86_pmu_read(struct perf_event *event) { + if (x86_pmu.read) + return x86_pmu.read(event); x86_perf_event_update(event); } diff --git a/arch/x86/events/perf_event.h b/arch/x86/events/perf_event.h index 8e4ea143..805400b 100644 --- a/arch/x86/events/perf_event.h +++ b/arch/x86/events/perf_event.h @@ -519,6 +519,7 @@ struct x86_pmu { void (*disable)(struct perf_event *); void (*add)(struct perf_event *); void (*del)(struct perf_event *); + void (*read)(struct perf_event *event); int (*hw_config)(struct perf_event *event); int (*schedule_events)(struct cpu_hw_events *cpuc, int n, int *assign); unsigned eventsel; -- 2.7.4