Received: by 10.223.185.116 with SMTP id b49csp2699515wrg; Mon, 12 Feb 2018 14:24:57 -0800 (PST) X-Google-Smtp-Source: AH8x227ahI5IHbEQCiM01+ENH2pvPRdrY64lFvuHKzB1AdQIwPBSh+TDlV2B9vh6RJSPSGNWwKmy X-Received: by 2002:a17:902:7586:: with SMTP id j6-v6mr11882303pll.23.1518474297083; Mon, 12 Feb 2018 14:24:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518474297; cv=none; d=google.com; s=arc-20160816; b=bh2Hvv1qjXqHOmgut7+P9S5qmxTrK7aEKKBk6+WQOq3tp7voYk1Ge+o4kjg/l04Nvo 5cRUgOOyr5itmxfiZgUFgQQVYBkV187rE/n7EGwxub1aZq8hAsq3wN34iYIzjl46PdqU auv0pFoJ7uR0sMfPhuUIcy9z75Th266tzEqtU5djVbXMBMtHQeVV1xW5sdkUGd4bbzb8 ne+0FKZJkrguaBjISjA2yXoF+nP56KWhWep4khXF3H0cO6uvPBebhy+xOF5vuAKtki+n KRMJ+1nYX3wqO/TKcTnoxxymrcUKujgUgpel1GJLqnLmNW2j6trWzaGQOQAnfI4Via1l 7i0w== 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=8adotLCWvpXGO6bEpanQDe1QkE2ZR3Vbf0uXN/WmkDY=; b=A1s7Sf4BdB6NRLySs+J7dwn3dbXQGOxqZj0kGKUQO81NJywd3td79ce0szlzkeQYE1 1GwOd3xAqL6AcG4RnlYXJyHh2HgI7BTCWlce6qyGEW7TXGgZqT0/1+F0Gn6tM2U1NTT1 yRLBlvYrM0tYvhz8wrnvqUACLjKNnoLj/LZiyRei7AhX7eMtYwFZcst+/FffeJTuAxhB lR5gyn7ufNRgkFTUEMZkuNKG113QJxJAeuz8NesosvMwCB4/xU0PsjWXeVEhOusCiMU3 xWZ6UfFZY4LLsxOj0hUTwSFQ+oT32HcJRwJfJU2VPmzxLeQ0t3aX0fgMOpmCBWFOoT4k rLrQ== 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 d12si2710242pgn.40.2018.02.12.14.24.42; Mon, 12 Feb 2018 14:24:57 -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 S932815AbeBLWWU (ORCPT + 99 others); Mon, 12 Feb 2018 17:22:20 -0500 Received: from mga07.intel.com ([134.134.136.100]:64299 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932737AbeBLWVw (ORCPT ); Mon, 12 Feb 2018 17:21:52 -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 orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Feb 2018 14:21:49 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,504,1511856000"; d="scan'208";a="29490602" Received: from otc-lr-04.jf.intel.com ([10.54.39.128]) by fmsmga004.fm.intel.com with ESMTP; 12 Feb 2018 14:21:49 -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 V4 4/5] perf/x86/intel: Fix pmu read for auto-reload Date: Mon, 12 Feb 2018 14:20:34 -0800 Message-Id: <1518474035-21006-5-git-send-email-kan.liang@linux.intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518474035-21006-1-git-send-email-kan.liang@linux.intel.com> References: <1518474035-21006-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 Auto-reload event needs to be specially handled in event count read. Auto-reload is only available for intel_pmu. Fixes: b8241d20699e ("perf/x86/intel: Implement batched PEBS interrupt handling (large PEBS interrupt threshold)") Signed-off-by: Kan Liang --- 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 731153a..6461a4a 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; @@ -3495,6 +3503,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, -- 2.7.4