[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <4A17014C.7080305@am.sony.com>
Date: Fri, 22 May 2009 12:47:24 -0700
From: Tim Bird <tim.bird@...sony.com>
To: linux kernel <linux-kernel@...r.kernel.org>
CC: Kevin Hilman <khilman@...prootsystems.com>,
linux-arm-kernel <linux-arm-kernel@...ts.arm.linux.org.uk>,
linux-omap-open-source@...ux.omap.com
Subject: [PATCH] omap: add sched_clock for omap1 based on MPU timer
Define a higher-resolution sched_clock for OMAP
using the MPU timer, when it is configured on.
This produces better results from ftrace.
Signed-off-by: Tim Bird <tim.bird@...sony.com>
---
arch/arm/mach-omap1/time.c | 9 +++++++++
arch/arm/plat-omap/common.c | 2 ++
2 files changed, 11 insertions(+)
--- a/arch/arm/mach-omap1/time.c
+++ b/arch/arm/mach-omap1/time.c
@@ -212,6 +212,15 @@ static struct clocksource clocksource_mp
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
};
+unsigned long long notrace sched_clock(void)
+{
+ unsigned long long ret;
+
+ ret = (unsigned long long) ~omap_mpu_timer_read(1);
+ ret = (ret * clocksource_mpu.mult_orig) >> clocksource_mpu.shift;
+ return ret;
+}
+
static void __init omap_init_clocksource(unsigned long rate)
{
static char err[] __initdata = KERN_ERR
--- a/arch/arm/plat-omap/common.c
+++ b/arch/arm/plat-omap/common.c
@@ -199,6 +199,7 @@ static struct clocksource clocksource_32
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
};
+#ifndef CONFIG_OMAP_MPU_TIMER
/*
* Returns current time from boot in nsecs. It's OK for this to wrap
* around for now, as it's just a relative time stamp.
@@ -211,6 +212,7 @@ unsigned long long notrace sched_clock(v
ret = (ret * clocksource_32k.mult_orig) >> clocksource_32k.shift;
return ret;
}
+#endif
static int __init omap_init_clocksource_32k(void)
{
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists