Skip to content

Commit dc1e7dc

Browse files
anna-marialxKAGA-KOKO
authored andcommitted
timer: Move trace point to get proper index
When placing the timer_start trace point before the timer wheel bucket index is calculated, the index information in the trace point is useless. It is not possible to simply move the debug_activate() call after the index calculation, because debug_object_activate() needs to be called before touching the object. Therefore split debug_activate() and move the trace point into enqueue_timer() after the new index has been calculated. The debug_object_activate() call remains at the original place. Signed-off-by: Anna-Maria Gleixner <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Cc: [email protected] Cc: [email protected] Cc: Steven Rostedt <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent d6b87ea commit dc1e7dc

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

kernel/time/timer.c

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,8 @@ static void enqueue_timer(struct timer_base *base, struct timer_list *timer,
536536
hlist_add_head(&timer->entry, base->vectors + idx);
537537
__set_bit(idx, base->pending_map);
538538
timer_set_idx(timer, idx);
539+
540+
trace_timer_start(timer, timer->expires, timer->flags);
539541
}
540542

541543
static void
@@ -757,13 +759,6 @@ static inline void debug_init(struct timer_list *timer)
757759
trace_timer_init(timer);
758760
}
759761

760-
static inline void
761-
debug_activate(struct timer_list *timer, unsigned long expires)
762-
{
763-
debug_timer_activate(timer);
764-
trace_timer_start(timer, expires, timer->flags);
765-
}
766-
767762
static inline void debug_deactivate(struct timer_list *timer)
768763
{
769764
debug_timer_deactivate(timer);
@@ -1037,7 +1032,7 @@ __mod_timer(struct timer_list *timer, unsigned long expires, unsigned int option
10371032
}
10381033
}
10391034

1040-
debug_activate(timer, expires);
1035+
debug_timer_activate(timer);
10411036

10421037
timer->expires = expires;
10431038
/*
@@ -1171,7 +1166,7 @@ void add_timer_on(struct timer_list *timer, int cpu)
11711166
}
11721167
forward_timer_base(base);
11731168

1174-
debug_activate(timer, timer->expires);
1169+
debug_timer_activate(timer);
11751170
internal_add_timer(base, timer);
11761171
raw_spin_unlock_irqrestore(&base->lock, flags);
11771172
}

0 commit comments

Comments
 (0)