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:
Amit Pundir
2015-06-04 20:04:37 +05:30
parent 8556d8602b
commit 1b1c8d6849

View File

@@ -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
}
/*