Module: xenomai-head
Branch: master
Commit: e6cab9c28fc371a55a2d7c4df40851894d765809
URL:    
http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=e6cab9c28fc371a55a2d7c4df40851894d765809

Author: Jan Kiszka <jan.kis...@siemens.com>
Date:   Fri Jun 17 09:46:19 2011 +0200

nucleus: Clean up stat switching in xnintr_clock_handler

As we know on entry of xnintr_clock_handler the this handler is going to
be charged for the processing, we can use non-lazy switching. Move
xnstat_counter_inc to the corresponding xnstat_exectime_switch to make
use of the hotter cache.

Signed-off-by: Jan Kiszka <jan.kis...@siemens.com>

---

 ksrc/nucleus/intr.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/ksrc/nucleus/intr.c b/ksrc/nucleus/intr.c
index af17101..43a6a63 100644
--- a/ksrc/nucleus/intr.c
+++ b/ksrc/nucleus/intr.c
@@ -97,8 +97,9 @@ void xnintr_clock_handler(void)
        xnstat_exectime_t *prev;
        xnticks_t start;
 
-       prev  = xnstat_exectime_get_current(sched);
-       start = xnstat_exectime_now();
+       prev = xnstat_exectime_switch(sched,
+               &nkclock.stat[xnsched_cpu(sched)].account);
+       xnstat_counter_inc(&nkclock.stat[xnsched_cpu(sched)].hits);
 
        xnarch_announce_tick();
 
@@ -112,10 +113,6 @@ void xnintr_clock_handler(void)
        xntimer_tick_aperiodic();
        xnlock_put(&nklock);
 
-       xnstat_counter_inc(&nkclock.stat[xnsched_cpu(sched)].hits);
-       xnstat_exectime_lazy_switch(sched,
-               &nkclock.stat[xnsched_cpu(sched)].account, start);
-
        xnstat_exectime_switch(sched, prev);
 
        if (--sched->inesting == 0) {


_______________________________________________
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git

Reply via email to