debuggers.hg

changeset 22066:d20cbccb6fea

timers: Improve debug-key printing.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Aug 18 14:22:48 2010 +0100 (2010-08-18)
parents 5218db847b58
children 28546f5ec0eb
files xen/common/timer.c
line diff
     1.1 --- a/xen/common/timer.c	Tue Aug 17 19:32:37 2010 +0100
     1.2 +++ b/xen/common/timer.c	Wed Aug 18 14:22:48 2010 +0100
     1.3 @@ -19,6 +19,7 @@
     1.4  #include <xen/keyhandler.h>
     1.5  #include <xen/percpu.h>
     1.6  #include <xen/cpu.h>
     1.7 +#include <xen/symbols.h>
     1.8  #include <asm/system.h>
     1.9  #include <asm/desc.h>
    1.10  
    1.11 @@ -533,6 +534,13 @@ s_time_t align_timer(s_time_t firsttick,
    1.12      return firsttick + (period - 1) - ((firsttick - 1) % period);
    1.13  }
    1.14  
    1.15 +static void dump_timer(struct timer *t, s_time_t now)
    1.16 +{
    1.17 +    printk("  ex=%8ldus timer=%p cb=%p(%p)",
    1.18 +           (t->expires - now) / 1000, t, t->function, t->data);
    1.19 +    print_symbol(" %s\n", (unsigned long)t->function);
    1.20 +}
    1.21 +
    1.22  static void dump_timerq(unsigned char key)
    1.23  {
    1.24      struct timer  *t;
    1.25 @@ -541,28 +549,19 @@ static void dump_timerq(unsigned char ke
    1.26      s_time_t       now = NOW();
    1.27      int            i, j;
    1.28  
    1.29 -    printk("Dumping timer queues: NOW=0x%08X%08X\n",
    1.30 -           (u32)(now>>32), (u32)now);
    1.31 +    printk("Dumping timer queues:\n");
    1.32  
    1.33      for_each_online_cpu( i )
    1.34      {
    1.35          ts = &per_cpu(timers, i);
    1.36  
    1.37 -        printk("CPU[%02d] ", i);
    1.38 +        printk("CPU%02d:\n", i);
    1.39          spin_lock_irqsave(&ts->lock, flags);
    1.40          for ( j = 1; j <= GET_HEAP_SIZE(ts->heap); j++ )
    1.41 -        {
    1.42 -            t = ts->heap[j];
    1.43 -            printk ("  %d : %p ex=0x%08X%08X %p %p\n",
    1.44 -                    j, t, (u32)(t->expires>>32), (u32)t->expires,
    1.45 -                    t->data, t->function);
    1.46 -        }
    1.47 +            dump_timer(ts->heap[j], now);
    1.48          for ( t = ts->list, j = 0; t != NULL; t = t->list_next, j++ )
    1.49 -            printk (" L%d : %p ex=0x%08X%08X %p %p\n",
    1.50 -                    j, t, (u32)(t->expires>>32), (u32)t->expires,
    1.51 -                    t->data, t->function);
    1.52 +            dump_timer(t, now);
    1.53          spin_unlock_irqrestore(&ts->lock, flags);
    1.54 -        printk("\n");
    1.55      }
    1.56  }
    1.57