diff options
Diffstat (limited to 'include/linux/hrtimer.h')
-rw-r--r-- | include/linux/hrtimer.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index 4ecd991431b4..93b8757c1ea2 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h | |||
@@ -119,6 +119,11 @@ struct hrtimer { | |||
119 | enum hrtimer_cb_mode cb_mode; | 119 | enum hrtimer_cb_mode cb_mode; |
120 | struct list_head cb_entry; | 120 | struct list_head cb_entry; |
121 | #endif | 121 | #endif |
122 | #ifdef CONFIG_TIMER_STATS | ||
123 | void *start_site; | ||
124 | char start_comm[16]; | ||
125 | int start_pid; | ||
126 | #endif | ||
122 | }; | 127 | }; |
123 | 128 | ||
124 | /** | 129 | /** |
@@ -311,4 +316,44 @@ extern unsigned long ktime_divns(const ktime_t kt, s64 div); | |||
311 | # define ktime_divns(kt, div) (unsigned long)((kt).tv64 / (div)) | 316 | # define ktime_divns(kt, div) (unsigned long)((kt).tv64 / (div)) |
312 | #endif | 317 | #endif |
313 | 318 | ||
319 | /* | ||
320 | * Timer-statistics info: | ||
321 | */ | ||
322 | #ifdef CONFIG_TIMER_STATS | ||
323 | |||
324 | extern void timer_stats_update_stats(void *timer, pid_t pid, void *startf, | ||
325 | void *timerf, char * comm); | ||
326 | |||
327 | static inline void timer_stats_account_hrtimer(struct hrtimer *timer) | ||
328 | { | ||
329 | timer_stats_update_stats(timer, timer->start_pid, timer->start_site, | ||
330 | timer->function, timer->start_comm); | ||
331 | } | ||
332 | |||
333 | extern void __timer_stats_hrtimer_set_start_info(struct hrtimer *timer, | ||
334 | void *addr); | ||
335 | |||
336 | static inline void timer_stats_hrtimer_set_start_info(struct hrtimer *timer) | ||
337 | { | ||
338 | __timer_stats_hrtimer_set_start_info(timer, __builtin_return_address(0)); | ||
339 | } | ||
340 | |||
341 | static inline void timer_stats_hrtimer_clear_start_info(struct hrtimer *timer) | ||
342 | { | ||
343 | timer->start_site = NULL; | ||
344 | } | ||
345 | #else | ||
346 | static inline void timer_stats_account_hrtimer(struct hrtimer *timer) | ||
347 | { | ||
348 | } | ||
349 | |||
350 | static inline void timer_stats_hrtimer_set_start_info(struct hrtimer *timer) | ||
351 | { | ||
352 | } | ||
353 | |||
354 | static inline void timer_stats_hrtimer_clear_start_info(struct hrtimer *timer) | ||
355 | { | ||
356 | } | ||
357 | #endif | ||
358 | |||
314 | #endif | 359 | #endif |