|
@@ -48,6 +48,8 @@
|
|
|
|
|
|
#include <asm/uaccess.h>
|
|
#include <asm/uaccess.h>
|
|
|
|
|
|
|
|
+#include <trace/events/timer.h>
|
|
|
|
+
|
|
/*
|
|
/*
|
|
* The timer bases:
|
|
* The timer bases:
|
|
*
|
|
*
|
|
@@ -441,6 +443,26 @@ static inline void debug_hrtimer_activate(struct hrtimer *timer) { }
|
|
static inline void debug_hrtimer_deactivate(struct hrtimer *timer) { }
|
|
static inline void debug_hrtimer_deactivate(struct hrtimer *timer) { }
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
+static inline void
|
|
|
|
+debug_init(struct hrtimer *timer, clockid_t clockid,
|
|
|
|
+ enum hrtimer_mode mode)
|
|
|
|
+{
|
|
|
|
+ debug_hrtimer_init(timer);
|
|
|
|
+ trace_hrtimer_init(timer, clockid, mode);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static inline void debug_activate(struct hrtimer *timer)
|
|
|
|
+{
|
|
|
|
+ debug_hrtimer_activate(timer);
|
|
|
|
+ trace_hrtimer_start(timer);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static inline void debug_deactivate(struct hrtimer *timer)
|
|
|
|
+{
|
|
|
|
+ debug_hrtimer_deactivate(timer);
|
|
|
|
+ trace_hrtimer_cancel(timer);
|
|
|
|
+}
|
|
|
|
+
|
|
/* High resolution timer related functions */
|
|
/* High resolution timer related functions */
|
|
#ifdef CONFIG_HIGH_RES_TIMERS
|
|
#ifdef CONFIG_HIGH_RES_TIMERS
|
|
|
|
|
|
@@ -797,7 +819,7 @@ static int enqueue_hrtimer(struct hrtimer *timer,
|
|
struct hrtimer *entry;
|
|
struct hrtimer *entry;
|
|
int leftmost = 1;
|
|
int leftmost = 1;
|
|
|
|
|
|
- debug_hrtimer_activate(timer);
|
|
|
|
|
|
+ debug_activate(timer);
|
|
|
|
|
|
/*
|
|
/*
|
|
* Find the right place in the rbtree:
|
|
* Find the right place in the rbtree:
|
|
@@ -883,7 +905,7 @@ remove_hrtimer(struct hrtimer *timer, struct hrtimer_clock_base *base)
|
|
* reprogramming happens in the interrupt handler. This is a
|
|
* reprogramming happens in the interrupt handler. This is a
|
|
* rare case and less expensive than a smp call.
|
|
* rare case and less expensive than a smp call.
|
|
*/
|
|
*/
|
|
- debug_hrtimer_deactivate(timer);
|
|
|
|
|
|
+ debug_deactivate(timer);
|
|
timer_stats_hrtimer_clear_start_info(timer);
|
|
timer_stats_hrtimer_clear_start_info(timer);
|
|
reprogram = base->cpu_base == &__get_cpu_var(hrtimer_bases);
|
|
reprogram = base->cpu_base == &__get_cpu_var(hrtimer_bases);
|
|
__remove_hrtimer(timer, base, HRTIMER_STATE_INACTIVE,
|
|
__remove_hrtimer(timer, base, HRTIMER_STATE_INACTIVE,
|
|
@@ -1116,7 +1138,7 @@ static void __hrtimer_init(struct hrtimer *timer, clockid_t clock_id,
|
|
void hrtimer_init(struct hrtimer *timer, clockid_t clock_id,
|
|
void hrtimer_init(struct hrtimer *timer, clockid_t clock_id,
|
|
enum hrtimer_mode mode)
|
|
enum hrtimer_mode mode)
|
|
{
|
|
{
|
|
- debug_hrtimer_init(timer);
|
|
|
|
|
|
+ debug_init(timer, clock_id, mode);
|
|
__hrtimer_init(timer, clock_id, mode);
|
|
__hrtimer_init(timer, clock_id, mode);
|
|
}
|
|
}
|
|
EXPORT_SYMBOL_GPL(hrtimer_init);
|
|
EXPORT_SYMBOL_GPL(hrtimer_init);
|
|
@@ -1140,7 +1162,7 @@ int hrtimer_get_res(const clockid_t which_clock, struct timespec *tp)
|
|
}
|
|
}
|
|
EXPORT_SYMBOL_GPL(hrtimer_get_res);
|
|
EXPORT_SYMBOL_GPL(hrtimer_get_res);
|
|
|
|
|
|
-static void __run_hrtimer(struct hrtimer *timer)
|
|
|
|
|
|
+static void __run_hrtimer(struct hrtimer *timer, ktime_t *now)
|
|
{
|
|
{
|
|
struct hrtimer_clock_base *base = timer->base;
|
|
struct hrtimer_clock_base *base = timer->base;
|
|
struct hrtimer_cpu_base *cpu_base = base->cpu_base;
|
|
struct hrtimer_cpu_base *cpu_base = base->cpu_base;
|
|
@@ -1149,7 +1171,7 @@ static void __run_hrtimer(struct hrtimer *timer)
|
|
|
|
|
|
WARN_ON(!irqs_disabled());
|
|
WARN_ON(!irqs_disabled());
|
|
|
|
|
|
- debug_hrtimer_deactivate(timer);
|
|
|
|
|
|
+ debug_deactivate(timer);
|
|
__remove_hrtimer(timer, base, HRTIMER_STATE_CALLBACK, 0);
|
|
__remove_hrtimer(timer, base, HRTIMER_STATE_CALLBACK, 0);
|
|
timer_stats_account_hrtimer(timer);
|
|
timer_stats_account_hrtimer(timer);
|
|
fn = timer->function;
|
|
fn = timer->function;
|
|
@@ -1160,7 +1182,9 @@ static void __run_hrtimer(struct hrtimer *timer)
|
|
* the timer base.
|
|
* the timer base.
|
|
*/
|
|
*/
|
|
spin_unlock(&cpu_base->lock);
|
|
spin_unlock(&cpu_base->lock);
|
|
|
|
+ trace_hrtimer_expire_entry(timer, now);
|
|
restart = fn(timer);
|
|
restart = fn(timer);
|
|
|
|
+ trace_hrtimer_expire_exit(timer);
|
|
spin_lock(&cpu_base->lock);
|
|
spin_lock(&cpu_base->lock);
|
|
|
|
|
|
/*
|
|
/*
|
|
@@ -1271,7 +1295,7 @@ void hrtimer_interrupt(struct clock_event_device *dev)
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
|
|
|
|
- __run_hrtimer(timer);
|
|
|
|
|
|
+ __run_hrtimer(timer, &basenow);
|
|
}
|
|
}
|
|
base++;
|
|
base++;
|
|
}
|
|
}
|
|
@@ -1393,7 +1417,7 @@ void hrtimer_run_queues(void)
|
|
hrtimer_get_expires_tv64(timer))
|
|
hrtimer_get_expires_tv64(timer))
|
|
break;
|
|
break;
|
|
|
|
|
|
- __run_hrtimer(timer);
|
|
|
|
|
|
+ __run_hrtimer(timer, &base->softirq_time);
|
|
}
|
|
}
|
|
spin_unlock(&cpu_base->lock);
|
|
spin_unlock(&cpu_base->lock);
|
|
}
|
|
}
|
|
@@ -1569,7 +1593,7 @@ static void migrate_hrtimer_list(struct hrtimer_clock_base *old_base,
|
|
while ((node = rb_first(&old_base->active))) {
|
|
while ((node = rb_first(&old_base->active))) {
|
|
timer = rb_entry(node, struct hrtimer, node);
|
|
timer = rb_entry(node, struct hrtimer, node);
|
|
BUG_ON(hrtimer_callback_running(timer));
|
|
BUG_ON(hrtimer_callback_running(timer));
|
|
- debug_hrtimer_deactivate(timer);
|
|
|
|
|
|
+ debug_deactivate(timer);
|
|
|
|
|
|
/*
|
|
/*
|
|
* Mark it as STATE_MIGRATE not INACTIVE otherwise the
|
|
* Mark it as STATE_MIGRATE not INACTIVE otherwise the
|