Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3174b276 authored by Amit Pundir's avatar Amit Pundir Committed by Ruchi Kandoi
Browse files

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: default avatarAmit Pundir <amit.pundir@linaro.org>
parent 553b785b
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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
}

/*