Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 56946331 authored by Matt Fleming's avatar Matt Fleming Committed by Robert Richter
Browse files

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: default avatarMatt Fleming <matt@console-pimps.org>
Signed-off-by: default avatarRobert Richter <robert.richter@amd.com>
parent 84c79910
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -155,8 +155,10 @@ static void op_perf_stop(void)
}
}




static char *op_name_from_perf_id(enum arm_perf_pmu_ids id)
char *op_name_from_perf_id(void)
{
{
	enum arm_perf_pmu_ids id = armpmu_get_pmu_id();

	switch (id) {
	switch (id) {
	case ARM_PERF_PMU_ID_XSCALE1:
	case ARM_PERF_PMU_ID_XSCALE1:
		return "arm/xscale1";
		return "arm/xscale1";
@@ -391,7 +393,7 @@ int __init oprofile_arch_init(struct oprofile_operations *ops)
	ops->start		= op_arm_start;
	ops->start		= op_arm_start;
	ops->stop		= op_arm_stop;
	ops->stop		= op_arm_stop;
	ops->shutdown		= op_arm_stop;
	ops->shutdown		= op_arm_stop;
	ops->cpu_type		= op_name_from_perf_id(armpmu_get_pmu_id());
	ops->cpu_type		= op_name_from_perf_id();


	if (!ops->cpu_type)
	if (!ops->cpu_type)
		ret = -ENODEV;
		ret = -ENODEV;
+4 −0
Original line number Original line Diff line number Diff line
@@ -185,4 +185,8 @@ int oprofile_add_data(struct op_entry *entry, unsigned long val);
int oprofile_add_data64(struct op_entry *entry, u64 val);
int oprofile_add_data64(struct op_entry *entry, u64 val);
int oprofile_write_commit(struct op_entry *entry);
int oprofile_write_commit(struct op_entry *entry);


#ifdef CONFIG_PERF_EVENTS
char *op_name_from_perf_id(void);
#endif /* CONFIG_PERF_EVENTS */

#endif /* OPROFILE_H */
#endif /* OPROFILE_H */