Received: by 10.223.176.5 with SMTP id f5csp3086894wra; Mon, 29 Jan 2018 08:34:03 -0800 (PST) X-Google-Smtp-Source: AH8x224sJ3ZYI7ya0p3QIH7CpoCv7E3oiqVCyFpjiutvOQr+nKuk0B6TJdxsCeUkF3BNvHitfepG X-Received: by 10.98.133.193 with SMTP id m62mr27819691pfk.18.1517243643386; Mon, 29 Jan 2018 08:34:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517243643; cv=none; d=google.com; s=arc-20160816; b=YpN8kLlagtDbPkhW7J0Y5WxEtmVzldKGEGM289RLZTXpDkUF6oTBzwTA2EiafdrHRN h/iO2DWZQiQe1nO8n4/n9aHcVc6ZZ4OT2/TF6sft0p0tpDikcK7PB5gat1/n9Y4dVqt/ 9kyF03NGBMgQIM3bRDYIYXFectWtEmgCchTs+eDbsJpO9gpdMWaUROA26izm6ZHfcozE QLHym/y299pUWmBHuo2WeHBLYeckh7Qw16VQL5+XHKrA6qxT+87O0dDZp1h+aLp5q9IM tJj2YFYbbkqygXGRsHmtfGcuJ5kn+t+HJpEGr0JeMeTMyRdw4xsP09Au6Cjqq9UGHlO/ C5PA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=Rhga0Q1xK2iDk/iNXgNJkbjdDP0Wy9lXEEAEa3Z4aCw=; b=RhGBcGvSI7oLNten4NkXg5yJQNawxdAlau20bwBGf1bPWechwRFkkmQcSnSC5kkaLu 5W5ZVUL5WZQS3c8Frw1zb1UoqQJGFZ7t1X1+hqbvSgHs+OXn0uzWNWulah/m3/Z4kKPe tGuYMQZ78CIid5xw9a4SlraiAV3TQUfSTdzIP4rBiISkdEnCLn6Upfix7bKeN2YzeOIE AGQ+qXI7FKnDKKTswziohpsmFCu6/WevrXAT65NEgLKkcOO1rBEOls6J4sVuaF1pPDdV 4+D4HKEeKK+bBGobdjK8SVlBE3YFYshgbJCwOxGZuZUrW+i7K7iDT2kQZWDeuUpSoZjJ MPBw== 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 t20si1009657pfi.42.2018.01.29.08.33.48; Mon, 29 Jan 2018 08:34:03 -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 S1751753AbeA2Qcb (ORCPT + 99 others); Mon, 29 Jan 2018 11:32:31 -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 Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Jan 2018 08:30:39 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,431,1511856000"; d="scan'208";a="25629346" Received: from otc-lr-04.jf.intel.com ([10.54.39.128]) by fmsmga004.fm.intel.com with ESMTP; 29 Jan 2018 08:30:39 -0800 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 Precedence: bulk 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