aboutsummaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorIvan Khoronzhuk <ivan.khoronzhuk@linaro.org>2015-11-19 16:30:02 +0200
committerMaxim Uvarov <maxim.uvarov@linaro.org>2015-11-30 12:20:38 +0300
commit56e6043816ecbe954e804004f0b13cdad5915341 (patch)
tree8c4fdd121cb698c96e96b6543223645b01d267cc /platform
parentdc8984ae27ba81f76634cf1e58489664dc1569c4 (diff)
linux-generic: odp_timer: warn if tick is late
If tick is late then application should be warned about this. It means that actual timer resolution is worse than expected. The default timer resolution is set 10ms, that is equal to jiffy on most systems. The default resolution is set bearing in mind that on a CPU runs maximum two threads that ideally fits in 10ms. But user can change it to be smaller, in case if CPU0 is isolated and it handles only the timer ticks. This patch helps user to set correct timer resolution. Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org> Reviewed-by: Ola Liljedahl <ola.liljedahl@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'platform')
-rw-r--r--platform/linux-generic/odp_timer.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/platform/linux-generic/odp_timer.c b/platform/linux-generic/odp_timer.c
index e8f026744..407ccc173 100644
--- a/platform/linux-generic/odp_timer.c
+++ b/platform/linux-generic/odp_timer.c
@@ -632,7 +632,14 @@ static unsigned odp_timer_pool_expire(odp_timer_pool_t tpid, uint64_t tick)
static void timer_notify(sigval_t sigval)
{
+ int overrun;
odp_timer_pool *tp = (odp_timer_pool *)sigval.sival_ptr;
+
+ overrun = timer_getoverrun(tp->timerid);
+ if (overrun)
+ ODP_ERR("\n\t%d ticks overrun on timer pool \"%s\", timer resolution too high\n",
+ overrun, tp->name);
+
#ifdef __ARM_ARCH
odp_timer *array = &tp->timers[0];
uint32_t i;