aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/hrtimer.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/hrtimer.h')
-rw-r--r--include/linux/hrtimer.h60
1 files changed, 10 insertions, 50 deletions
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h
index b984b947f5db..b34823755ee4 100644
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -162,19 +162,24 @@ struct hrtimer_clock_base {
162 * @expires_next: absolute time of the next event which was scheduled 162 * @expires_next: absolute time of the next event which was scheduled
163 * via clock_set_next_event() 163 * via clock_set_next_event()
164 * @hres_active: State of high resolution mode 164 * @hres_active: State of high resolution mode
165 * @check_clocks: Indictator, when set evaluate time source and clock 165 * @hang_detected: The last hrtimer interrupt detected a hang
166 * event devices whether high resolution mode can be 166 * @nr_events: Total number of hrtimer interrupt events
167 * activated. 167 * @nr_retries: Total number of hrtimer interrupt retries
168 * @nr_events: Total number of timer interrupt events 168 * @nr_hangs: Total number of hrtimer interrupt hangs
169 * @max_hang_time: Maximum time spent in hrtimer_interrupt
169 * @to_pull: LITMUS^RT list of timers to be pulled on this cpu 170 * @to_pull: LITMUS^RT list of timers to be pulled on this cpu
170 */ 171 */
171struct hrtimer_cpu_base { 172struct hrtimer_cpu_base {
172 spinlock_t lock; 173 raw_spinlock_t lock;
173 struct hrtimer_clock_base clock_base[HRTIMER_MAX_CLOCK_BASES]; 174 struct hrtimer_clock_base clock_base[HRTIMER_MAX_CLOCK_BASES];
174#ifdef CONFIG_HIGH_RES_TIMERS 175#ifdef CONFIG_HIGH_RES_TIMERS
175 ktime_t expires_next; 176 ktime_t expires_next;
176 int hres_active; 177 int hres_active;
178 int hang_detected;
177 unsigned long nr_events; 179 unsigned long nr_events;
180 unsigned long nr_retries;
181 unsigned long nr_hangs;
182 ktime_t max_hang_time;
178#endif 183#endif
179 struct list_head to_pull; 184 struct list_head to_pull;
180}; 185};
@@ -460,49 +465,4 @@ extern u64 ktime_divns(const ktime_t kt, s64 div);
460/* Show pending timers: */ 465/* Show pending timers: */
461extern void sysrq_timer_list_show(void); 466extern void sysrq_timer_list_show(void);
462 467
463/*
464 * Timer-statistics info:
465 */
466#ifdef CONFIG_TIMER_STATS
467
468extern void timer_stats_update_stats(void *timer, pid_t pid, void *startf,
469 void *timerf, char *comm,
470 unsigned int timer_flag);
471
472static inline void timer_stats_account_hrtimer(struct hrtimer *timer)
473{
474 if (likely(!timer->start_site))
475 return;
476 timer_stats_update_stats(timer, timer->start_pid, timer->start_site,
477 timer->function, timer->start_comm, 0);
478}
479
480extern void __timer_stats_hrtimer_set_start_info(struct hrtimer *timer,
481 void *addr);
482
483static inline void timer_stats_hrtimer_set_start_info(struct hrtimer *timer)
484{
485 if (likely(!timer_stats_active))
486 return;
487 __timer_stats_hrtimer_set_start_info(timer, __builtin_return_address(0));
488}
489
490static inline void timer_stats_hrtimer_clear_start_info(struct hrtimer *timer)
491{
492 timer->start_site = NULL;
493}
494#else
495static inline void timer_stats_account_hrtimer(struct hrtimer *timer)
496{
497}
498
499static inline void timer_stats_hrtimer_set_start_info(struct hrtimer *timer)
500{
501}
502
503static inline void timer_stats_hrtimer_clear_start_info(struct hrtimer *timer)
504{
505}
506#endif
507
508#endif 468#endif