blob: 3fb38750c853fe8d53813bb38f185ca9155f29d4 [file] [log] [blame]
Connor O'Brien6e7b83d2018-01-31 18:11:57 -08001/* 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
24void cpufreq_task_times_init(struct task_struct *p);
25void cpufreq_task_times_exit(struct task_struct *p);
26int proc_time_in_state_show(struct seq_file *m, struct pid_namespace *ns,
27 struct pid *pid, struct task_struct *p);
28void cpufreq_acct_update_power(struct task_struct *p, cputime_t cputime);
29void cpufreq_times_create_policy(struct cpufreq_policy *policy);
30void cpufreq_times_record_transition(struct cpufreq_freqs *freq);
Connor O'Brienfcb3db12018-02-06 13:30:27 -080031void cpufreq_task_times_remove_uids(uid_t uid_start, uid_t uid_end);
Connor O'Brienf17f4fb2018-01-22 18:28:08 -080032int single_uid_time_in_state_open(struct inode *inode, struct file *file);
Connor O'Brien6e7b83d2018-01-31 18:11:57 -080033#else
34static inline void cpufreq_times_create_policy(struct cpufreq_policy *policy) {}
35static inline void cpufreq_times_record_transition(
36 struct cpufreq_freqs *freq) {}
Connor O'Brienfcb3db12018-02-06 13:30:27 -080037static inline void cpufreq_task_times_remove_uids(uid_t uid_start,
38 uid_t uid_end) {}
Connor O'Brien6e7b83d2018-01-31 18:11:57 -080039#endif /* CONFIG_CPU_FREQ_TIMES */
40#endif /* _LINUX_CPUFREQ_TIMES_H */