aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Fleming <matt@console-pimps.org>2010-10-08 16:42:17 -0400
committerRobert Richter <robert.richter@amd.com>2010-10-11 11:46:15 -0400
commit56946331b28d53232115a155ba662ab3dc598952 (patch)
treef0534248dc0638894e72e60c16cfb3e8790e48e7
parent84c7991059c9c4530cc911137c5bf508a41ed129 (diff)
oprofile: Make op_name_from_perf_id() global
Make op_name_from_perf_id() global so that we have a way for each architecture to construct an oprofile name for op->cpu_type. We need to remove the argument from the function prototype so that we can hide all implementation details inside the function. Signed-off-by: Matt Fleming <matt@console-pimps.org> Signed-off-by: Robert Richter <robert.richter@amd.com>
-rw-r--r--arch/arm/oprofile/common.c6
-rw-r--r--include/linux/oprofile.h4
2 files changed, 8 insertions, 2 deletions
diff --git a/arch/arm/oprofile/common.c b/arch/arm/oprofile/common.c
index 1e971a7fcf82..4f67cfab2c59 100644
--- a/arch/arm/oprofile/common.c
+++ b/arch/arm/oprofile/common.c
@@ -155,8 +155,10 @@ static void op_perf_stop(void)
155} 155}
156 156
157 157
158static char *op_name_from_perf_id(enum arm_perf_pmu_ids id) 158char *op_name_from_perf_id(void)
159{ 159{
160 enum arm_perf_pmu_ids id = armpmu_get_pmu_id();
161
160 switch (id) { 162 switch (id) {
161 case ARM_PERF_PMU_ID_XSCALE1: 163 case ARM_PERF_PMU_ID_XSCALE1:
162 return "arm/xscale1"; 164 return "arm/xscale1";
@@ -391,7 +393,7 @@ int __init oprofile_arch_init(struct oprofile_operations *ops)
391 ops->start = op_arm_start; 393 ops->start = op_arm_start;
392 ops->stop = op_arm_stop; 394 ops->stop = op_arm_stop;
393 ops->shutdown = op_arm_stop; 395 ops->shutdown = op_arm_stop;
394 ops->cpu_type = op_name_from_perf_id(armpmu_get_pmu_id()); 396 ops->cpu_type = op_name_from_perf_id();
395 397
396 if (!ops->cpu_type) 398 if (!ops->cpu_type)
397 ret = -ENODEV; 399 ret = -ENODEV;
diff --git a/include/linux/oprofile.h b/include/linux/oprofile.h
index 5171639ecf0f..1574d4aca721 100644
--- a/include/linux/oprofile.h
+++ b/include/linux/oprofile.h
@@ -185,4 +185,8 @@ int oprofile_add_data(struct op_entry *entry, unsigned long val);
185int oprofile_add_data64(struct op_entry *entry, u64 val); 185int oprofile_add_data64(struct op_entry *entry, u64 val);
186int oprofile_write_commit(struct op_entry *entry); 186int oprofile_write_commit(struct op_entry *entry);
187 187
188#ifdef CONFIG_PERF_EVENTS
189char *op_name_from_perf_id(void);
190#endif /* CONFIG_PERF_EVENTS */
191
188#endif /* OPROFILE_H */ 192#endif /* OPROFILE_H */