Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 211917
b: refs/heads/master
c: 80e96b1
h: refs/heads/master
i:
  211915: 62588df
v: v3
  • Loading branch information
Matt Fleming authored and Robert Richter committed Oct 11, 2010
1 parent 47bfab1 commit f10e5de
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 35 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 56946331b28d53232115a155ba662ab3dc598952
refs/heads/master: 80e96b11f6cd261e1e569f3931604d656388af33
68 changes: 34 additions & 34 deletions trunk/arch/arm/oprofile/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand All @@ -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.
*/
Expand Down Expand Up @@ -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)
Expand All @@ -143,7 +143,7 @@ static int op_perf_start(void)
}

/*
* 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)
{
Expand Down Expand Up @@ -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;

Expand All @@ -198,62 +198,62 @@ 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();
spin_unlock(&oprofilefs_lock);
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;
Expand Down Expand Up @@ -388,11 +388,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();

if (!ops->cpu_type)
Expand Down

0 comments on commit f10e5de

Please sign in to comment.