Received: by 10.192.165.148 with SMTP id m20csp261079imm; Thu, 3 May 2018 19:42:13 -0700 (PDT) X-Google-Smtp-Source: AB8JxZp3eMXt/yEdMoJ9hk3ZG087QdO1mFlTV1olRSUmd9AfodqVe06kVBvRWtNc1I0F6mJs/aW0 X-Received: by 2002:a17:902:f44:: with SMTP id 62-v6mr26369460ply.318.1525401733617; Thu, 03 May 2018 19:42:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525401733; cv=none; d=google.com; s=arc-20160816; b=MNQjKrnuf1OFbFD2ZmcjqLNNSRwsqCvT8rAidLB9kB1ZgtnAIr0WKjdZ34fT7NHQbd bV4E5bIEiptjE8LzZI2T2ArPKSs0Go53MHPdIqlGu07/wWqv9ROzSSYYmUvohfg15lkw mOwHWEiUpDfYeBdWI2OQB6r9e3kV5rvboS7cOtwR4CglVSCypAza4CPTIEWu1VZvhLlr XiSttD/shEEOoCFUkuPaWh6pd1eadtuI+/fS+36QbmYN3oDZVoYtSBqMOdVbH0MNrqHW 7Tbn5YqpEGYIU7OBThaSAknXsiJQLAUdJj4SKgbQ6TgRxWiF9EqqDaX4hqLMHGvToPxD 4WHQ== 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=Byz9rKmzhbzBgYyC51b5vyL97g+HQ2Xx2zNmH+kp9CA=; b=NPD/hsK+qqzomFB0EXlu/WNLQmt5uDecDkowp7tbPG65vM1mhvAO/eRlOVjqn6YLKa 1y9dI9hkYZtLPxg4qY0tPs7saNpLV9f0a3BiwyyRYpm2Sh0sy4crmk1o8lEuuvMHIaUY /RgsAxLLUcfSlrYn/YRUg6HfrNoOx5nVOA+2uEedyd0cWc9/Di8dIqd6fR0U0B+W/4TL wzrpWvy1y0IFegPmVQRoENTZboAiET48psmhMcjmNKED9oxfdAZAC2aXtAU1O/OU7FhI CsBh3MSkWEvCp0y4tu8geWlTvvV81waegVqaw0CXTWBDyYLxPDfEKV33pai3XwEMcpVl p8LQ== 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 j70si15240836pfj.267.2018.05.03.19.41.59; Thu, 03 May 2018 19:42:13 -0700 (PDT) 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 S1751507AbeEDCls (ORCPT + 99 others); Thu, 3 May 2018 22:41:48 -0400 Received: from mga11.intel.com ([192.55.52.93]:18423 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751414AbeEDCln (ORCPT ); Thu, 3 May 2018 22:41:43 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 May 2018 19:41:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,360,1520924400"; d="scan'208";a="221513557" Received: from otc-lr-04.jf.intel.com ([10.54.39.15]) by orsmga005.jf.intel.com with ESMTP; 03 May 2018 19:41:43 -0700 From: kan.liang@intel.com To: peterz@infradead.org, tglx@linutronix.de, mingo@redhat.com, linux-kernel@vger.kernel.org Cc: acme@kernel.org, eranian@google.com, ak@linux.intel.com, Kan Liang Subject: [RESEND PATCH V7 7/8] perf/x86/intel/uncore: Expose uncore_pmu_event functions Date: Thu, 3 May 2018 11:25:12 -0700 Message-Id: <1525371913-10597-7-git-send-email-kan.liang@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1525371913-10597-1-git-send-email-kan.liang@intel.com> References: <1525371913-10597-1-git-send-email-kan.liang@intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kan Liang Some uncores have customized PMU. For customized PMU, it does not need to customize everything. For example, it only needs to customize init() function for client IMC uncore. Other functions like add()/del()/start()/stop()/read() can use generic code. Expose the uncore_pmu_event_add/del/start/stop functions. Reviewed-by: Thomas Gleixner Signed-off-by: Kan Liang --- No changes since V6. arch/x86/events/intel/uncore.c | 8 ++++---- arch/x86/events/intel/uncore.h | 4 ++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/arch/x86/events/intel/uncore.c b/arch/x86/events/intel/uncore.c index 0a6f697..15b0737 100644 --- a/arch/x86/events/intel/uncore.c +++ b/arch/x86/events/intel/uncore.c @@ -451,7 +451,7 @@ static int uncore_assign_events(struct intel_uncore_box *box, int assign[], int return ret ? -EINVAL : 0; } -static void uncore_pmu_event_start(struct perf_event *event, int flags) +void uncore_pmu_event_start(struct perf_event *event, int flags) { struct intel_uncore_box *box = uncore_event_to_box(event); int idx = event->hw.idx; @@ -491,7 +491,7 @@ static void uncore_pmu_event_start(struct perf_event *event, int flags) } } -static void uncore_pmu_event_stop(struct perf_event *event, int flags) +void uncore_pmu_event_stop(struct perf_event *event, int flags) { struct intel_uncore_box *box = uncore_event_to_box(event); struct hw_perf_event *hwc = &event->hw; @@ -528,7 +528,7 @@ static void uncore_pmu_event_stop(struct perf_event *event, int flags) } } -static int uncore_pmu_event_add(struct perf_event *event, int flags) +int uncore_pmu_event_add(struct perf_event *event, int flags) { struct intel_uncore_box *box = uncore_event_to_box(event); struct hw_perf_event *hwc = &event->hw; @@ -600,7 +600,7 @@ static int uncore_pmu_event_add(struct perf_event *event, int flags) return 0; } -static void uncore_pmu_event_del(struct perf_event *event, int flags) +void uncore_pmu_event_del(struct perf_event *event, int flags) { struct intel_uncore_box *box = uncore_event_to_box(event); int i; diff --git a/arch/x86/events/intel/uncore.h b/arch/x86/events/intel/uncore.h index eb02653..c9e1e0b 100644 --- a/arch/x86/events/intel/uncore.h +++ b/arch/x86/events/intel/uncore.h @@ -467,6 +467,10 @@ struct intel_uncore_box *uncore_pmu_to_box(struct intel_uncore_pmu *pmu, int cpu u64 uncore_msr_read_counter(struct intel_uncore_box *box, struct perf_event *event); void uncore_pmu_start_hrtimer(struct intel_uncore_box *box); void uncore_pmu_cancel_hrtimer(struct intel_uncore_box *box); +void uncore_pmu_event_start(struct perf_event *event, int flags); +void uncore_pmu_event_stop(struct perf_event *event, int flags); +int uncore_pmu_event_add(struct perf_event *event, int flags); +void uncore_pmu_event_del(struct perf_event *event, int flags); void uncore_pmu_event_read(struct perf_event *event); void uncore_perf_event_update(struct intel_uncore_box *box, struct perf_event *event); struct event_constraint * -- 2.7.4