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