diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2009-12-10 04:56:29 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2009-12-10 07:08:11 -0500 |
commit | 5f201907dfe4ad42c44006ddfcec00ed12e59497 (patch) | |
tree | b796471d44eb588f8d95affaeb0aa6cf6478b460 /kernel/hrtimer.c | |
parent | 41d2e494937715d3150e5c75d01f0e75ae899337 (diff) |
hrtimer: move timer stats helper functions to hrtimer.c
There is no reason to make timer_stats_hrtimer_set_start_info and
friends visible to the rest of the kernel. So move all of them to
hrtimer.c. Also make timer_stats_hrtimer_set_start_info a static
inline function so it gets inlined and we avoid another function call.
Based on a patch by Thomas Gleixner.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
LKML-Reference: <20091210095629.GC4144@osiris.boeblingen.de.ibm.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/hrtimer.c')
-rw-r--r-- | kernel/hrtimer.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c index 931a4d99bc55..d2f9239dc6ba 100644 --- a/kernel/hrtimer.c +++ b/kernel/hrtimer.c | |||
@@ -756,17 +756,33 @@ static inline void hrtimer_init_timer_hres(struct hrtimer *timer) { } | |||
756 | 756 | ||
757 | #endif /* CONFIG_HIGH_RES_TIMERS */ | 757 | #endif /* CONFIG_HIGH_RES_TIMERS */ |
758 | 758 | ||
759 | #ifdef CONFIG_TIMER_STATS | 759 | static inline void timer_stats_hrtimer_set_start_info(struct hrtimer *timer) |
760 | void __timer_stats_hrtimer_set_start_info(struct hrtimer *timer, void *addr) | ||
761 | { | 760 | { |
761 | #ifdef CONFIG_TIMER_STATS | ||
762 | if (timer->start_site) | 762 | if (timer->start_site) |
763 | return; | 763 | return; |
764 | 764 | timer->start_site = __builtin_return_address(0); | |
765 | timer->start_site = addr; | ||
766 | memcpy(timer->start_comm, current->comm, TASK_COMM_LEN); | 765 | memcpy(timer->start_comm, current->comm, TASK_COMM_LEN); |
767 | timer->start_pid = current->pid; | 766 | timer->start_pid = current->pid; |
767 | #endif | ||
768 | } | 768 | } |
769 | |||
770 | static inline void timer_stats_hrtimer_clear_start_info(struct hrtimer *timer) | ||
771 | { | ||
772 | #ifdef CONFIG_TIMER_STATS | ||
773 | timer->start_site = NULL; | ||
769 | #endif | 774 | #endif |
775 | } | ||
776 | |||
777 | static inline void timer_stats_account_hrtimer(struct hrtimer *timer) | ||
778 | { | ||
779 | #ifdef CONFIG_TIMER_STATS | ||
780 | if (likely(!timer_stats_active)) | ||
781 | return; | ||
782 | timer_stats_update_stats(timer, timer->start_pid, timer->start_site, | ||
783 | timer->function, timer->start_comm, 0); | ||
784 | #endif | ||
785 | } | ||
770 | 786 | ||
771 | /* | 787 | /* |
772 | * Counterpart to lock_hrtimer_base above: | 788 | * Counterpart to lock_hrtimer_base above: |