Commit c6a3c851 authored by David Daney's avatar David Daney Committed by Ralf Baechle

MIPS: Octeon: Add sched_clock() to csrc-octeon.c

With the advent of function graph tracing on MIPS, Octeon needs a high
precision sched_clock() implementation.  Without it, most timing
numbers are reported as 0.000.

This new sched_clock just uses the 64-bit cycle counter appropriately
scaled.
Signed-off-by: default avatarDavid Daney <ddaney@caviumnetworks.com>
Patchwork: http://patchwork.linux-mips.org/patch/805/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent 98bea6fc
...@@ -50,6 +50,13 @@ static struct clocksource clocksource_mips = { ...@@ -50,6 +50,13 @@ static struct clocksource clocksource_mips = {
.flags = CLOCK_SOURCE_IS_CONTINUOUS, .flags = CLOCK_SOURCE_IS_CONTINUOUS,
}; };
unsigned long long notrace sched_clock(void)
{
return clocksource_cyc2ns(read_c0_cvmcount(),
clocksource_mips.mult,
clocksource_mips.shift);
}
void __init plat_time_init(void) void __init plat_time_init(void)
{ {
clocksource_mips.rating = 300; clocksource_mips.rating = 300;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment