From patchwork Mon Sep 13 06:07:33 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Fleming X-Patchwork-Id: 173812 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o8D67gJ3013302 for ; Mon, 13 Sep 2010 06:07:43 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752662Ab0IMGHm (ORCPT ); Mon, 13 Sep 2010 02:07:42 -0400 Received: from arkanian.console-pimps.org ([212.110.184.194]:39300 "EHLO arkanian.console-pimps.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751962Ab0IMGHk (ORCPT ); Mon, 13 Sep 2010 02:07:40 -0400 Received: by arkanian.console-pimps.org (Postfix, from userid 1002) id BEB914808A; Mon, 13 Sep 2010 07:07:39 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on arkanian.vm.bytemark.co.uk X-Spam-Level: X-Spam-Status: No, score=-4.2 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from localhost (cpc5-brad6-0-0-cust25.barn.cable.virginmedia.com [82.38.64.26]) by arkanian.console-pimps.org (Postfix) with ESMTPSA id 0975144330; Mon, 13 Sep 2010 07:07:39 +0100 (BST) From: Matt Fleming To: Robert Richter Cc: 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 , linux-arch@vger.kernel.org Subject: [PATCH 2/6] ARM: oprofile: Rename op_arm to oprofile_perf Date: Mon, 13 Sep 2010 07:07:33 +0100 Message-Id: <61369979994f435ba2ac62f06717644d722ee002.1284357372.git.matt@console-pimps.org> X-Mailer: git-send-email 1.7.1 In-Reply-To: References: In-Reply-To: References: 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 (demeter1.kernel.org [140.211.167.41]); Mon, 13 Sep 2010 06:07:44 +0000 (UTC) diff --git a/arch/arm/oprofile/common.c b/arch/arm/oprofile/common.c index 6498e58..ed8291a 100644 --- a/arch/arm/oprofile/common.c +++ b/arch/arm/oprofile/common.c @@ -38,8 +38,8 @@ struct op_counter_config { struct perf_event_attr attr; }; -static int op_arm_enabled; -static DEFINE_MUTEX(op_arm_mutex); +static int oprofile_perf_enabled; +static DEFINE_MUTEX(oprofile_perf_mutex); static struct op_counter_config *counter_config; static struct perf_event **perf_events[nr_cpumask_bits]; @@ -65,7 +65,7 @@ static void op_overflow_handler(struct perf_event *event, int unused, } /* - * Called by op_arm_setup to create perf attributes to mirror the oprofile + * Called by oprofile_perf_setup to create perf attributes to mirror the oprofile * settings in counter_config. Attributes are created as `pinned' events and * so are permanently scheduled on the PMU. */ @@ -122,7 +122,7 @@ static void op_destroy_counter(int cpu, int event) } /* - * Called by op_arm_start to create active perf events based on the + * Called by oprofile_perf_start to create active perf events based on the * perviously configured attributes. */ static int op_perf_start(void) @@ -142,7 +142,7 @@ out: } /* - * Called by op_arm_stop at the end of a profiling run. + * Called by oprofile_perf_stop at the end of a profiling run. */ static void op_perf_stop(void) { @@ -174,7 +174,7 @@ static char *op_name_from_perf_id(enum arm_perf_pmu_ids id) } } -static int op_arm_create_files(struct super_block *sb, struct dentry *root) +static int oprofile_perf_create_files(struct super_block *sb, struct dentry *root) { unsigned int i; @@ -195,7 +195,7 @@ static int op_arm_create_files(struct super_block *sb, struct dentry *root) return 0; } -static int op_arm_setup(void) +static int oprofile_perf_setup(void) { spin_lock(&oprofilefs_lock); op_perf_setup(); @@ -203,54 +203,54 @@ static int op_arm_setup(void) return 0; } -static int op_arm_start(void) +static int oprofile_perf_start(void) { int ret = -EBUSY; - mutex_lock(&op_arm_mutex); - if (!op_arm_enabled) { + mutex_lock(&oprofile_perf_mutex); + if (!oprofile_perf_enabled) { ret = 0; op_perf_start(); - op_arm_enabled = 1; + oprofile_perf_enabled = 1; } - mutex_unlock(&op_arm_mutex); + mutex_unlock(&oprofile_perf_mutex); return ret; } -static void op_arm_stop(void) +static void oprofile_perf_stop(void) { - mutex_lock(&op_arm_mutex); - if (op_arm_enabled) + mutex_lock(&oprofile_perf_mutex); + if (oprofile_perf_enabled) op_perf_stop(); - op_arm_enabled = 0; - mutex_unlock(&op_arm_mutex); + oprofile_perf_enabled = 0; + mutex_unlock(&oprofile_perf_mutex); } #ifdef CONFIG_PM -static int op_arm_suspend(struct platform_device *dev, pm_message_t state) +static int oprofile_perf_suspend(struct platform_device *dev, pm_message_t state) { - mutex_lock(&op_arm_mutex); - if (op_arm_enabled) + mutex_lock(&oprofile_perf_mutex); + if (oprofile_perf_enabled) op_perf_stop(); - mutex_unlock(&op_arm_mutex); + mutex_unlock(&oprofile_perf_mutex); return 0; } -static int op_arm_resume(struct platform_device *dev) +static int oprofile_perf_resume(struct platform_device *dev) { - mutex_lock(&op_arm_mutex); - if (op_arm_enabled && op_perf_start()) - op_arm_enabled = 0; - mutex_unlock(&op_arm_mutex); + mutex_lock(&oprofile_perf_mutex); + if (oprofile_perf_enabled && op_perf_start()) + oprofile_perf_enabled = 0; + mutex_unlock(&oprofile_perf_mutex); return 0; } static struct platform_driver oprofile_driver = { .driver = { - .name = "arm-oprofile", + .name = "perf-oprofile", }, - .resume = op_arm_resume, - .suspend = op_arm_suspend, + .resume = oprofile_perf_resume, + .suspend = oprofile_perf_suspend, }; static struct platform_device *oprofile_pdev; @@ -378,11 +378,11 @@ int __init oprofile_arch_init(struct oprofile_operations *ops) } ops->backtrace = arm_backtrace; - ops->create_files = op_arm_create_files; - ops->setup = op_arm_setup; - ops->start = op_arm_start; - ops->stop = op_arm_stop; - ops->shutdown = op_arm_stop; + ops->create_files = oprofile_perf_create_files; + ops->setup = oprofile_perf_setup; + ops->start = oprofile_perf_start; + ops->stop = oprofile_perf_stop; + ops->shutdown = oprofile_perf_stop; ops->cpu_type = op_name_from_perf_id(armpmu_get_pmu_id()); if (!ops->cpu_type)