Received: by 10.213.65.68 with SMTP id h4csp367421imn; Tue, 20 Mar 2018 05:35:00 -0700 (PDT) X-Google-Smtp-Source: AG47ELsQPdfhUnIb3igolZiuc/faAj51mYJCUgSlB2sc9VX0Fa7g5oqe6y3Q6s10sWd8lcNM88KT X-Received: by 10.99.105.7 with SMTP id e7mr11894149pgc.193.1521549300677; Tue, 20 Mar 2018 05:35:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521549300; cv=none; d=google.com; s=arc-20160816; b=TdikmKClzHC/3VB/xk0LnaumJFiyoqQeg5l1MvrmuMOgrzWkRLtO4oYsFHP0wS3kSG JoaXHgZVwUVHUzhKhtafbmQzyn35nY/ImjyB8cXfwWDKAlUCP6oyYRN6+E/Cce7VVj0M u/p7JssU5XIWtlpO2fxPgYAtsM31JHHhkjIFnnF8rI4rpBiRTR+BT19IISfIEDg99oh/ /It+ff0iHiyg69UNAVXlhePnooCJ+A/ez1eVvjDBmks3B5LyEahL2wseUvXSbPYYyVV5 XxKHVYEUYqSAZLl5EH3MZ42L/SNwan63EnPhBPVYtxfPYY3eLP+MLiIJGEl+GvC5ZMKe ZWtA== 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=I3ro0bVc2B83h+ixJWDxZP79K9uPqp3w+UGHX18kbw8=; b=SatLqKQ0JzmQBF8OgtMslaCVjX63+pcsEXw1JYLl1L+NelQgXyAcmyTjRDpKuKZHax g2LgTew/HryFtguZWu8ueBJDoordD73kZwp0ZVkPDkhh9p7u3ymBljZxSJn7pLWoKR0a FSys27oKppNoKonGfMrtYMmxAhSCYOOLqcjmx7i+Kdu57XpuovWL+/iMES1gm4ksbNl+ LEjhgnk0ymMJfwLgku5T1fhK83CrfyfEJmvad19yhl2IrO7jblArXIJQSGnb84KRk/b4 1gWL0GAzFarzjjkJIkb4aiEm/PgGHPRR131vHtbbCZ1zbZwHMxgLO8gbMxSLiTTlVO0A X8aA== 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 j66si1216231pfj.181.2018.03.20.05.34.44; Tue, 20 Mar 2018 05:35:00 -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 S1753285AbeCTMdd (ORCPT + 99 others); Tue, 20 Mar 2018 08:33:33 -0400 Received: from mga18.intel.com ([134.134.136.126]:3066 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753273AbeCTMda (ORCPT ); Tue, 20 Mar 2018 08:33:30 -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 orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Mar 2018 05:33:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,335,1517904000"; d="scan'208";a="209781522" Received: from otc-lr-04.jf.intel.com ([10.54.39.128]) by orsmga005.jf.intel.com with ESMTP; 20 Mar 2018 05:33:30 -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: [PATCH V7 7/8] perf/x86/intel/uncore: Expose uncore_pmu_event functions Date: Tue, 20 Mar 2018 05:32:44 -0700 Message-Id: <1521549165-6216-7-git-send-email-kan.liang@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1521549165-6216-1-git-send-email-kan.liang@intel.com> References: <1521549165-6216-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 uncore has custom pmu. For custom 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