mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-21 22:21:21 +00:00
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>
This commit is contained in:
parent
41d2e49493
commit
5f201907df
2 changed files with 21 additions and 48 deletions
|
@ -440,47 +440,4 @@ extern u64 ktime_divns(const ktime_t kt, s64 div);
|
||||||
/* Show pending timers: */
|
/* Show pending timers: */
|
||||||
extern void sysrq_timer_list_show(void);
|
extern void sysrq_timer_list_show(void);
|
||||||
|
|
||||||
/*
|
|
||||||
* Timer-statistics info:
|
|
||||||
*/
|
|
||||||
#ifdef CONFIG_TIMER_STATS
|
|
||||||
|
|
||||||
extern void timer_stats_update_stats(void *timer, pid_t pid, void *startf,
|
|
||||||
void *timerf, char *comm,
|
|
||||||
unsigned int timer_flag);
|
|
||||||
|
|
||||||
static inline void timer_stats_account_hrtimer(struct hrtimer *timer)
|
|
||||||
{
|
|
||||||
if (likely(!timer_stats_active))
|
|
||||||
return;
|
|
||||||
timer_stats_update_stats(timer, timer->start_pid, timer->start_site,
|
|
||||||
timer->function, timer->start_comm, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
extern void __timer_stats_hrtimer_set_start_info(struct hrtimer *timer,
|
|
||||||
void *addr);
|
|
||||||
|
|
||||||
static inline void timer_stats_hrtimer_set_start_info(struct hrtimer *timer)
|
|
||||||
{
|
|
||||||
__timer_stats_hrtimer_set_start_info(timer, __builtin_return_address(0));
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void timer_stats_hrtimer_clear_start_info(struct hrtimer *timer)
|
|
||||||
{
|
|
||||||
timer->start_site = NULL;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
static inline void timer_stats_account_hrtimer(struct hrtimer *timer)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void timer_stats_hrtimer_set_start_info(struct hrtimer *timer)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void timer_stats_hrtimer_clear_start_info(struct hrtimer *timer)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -756,17 +756,33 @@ static inline void hrtimer_init_timer_hres(struct hrtimer *timer) { }
|
||||||
|
|
||||||
#endif /* CONFIG_HIGH_RES_TIMERS */
|
#endif /* CONFIG_HIGH_RES_TIMERS */
|
||||||
|
|
||||||
#ifdef CONFIG_TIMER_STATS
|
static inline void timer_stats_hrtimer_set_start_info(struct hrtimer *timer)
|
||||||
void __timer_stats_hrtimer_set_start_info(struct hrtimer *timer, void *addr)
|
|
||||||
{
|
{
|
||||||
|
#ifdef CONFIG_TIMER_STATS
|
||||||
if (timer->start_site)
|
if (timer->start_site)
|
||||||
return;
|
return;
|
||||||
|
timer->start_site = __builtin_return_address(0);
|
||||||
timer->start_site = addr;
|
|
||||||
memcpy(timer->start_comm, current->comm, TASK_COMM_LEN);
|
memcpy(timer->start_comm, current->comm, TASK_COMM_LEN);
|
||||||
timer->start_pid = current->pid;
|
timer->start_pid = current->pid;
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void timer_stats_hrtimer_clear_start_info(struct hrtimer *timer)
|
||||||
|
{
|
||||||
|
#ifdef CONFIG_TIMER_STATS
|
||||||
|
timer->start_site = NULL;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void timer_stats_account_hrtimer(struct hrtimer *timer)
|
||||||
|
{
|
||||||
|
#ifdef CONFIG_TIMER_STATS
|
||||||
|
if (likely(!timer_stats_active))
|
||||||
|
return;
|
||||||
|
timer_stats_update_stats(timer, timer->start_pid, timer->start_site,
|
||||||
|
timer->function, timer->start_comm, 0);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Counterpart to lock_hrtimer_base above:
|
* Counterpart to lock_hrtimer_base above:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue