From: matt@console-pimps.org (Matt Fleming)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/7] ARM: oprofile: Rename op_arm to oprofile_perf
Date: Sat, 9 Oct 2010 01:46:19 +0100 [thread overview]
Message-ID: <f4da40c1bd8417534c07532cdfdbca0b9cde262d.1286584677.git.matt@console-pimps.org> (raw)
In-Reply-To: <cover.1286584677.git.matt@console-pimps.org>
In preparation for moving the generic functions out of this file, give
the functions more general names (e.g. remove "arm" from the names).
Signed-off-by: Matt Fleming <matt@console-pimps.org>
Tested-by: Will Deacon <will.deacon@arm.com>
---
arch/arm/oprofile/common.c | 58 ++++++++++++++++++++++----------------------
1 files changed, 29 insertions(+), 29 deletions(-)
diff --git a/arch/arm/oprofile/common.c b/arch/arm/oprofile/common.c
index 4f67cfa..fd6e323 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];
@@ -66,7 +66,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.
*/
@@ -123,7 +123,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)
@@ -143,7 +143,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)
{
@@ -177,7 +177,7 @@ char *op_name_from_perf_id(void)
}
}
-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;
@@ -198,7 +198,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();
@@ -206,54 +206,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 = "oprofile-perf",
},
- .resume = op_arm_resume,
- .suspend = op_arm_suspend,
+ .resume = oprofile_perf_resume,
+ .suspend = oprofile_perf_suspend,
};
static struct platform_device *oprofile_pdev;
--
1.7.1
next prev parent reply other threads:[~2010-10-09 0:46 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-09 0:46 [PATCH V5 0/7] Generalise ARM perf-events backend for oprofile Matt Fleming
2010-10-09 0:46 ` [PATCH 1/7] perf: Add helper function to return number of counters Matt Fleming
2010-10-09 0:46 ` [PATCH 2/7] perf: New helper function for pmu name Matt Fleming
2010-10-11 9:18 ` Robert Richter
2010-10-11 9:31 ` Peter Zijlstra
2010-10-11 15:31 ` Paul Mundt
2010-10-09 0:46 ` [PATCH 3/7] oprofile: Make op_name_from_perf_id() global Matt Fleming
2010-10-09 0:46 ` Matt Fleming [this message]
2010-10-09 0:46 ` [PATCH 5/7] ARM: oprofile: Move non-ARM code into separate init/exit Matt Fleming
2010-10-09 1:26 ` Robert Richter
2010-10-09 1:51 ` Robert Richter
2010-10-09 10:32 ` Matt Fleming
2010-10-09 0:46 ` [PATCH 6/7] oprofile: Abstract the perf-events backend Matt Fleming
2010-10-09 0:46 ` [PATCH 7/7] sh: oprofile: Use perf-events oprofile backend Matt Fleming
2010-10-11 11:06 ` Robert Richter
2010-10-11 11:09 ` Paul Mundt
2010-10-11 18:59 ` [PATCH V5 0/7] Generalise ARM perf-events backend for oprofile Robert Richter
2010-10-11 20:13 ` Matt Fleming
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f4da40c1bd8417534c07532cdfdbca0b9cde262d.1286584677.git.matt@console-pimps.org \
--to=matt@console-pimps.org \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).