Received: by 10.223.164.221 with SMTP id h29csp2610877wrb; Thu, 2 Nov 2017 14:04:10 -0700 (PDT) X-Google-Smtp-Source: ABhQp+QgG75lTt7OOnchD057Y2NTx88DxHKMYKQ0Arqh1zHH5zYw3Ec/0UqN9YRmfyZ8t3nncgkS X-Received: by 10.159.216.141 with SMTP id s13mr4605530plp.377.1509656650511; Thu, 02 Nov 2017 14:04:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509656650; cv=none; d=google.com; s=arc-20160816; b=QLQ+QKFZye5i1SiNnS0B5UbgyWycXFcUCYIKS+oN4s813xTzNI425JIaE5VDXcYHO6 gvGdwtxrquXHWdO0hiA8BK3My0Wnn8Yv8SjtG9FoSP3UiY91LKEsHIIvtKYNmE1/JqV5 6cnok/sEk+c4QMqVmu5EznWgq9IiqV49RFbEbqQTTWW7rr1jigQ4UtgOmO5EP/edUTba s2i+A3lpqbJ5b1Rc46fd49yrP9TCliqWQuPkQKYPPlNOZFo8oD8FmrM6LxJNWMyURuiS G6s5NdRfRtuFrpL5nqpvZ+hZzvvYCjrZU+dMT3R4CKgUNTJP0IhdWREKxrgsT3gPKsYt 8lWg== 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=Apg0WwergvvC7Bj0MzNhxgWJU5cu/1Vu13V0Rd7xaeg=; b=aWw632brjCCSEJIlVaNLMv9XXiMAMSwwjADZ1YRMs7cUawlhKbY7IK+zR8dlKEGLIe txcepBHDRPHGNk4qMwLOvpdWqnVFCkRB4KY8eW1BkQQkTlgoNM89gnnpraTkUyxS44AZ S2kQ4l9BSywMeWxpGyAeKZNBxnE8XIofbLXts2YVBJCu2Q7UghXowrnIolHJftpC0CPF YWWwgmYHiPCnArlIoNkkhjld8O9+APD2EUadRfnvOvO/zVEizl/+K9SJFXKKk7rQl18q wCTZqGmfLKQnnHwvVWclx0iNRrw/tRgGW16jeVirz/hgPAg+CXEUyX6SlmSdFI3B81SS a7gg== 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 26si4371788pfp.127.2017.11.02.14.03.54; Thu, 02 Nov 2017 14:04:10 -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 S964908AbdKBUa1 (ORCPT + 99 others); Thu, 2 Nov 2017 16:30:27 -0400 Received: from mga11.intel.com ([192.55.52.93]:17873 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964861AbdKBUaZ (ORCPT ); Thu, 2 Nov 2017 16:30:25 -0400 Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Nov 2017 13:30:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,335,1505804400"; d="scan'208";a="145287054" Received: from otc-lr-04.jf.intel.com ([10.54.39.138]) by orsmga004.jf.intel.com with ESMTP; 02 Nov 2017 13:30:22 -0700 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 V4 7/8] perf/x86/intel/uncore: expose uncore_pmu_event functions Date: Thu, 2 Nov 2017 13:29:52 -0700 Message-Id: <1509654593-4446-7-git-send-email-kan.liang@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1509654593-4446-1-git-send-email-kan.liang@intel.com> References: <1509654593-4446-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. Signed-off-by: Kan Liang --- No changes since V3 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 9849ba1..77cc975 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 a508bc5..abb6e9a 100644 --- a/arch/x86/events/intel/uncore.h +++ b/arch/x86/events/intel/uncore.h @@ -461,6 +461,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 From 1583076990350030934@xxx Fri Nov 03 20:11:06 +0000 2017 X-GM-THRID: 1583076990350030934 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread