aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-06-28 14:05:16 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-06-28 14:05:16 -0400
commit187dd317f0169142e4adf6263852f93c3b6f6a3c (patch)
treec539ad11655d4545c5ef4b54cbecd9cff9cff974 /include
parent9b71272b6ad4966481d73e6abf3ae4bbc3bdabd5 (diff)
parent507e123151149e578c9aae33eb876c49824da5f8 (diff)
Merge branch 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: timer stats: Optimize by adding quick check to avoid function calls timers: Fix timer_migration interface which accepts any number as input
Diffstat (limited to 'include')
-rw-r--r--include/linux/hrtimer.h5
-rw-r--r--include/linux/timer.h4
2 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h
index 7400900de94a..54648e625efd 100644
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -21,6 +21,7 @@
21#include <linux/list.h> 21#include <linux/list.h>
22#include <linux/wait.h> 22#include <linux/wait.h>
23#include <linux/percpu.h> 23#include <linux/percpu.h>
24#include <linux/timer.h>
24 25
25 26
26struct hrtimer_clock_base; 27struct hrtimer_clock_base;
@@ -447,6 +448,8 @@ extern void timer_stats_update_stats(void *timer, pid_t pid, void *startf,
447 448
448static inline void timer_stats_account_hrtimer(struct hrtimer *timer) 449static inline void timer_stats_account_hrtimer(struct hrtimer *timer)
449{ 450{
451 if (likely(!timer->start_pid))
452 return;
450 timer_stats_update_stats(timer, timer->start_pid, timer->start_site, 453 timer_stats_update_stats(timer, timer->start_pid, timer->start_site,
451 timer->function, timer->start_comm, 0); 454 timer->function, timer->start_comm, 0);
452} 455}
@@ -456,6 +459,8 @@ extern void __timer_stats_hrtimer_set_start_info(struct hrtimer *timer,
456 459
457static inline void timer_stats_hrtimer_set_start_info(struct hrtimer *timer) 460static inline void timer_stats_hrtimer_set_start_info(struct hrtimer *timer)
458{ 461{
462 if (likely(!timer_stats_active))
463 return;
459 __timer_stats_hrtimer_set_start_info(timer, __builtin_return_address(0)); 464 __timer_stats_hrtimer_set_start_info(timer, __builtin_return_address(0));
460} 465}
461 466
diff --git a/include/linux/timer.h b/include/linux/timer.h
index ccf882eed8f8..be62ec2ebea5 100644
--- a/include/linux/timer.h
+++ b/include/linux/timer.h
@@ -190,6 +190,8 @@ extern unsigned long get_next_timer_interrupt(unsigned long now);
190 */ 190 */
191#ifdef CONFIG_TIMER_STATS 191#ifdef CONFIG_TIMER_STATS
192 192
193extern int timer_stats_active;
194
193#define TIMER_STATS_FLAG_DEFERRABLE 0x1 195#define TIMER_STATS_FLAG_DEFERRABLE 0x1
194 196
195extern void init_timer_stats(void); 197extern void init_timer_stats(void);
@@ -203,6 +205,8 @@ extern void __timer_stats_timer_set_start_info(struct timer_list *timer,
203 205
204static inline void timer_stats_timer_set_start_info(struct timer_list *timer) 206static inline void timer_stats_timer_set_start_info(struct timer_list *timer)
205{ 207{
208 if (likely(!timer_stats_active))
209 return;
206 __timer_stats_timer_set_start_info(timer, __builtin_return_address(0)); 210 __timer_stats_timer_set_start_info(timer, __builtin_return_address(0));
207} 211}
208 212