Received: by 10.223.176.46 with SMTP id f43csp2595781wra; Thu, 25 Jan 2018 12:17:56 -0800 (PST) X-Google-Smtp-Source: AH8x224lYj/wn7xsg873qnYiFjk5y6itLFfYbFlBsw8IiTbuC3/agBwgwyh/fOpC1RDcqos7SwSw X-Received: by 10.98.42.79 with SMTP id q76mr13912787pfq.23.1516911476818; Thu, 25 Jan 2018 12:17:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516911476; cv=none; d=google.com; s=arc-20160816; b=Q93mNNNJ0QV3gIOyD1XdPvJxClQMFVknpWjSuas1URlp6T3cz4+98MJsNqAUL6fkdR i6uMxKB5A1ar91LHDebvYwsMXrFaxL/Bfix6qARgxuDoqnQWXd739gXoUGfwJFXQ1/FG pzS2LeXy1tZqdS9xciT/XhkE9Wc6O0x7o/WhUgxc/oaugBO4vLN6/YZLBA4nE2VdDBCn SV0RdrFb4Hr4B5j3gATnNoAEHt6MA+KA00/+wh5L2g0OaaWJUNk451Cu+Ihsvjl1GJ0P BR818ZoPt9IroXUGDtpsqeVyb3eBZ3HucT9d7MH1y7cqsm3+D/oFCkL5l8tyw0I2jOV4 3pFg== 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=ojIO5I69J9kIB4VT6JeUJ6YOghbYFPmqU3SPhcjXq9U=; b=wvoXgrFlhG2gk9BQQ5tOcBLw2AkBzFo6MozsmlE7/nXsVWYwzy5Rder9UPK3gUMFW7 0pwu2fjP4b05O3WnxXt7XvKZukClRxk+QBa+eIkkr5+2uVQtt+fZa3yX+svdu81F5rd4 SA3dzbAlbIi0B7d6mo0A2vDnvrEfzqny3LPc8TnKqZAua7eE3uHWC4NZ6mut2MyG0dLi d8q9Q1ukzKArgvBuFZMmJZP+nfdueMy1pDv3cFp0yuFUexOyLgOY6WgpKbaIUKqsQlu/ O3/9xRWrTKyyMBADaBP6aRAcN5gkj1kdrq8A9kbJCSnf7dQi1Rmn9d2BM2Nbl+IcJjXp 0NQA== 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 b7-v6si2531925pll.312.2018.01.25.12.17.41; Thu, 25 Jan 2018 12:17:56 -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 S1751411AbeAYUPI (ORCPT + 99 others); Thu, 25 Jan 2018 15:15:08 -0500 Received: from mga14.intel.com ([192.55.52.115]:52332 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751181AbeAYUO2 (ORCPT ); Thu, 25 Jan 2018 15:14:28 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Jan 2018 12:14:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,413,1511856000"; d="scan'208";a="169164992" Received: from otc-lr-04.jf.intel.com ([10.54.39.128]) by orsmga004.jf.intel.com with ESMTP; 25 Jan 2018 12:14:21 -0800 From: kan.liang@intel.com To: tglx@linutronix.de, peterz@infradead.org, mingo@redhat.com, linux-kernel@vger.kernel.org Cc: acme@kernel.org, eranian@google.com, ak@linux.intel.com, Kan Liang Subject: [PATCH V6 7/8] perf/x86/intel/uncore: expose uncore_pmu_event functions Date: Thu, 25 Jan 2018 12:13:47 -0800 Message-Id: <1516911228-5293-7-git-send-email-kan.liang@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516911228-5293-1-git-send-email-kan.liang@intel.com> References: <1516911228-5293-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 V5 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 f38a7bb..fae2836 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