mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 20:07:46 +09:00
sched: cpufreq: update power usage only if cpufreq_stat is enabled
Call acct_update_power() to track power usage of task only if CONFIG_CPU_FREQ_STAT is enabled, otherwise we run into following build failure: --------------- kernel/built-in.o: In function `account_user_time': kernel/sched/cputime.c:155: undefined reference to `acct_update_power' kernel/built-in.o: In function `__account_system_time': kernel/sched/cputime.c:208: undefined reference to `acct_update_power' make: *** [vmlinux] Error 1 --------------- Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
This commit is contained in:
@@ -151,8 +151,10 @@ void account_user_time(struct task_struct *p, cputime_t cputime,
|
||||
/* Account for user time used */
|
||||
acct_account_cputime(p);
|
||||
|
||||
#ifdef CONFIG_CPU_FREQ_STAT
|
||||
/* Account power usage for user time */
|
||||
acct_update_power(p, cputime);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -204,8 +206,10 @@ void __account_system_time(struct task_struct *p, cputime_t cputime,
|
||||
/* Account for system time used */
|
||||
acct_account_cputime(p);
|
||||
|
||||
#ifdef CONFIG_CPU_FREQ_STAT
|
||||
/* Account power usage for system time */
|
||||
acct_update_power(p, cputime);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user