Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5df7fa1c62146a0933767d040d400013310dbcc7
Commit:     5df7fa1c62146a0933767d040d400013310dbcc7
Parent:     1001d0a9ee74a468077dfd4da0565174e88de26b
Author:     Thomas Gleixner <[EMAIL PROTECTED]>
AuthorDate: Fri Feb 1 17:45:14 2008 +0100
Committer:  Ingo Molnar <[EMAIL PROTECTED]>
CommitDate: Fri Feb 1 17:45:14 2008 +0100

    tick-sched: add more debug information
    
    To allow better diagnosis of tick-sched related, especially NOHZ
    related problems, we need to know when the last wakeup via an irq
    happened and when the CPU left the idle state.
    
    Add two fields (idle_waketime, idle_exittime) to the tick_sched
    structure and add them to the timer_list output.
    
    Signed-off-by: Thomas Gleixner <[EMAIL PROTECTED]>
    Signed-off-by: Ingo Molnar <[EMAIL PROTECTED]>
---
 include/linux/tick.h     |    4 ++++
 kernel/time/tick-sched.c |    2 ++
 kernel/time/timer_list.c |    2 ++
 3 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/include/linux/tick.h b/include/linux/tick.h
index 0fadf95..a881c65 100644
--- a/include/linux/tick.h
+++ b/include/linux/tick.h
@@ -39,6 +39,8 @@ enum tick_nohz_mode {
  * @idle_calls:                Total number of idle calls
  * @idle_sleeps:       Number of idle calls, where the sched tick was stopped
  * @idle_entrytime:    Time when the idle call was entered
+ * @idle_waketime:     Time when the idle was interrupted
+ * @idle_exittime:     Time when the idle state was left
  * @idle_sleeptime:    Sum of the time slept in idle with sched tick stopped
  * @sleep_length:      Duration of the current idle sleep
  */
@@ -53,6 +55,8 @@ struct tick_sched {
        unsigned long                   idle_sleeps;
        int                             idle_active;
        ktime_t                         idle_entrytime;
+       ktime_t                         idle_waketime;
+       ktime_t                         idle_exittime;
        ktime_t                         idle_sleeptime;
        ktime_t                         idle_lastupdate;
        ktime_t                         sleep_length;
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index 63f24b5..88267f0 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -137,6 +137,7 @@ void tick_nohz_update_jiffies(void)
 
        cpu_clear(cpu, nohz_cpu_mask);
        now = ktime_get();
+       ts->idle_waketime = now;
 
        local_irq_save(flags);
        tick_do_update_jiffies64(now);
@@ -400,6 +401,7 @@ void tick_nohz_restart_sched_tick(void)
         * Cancel the scheduled timer and restore the tick
         */
        ts->tick_stopped  = 0;
+       ts->idle_exittime = now;
        hrtimer_cancel(&ts->sched_timer);
        ts->sched_timer.expires = ts->idle_tick;
 
diff --git a/kernel/time/timer_list.c b/kernel/time/timer_list.c
index 12c5f4c..d3d94c1 100644
--- a/kernel/time/timer_list.c
+++ b/kernel/time/timer_list.c
@@ -166,6 +166,8 @@ static void print_cpu(struct seq_file *m, int cpu, u64 now)
                P(idle_calls);
                P(idle_sleeps);
                P_ns(idle_entrytime);
+               P_ns(idle_waketime);
+               P_ns(idle_exittime);
                P_ns(idle_sleeptime);
                P(last_jiffies);
                P(next_jiffies);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to