Commit 1b48142a authored by Aaro Koskinen's avatar Aaro Koskinen Committed by Ralf Baechle
Browse files

MIPS: oprofile: Enable backtrace on timer-based profiling



Allow unsupported CPU types to use backtrace with timer-based profiling.
Some CPUs (notably OCTEON) lack architecture-specific oprofile driver. In
such case oprofile can fallback to timer-based mode, and arch code can
still provide the backtrace functionality. So just set up the backtrace
hook always.

Signed-off-by: default avatarAaro Koskinen <aaro.koskinen@nsn.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/8108/


Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent 26b40ef1
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -110,6 +110,12 @@ int __init oprofile_arch_init(struct oprofile_operations *ops)
		break;
	};

	/*
	 * Always set the backtrace. This allows unsupported CPU types to still
	 * use timer-based oprofile.
	 */
	ops->backtrace = op_mips_backtrace;

	if (!lmodel)
		return -ENODEV;

@@ -125,7 +131,6 @@ int __init oprofile_arch_init(struct oprofile_operations *ops)
	ops->start		= op_mips_start;
	ops->stop		= op_mips_stop;
	ops->cpu_type		= lmodel->cpu_type;
	ops->backtrace		= op_mips_backtrace;

	printk(KERN_INFO "oprofile: using %s performance monitoring.\n",
	       lmodel->cpu_type);