Commit 56946331b28d53232115a155ba662ab3dc598952

Authored by Matt Fleming
Committed by Robert Richter
1 parent 84c7991059

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>

Showing 2 changed files with 8 additions and 2 deletions Side-by-side Diff

arch/arm/oprofile/common.c
... ... @@ -155,8 +155,10 @@
155 155 }
156 156  
157 157  
158   -static char *op_name_from_perf_id(enum arm_perf_pmu_ids id)
  158 +char *op_name_from_perf_id(void)
159 159 {
  160 + enum arm_perf_pmu_ids id = armpmu_get_pmu_id();
  161 +
160 162 switch (id) {
161 163 case ARM_PERF_PMU_ID_XSCALE1:
162 164 return "arm/xscale1";
... ... @@ -391,7 +393,7 @@
391 393 ops->start = op_arm_start;
392 394 ops->stop = op_arm_stop;
393 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 398 if (!ops->cpu_type)
397 399 ret = -ENODEV;
include/linux/oprofile.h
... ... @@ -185,5 +185,9 @@
185 185 int oprofile_add_data64(struct op_entry *entry, u64 val);
186 186 int oprofile_write_commit(struct op_entry *entry);
187 187  
  188 +#ifdef CONFIG_PERF_EVENTS
  189 +char *op_name_from_perf_id(void);
  190 +#endif /* CONFIG_PERF_EVENTS */
  191 +
188 192 #endif /* OPROFILE_H */