1*4882a593Smuzhiyun /* drivers/cpufreq/cpufreq_times.c
2*4882a593Smuzhiyun *
3*4882a593Smuzhiyun * Copyright (C) 2018 Google, Inc.
4*4882a593Smuzhiyun *
5*4882a593Smuzhiyun * This software is licensed under the terms of the GNU General Public
6*4882a593Smuzhiyun * License version 2, as published by the Free Software Foundation, and
7*4882a593Smuzhiyun * may be copied, distributed, and modified under those terms.
8*4882a593Smuzhiyun *
9*4882a593Smuzhiyun * This program is distributed in the hope that it will be useful,
10*4882a593Smuzhiyun * but WITHOUT ANY WARRANTY; without even the implied warranty of
11*4882a593Smuzhiyun * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12*4882a593Smuzhiyun * GNU General Public License for more details.
13*4882a593Smuzhiyun *
14*4882a593Smuzhiyun */
15*4882a593Smuzhiyun
16*4882a593Smuzhiyun #ifndef _LINUX_CPUFREQ_TIMES_H
17*4882a593Smuzhiyun #define _LINUX_CPUFREQ_TIMES_H
18*4882a593Smuzhiyun
19*4882a593Smuzhiyun #include <linux/cpufreq.h>
20*4882a593Smuzhiyun #include <linux/pid.h>
21*4882a593Smuzhiyun
22*4882a593Smuzhiyun #ifdef CONFIG_CPU_FREQ_TIMES
23*4882a593Smuzhiyun void cpufreq_task_times_init(struct task_struct *p);
24*4882a593Smuzhiyun void cpufreq_task_times_alloc(struct task_struct *p);
25*4882a593Smuzhiyun void cpufreq_task_times_exit(struct task_struct *p);
26*4882a593Smuzhiyun int proc_time_in_state_show(struct seq_file *m, struct pid_namespace *ns,
27*4882a593Smuzhiyun struct pid *pid, struct task_struct *p);
28*4882a593Smuzhiyun void cpufreq_acct_update_power(struct task_struct *p, u64 cputime);
29*4882a593Smuzhiyun void cpufreq_times_create_policy(struct cpufreq_policy *policy);
30*4882a593Smuzhiyun void cpufreq_times_record_transition(struct cpufreq_policy *policy,
31*4882a593Smuzhiyun unsigned int new_freq);
32*4882a593Smuzhiyun #else
cpufreq_task_times_init(struct task_struct * p)33*4882a593Smuzhiyun static inline void cpufreq_task_times_init(struct task_struct *p) {}
cpufreq_task_times_alloc(struct task_struct * p)34*4882a593Smuzhiyun static inline void cpufreq_task_times_alloc(struct task_struct *p) {}
cpufreq_task_times_exit(struct task_struct * p)35*4882a593Smuzhiyun static inline void cpufreq_task_times_exit(struct task_struct *p) {}
cpufreq_acct_update_power(struct task_struct * p,u64 cputime)36*4882a593Smuzhiyun static inline void cpufreq_acct_update_power(struct task_struct *p,
37*4882a593Smuzhiyun u64 cputime) {}
cpufreq_times_create_policy(struct cpufreq_policy * policy)38*4882a593Smuzhiyun static inline void cpufreq_times_create_policy(struct cpufreq_policy *policy) {}
cpufreq_times_record_transition(struct cpufreq_policy * policy,unsigned int new_freq)39*4882a593Smuzhiyun static inline void cpufreq_times_record_transition(
40*4882a593Smuzhiyun struct cpufreq_policy *policy, unsigned int new_freq) {}
41*4882a593Smuzhiyun #endif /* CONFIG_CPU_FREQ_TIMES */
42*4882a593Smuzhiyun #endif /* _LINUX_CPUFREQ_TIMES_H */
43