cpufreq_times.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. #ifndef _LINUX_CPUFREQ_TIMES_H
  16. #define _LINUX_CPUFREQ_TIMES_H
  17. #include <linux/cpufreq.h>
  18. #include <linux/pid.h>
  19. #ifdef CONFIG_CPU_FREQ_TIMES
  20. void cpufreq_task_times_init(struct task_struct *p);
  21. void cpufreq_task_times_alloc(struct task_struct *p);
  22. void cpufreq_task_times_exit(struct task_struct *p);
  23. int proc_time_in_state_show(struct seq_file *m, struct pid_namespace *ns,
  24. struct pid *pid, struct task_struct *p);
  25. void cpufreq_acct_update_power(struct task_struct *p, u64 cputime);
  26. void cpufreq_times_create_policy(struct cpufreq_policy *policy);
  27. void cpufreq_times_record_transition(struct cpufreq_policy *policy,
  28. unsigned int new_freq);
  29. #else
  30. static inline void cpufreq_task_times_init(struct task_struct *p) {}
  31. static inline void cpufreq_task_times_alloc(struct task_struct *p) {}
  32. static inline void cpufreq_task_times_exit(struct task_struct *p) {}
  33. static inline void cpufreq_acct_update_power(struct task_struct *p,
  34. u64 cputime) {}
  35. static inline void cpufreq_times_create_policy(struct cpufreq_policy *policy) {}
  36. static inline void cpufreq_times_record_transition(
  37. struct cpufreq_policy *policy, unsigned int new_freq) {}
  38. #endif /* CONFIG_CPU_FREQ_TIMES */
  39. #endif /* _LINUX_CPUFREQ_TIMES_H */