Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp557324imm; Thu, 31 May 2018 05:35:12 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJsGhunhZ8DcZRKXJ/Im8G0cKSGMGJ5h6mQNMEc9o39aUQdjd+zLdNsb5MYDJnELHd6v+3N X-Received: by 2002:a63:7943:: with SMTP id u64-v6mr5416827pgc.151.1527770112806; Thu, 31 May 2018 05:35:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527770112; cv=none; d=google.com; s=arc-20160816; b=JnpQyW3e4ucwVICab87AjXzjhvRIq2JgcwjKHP3YC0cAD6THofSiB0/ZWRy3s3Gjnp +EwssoJPfyg3OWzrhA+mdGx+6ehDDVYklXkMtpC5rqStiIXmRnM6pOhePI29BUSfjqCo FE46iKaqrYFCywmBntxAzM1lv8/e5jSmT+4VDP/Y+wlJffVQXCINaL06/P0nk5WAeHtj c5I8TYqUq/oj9F0rRQxO04cuIP87YkuLNH/epPwdhehLWJb2m9dsP8ByevQt57OQhCnC ggyGCvKMXiuhQX+mAwG5iQthuFc+IE0HogrPHwcoQGmipNEx7k69r/Bg+P4QD9VpoQ1c B6Ow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:arc-authentication-results; bh=Ggs3XWQ9KDUhf2YUrYTVsAAysBZzjYQw5ZZ4grsMZWg=; b=Q61F/RhCadpAz0t4xzBpuJHJ0ebz6VU3oPnMUSdzoNmXl04HYhL//XEdX8T6l5FLfz vLTR4IwFU21A1GpVQKKax58IWb9zWSm8y5xOEgNK7b6IP9u5ipe9d51PW0XEtsmr7ipc jGFAmsEhaedSUTjyOeviu1z5vOGFUYM3mxce98qQP/ORH0pOpu8LpTHhx+NKPPwIYqTF crljKyeXONcIhFEYnTyCVkyxgVK47CEyhhK/du8CqmiXKxTeyziDQBNu/IshIKZtKFZf V7s5gvl+8DDrjlr4YkaxtDIN98j7GB+hxPV8FdNLQbrFB/SmjxWUpiNVD9+ECJpgY/IE QFhg== 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 b8-v6si39164685pls.261.2018.05.31.05.34.58; Thu, 31 May 2018 05:35:12 -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 S1755050AbeEaMd3 (ORCPT + 99 others); Thu, 31 May 2018 08:33:29 -0400 Received: from terminus.zytor.com ([198.137.202.136]:46257 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754801AbeEaMd0 (ORCPT ); Thu, 31 May 2018 08:33:26 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id w4VCX6EM3563286 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 31 May 2018 05:33:06 -0700 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w4VCX61T3563283; Thu, 31 May 2018 05:33:06 -0700 Date: Thu, 31 May 2018 05:33:06 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Kan Liang Message-ID: Cc: peterz@infradead.org, torvalds@linux-foundation.org, tglx@linutronix.de, mingo@kernel.org, kan.liang@intel.com, hpa@zytor.com, linux-kernel@vger.kernel.org Reply-To: mingo@kernel.org, peterz@infradead.org, torvalds@linux-foundation.org, tglx@linutronix.de, linux-kernel@vger.kernel.org, hpa@zytor.com, kan.liang@intel.com In-Reply-To: <1525371913-10597-7-git-send-email-kan.liang@intel.com> References: <1525371913-10597-7-git-send-email-kan.liang@intel.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf/x86/intel/uncore: Expose uncore_pmu_event*() functions Git-Commit-ID: 5a6c9d94e9ed7410142bc6fcb638a4db1895aa0c X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-0.7 required=5.0 tests=ALL_TRUSTED,BAYES_00, DATE_IN_FUTURE_48_96 autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 5a6c9d94e9ed7410142bc6fcb638a4db1895aa0c Gitweb: https://git.kernel.org/tip/5a6c9d94e9ed7410142bc6fcb638a4db1895aa0c Author: Kan Liang AuthorDate: Thu, 3 May 2018 11:25:12 -0700 Committer: Ingo Molnar CommitDate: Thu, 31 May 2018 12:36:28 +0200 perf/x86/intel/uncore: Expose uncore_pmu_event*() functions 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. Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Thomas Gleixner Cc: Linus Torvalds Cc: Peter Zijlstra Cc: acme@kernel.org Cc: eranian@google.com Link: http://lkml.kernel.org/r/1525371913-10597-7-git-send-email-kan.liang@intel.com Signed-off-by: Ingo Molnar --- 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 0a6f6973690b..15b07379e72d 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 eb0265359019..c9e1e0bef3c3 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 *