• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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/pid.h>
21 
22 #ifdef CONFIG_CPU_FREQ_TIMES
23 void cpufreq_task_times_init(struct task_struct *p);
24 void cpufreq_task_times_alloc(struct task_struct *p);
25 void cpufreq_task_times_exit(struct task_struct *p);
26 int proc_time_in_state_show(struct seq_file *m, struct pid_namespace *ns,
27 			    struct pid *pid, struct task_struct *p);
28 void cpufreq_acct_update_power(struct task_struct *p, u64 cputime);
29 void cpufreq_times_create_policy(struct cpufreq_policy *policy);
30 void cpufreq_times_record_transition(struct cpufreq_policy *policy,
31                                      unsigned int new_freq);
32 #else
cpufreq_task_times_init(struct task_struct * p)33 static inline void cpufreq_task_times_init(struct task_struct *p) {}
cpufreq_task_times_alloc(struct task_struct * p)34 static inline void cpufreq_task_times_alloc(struct task_struct *p) {}
cpufreq_task_times_exit(struct task_struct * p)35 static inline void cpufreq_task_times_exit(struct task_struct *p) {}
cpufreq_acct_update_power(struct task_struct * p,u64 cputime)36 static inline void cpufreq_acct_update_power(struct task_struct *p,
37 					     u64 cputime) {}
cpufreq_times_create_policy(struct cpufreq_policy * policy)38 static inline void cpufreq_times_create_policy(struct cpufreq_policy *policy) {}
cpufreq_times_record_transition(struct cpufreq_policy * policy,unsigned int new_freq)39 static inline void cpufreq_times_record_transition(
40 	struct cpufreq_policy *policy, unsigned int new_freq) {}
41 #endif /* CONFIG_CPU_FREQ_TIMES */
42 #endif /* _LINUX_CPUFREQ_TIMES_H */
43