From patchwork Mon Aug 23 10:46:19 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Fleming X-Patchwork-Id: 123831 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o7NAkOs7015425 for ; Mon, 23 Aug 2010 10:46:24 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752110Ab0HWKqW (ORCPT ); Mon, 23 Aug 2010 06:46:22 -0400 Received: from arkanian.console-pimps.org ([212.110.184.194]:53497 "EHLO arkanian.console-pimps.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751589Ab0HWKqW (ORCPT ); Mon, 23 Aug 2010 06:46:22 -0400 Received: by arkanian.console-pimps.org (Postfix, from userid 1000) id 1E9622E789; Mon, 23 Aug 2010 11:46:21 +0100 (BST) From: Matt Fleming To: linux-kernel@vger.kernel.org Cc: Robert Richter , Will Deacon , Paul Mundt , Russell King , linux-arm-kernel@lists.infradead.org, linux-sh@vger.kernel.org, Peter Zijlstra , Ingo Molnar , Frederic Weisbecker , Arnaldo Carvalho de Melo Subject: [PATCH 1/3] sh: Accessor functions for the sh_pmu state Date: Mon, 23 Aug 2010 11:46:19 +0100 Message-Id: <1282560381-7700-2-git-send-email-matt@console-pimps.org> X-Mailer: git-send-email 1.7.2.2.162.g5cba1 In-Reply-To: <1282560381-7700-1-git-send-email-matt@console-pimps.org> References: <1282560381-7700-1-git-send-email-matt@console-pimps.org> Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Mon, 23 Aug 2010 10:46:24 +0000 (UTC) diff --git a/arch/sh/include/asm/perf_event.h b/arch/sh/include/asm/perf_event.h index 3d0c9f3..5b7fa84 100644 --- a/arch/sh/include/asm/perf_event.h +++ b/arch/sh/include/asm/perf_event.h @@ -25,6 +25,8 @@ struct sh_pmu { extern int register_sh_pmu(struct sh_pmu *); extern int reserve_pmc_hardware(void); extern void release_pmc_hardware(void); +extern int sh_pmu_num_events(void); +extern const char *sh_pmu_name(void); static inline void set_perf_event_pending(void) { diff --git a/arch/sh/kernel/perf_event.c b/arch/sh/kernel/perf_event.c index 7a3dc35..086f788 100644 --- a/arch/sh/kernel/perf_event.c +++ b/arch/sh/kernel/perf_event.c @@ -60,6 +60,19 @@ static inline int sh_pmu_initialized(void) } /* + * Return the number of events for the current sh_pmu. + */ +int sh_pmu_num_events(void) +{ + return sh_pmu->num_events; +} + +const char *sh_pmu_name(void) +{ + return sh_pmu->name; +} + +/* * Release the PMU if this is the last perf_event. */ static void hw_perf_event_destroy(struct perf_event *event)