Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Matt Fleming and committed by
Robert Richter
56946331 84c79910

+8 -2
+4 -2
arch/arm/oprofile/common.c
··· 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"; ··· 393 391 ops->start = op_arm_start; 394 392 ops->stop = op_arm_stop; 395 393 ops->shutdown = op_arm_stop; 396 - ops->cpu_type = op_name_from_perf_id(armpmu_get_pmu_id()); 394 + ops->cpu_type = op_name_from_perf_id(); 397 395 398 396 if (!ops->cpu_type) 399 397 ret = -ENODEV;
+4
include/linux/oprofile.h
··· 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 */