linux-2.6.22.1/kernel/time/timer_list.c
static void print_active_timers(struct seq_file *m,
struct hrtimer_clock_base *base, u64 now)
{
struct hrtimer *timer, tmp;
unsigned long next = 0, i;
struct rb_node *curr;
unsigned long flags;
next_one:
i = 0;
spin_lock_irqsave(&base->cpu_base->lock, flags);
curr = base->first;
/*
* Crude but we have to do this O(N*N) thing, because
* we have to unlock the base when printing:
*/
while (curr && i < next) {
curr = rb_next(curr);
i++;
}
if (curr) {
timer = rb_entry(curr, struct hrtimer, node);
tmp = *timer;
spin_unlock_irqrestore(&base->cpu_base->lock, flags);
/*
* yeah Ingo Molnar, ifuleu,
* but print shows not timer but tmp,
* how can i see %p timer??
*/
print_timer(m, &tmp, i, now);
next++;
goto next_one;
}
spin_unlock_irqrestore(&base->cpu_base->lock, flags);
}