13d0407baSopenharmony_ci/* drivers/cpufreq/cpufreq_times.c
23d0407baSopenharmony_ci *
33d0407baSopenharmony_ci * Copyright (C) 2018 Google, Inc.
43d0407baSopenharmony_ci *
53d0407baSopenharmony_ci * This software is licensed under the terms of the GNU General Public
63d0407baSopenharmony_ci * License version 2, as published by the Free Software Foundation, and
73d0407baSopenharmony_ci * may be copied, distributed, and modified under those terms.
83d0407baSopenharmony_ci *
93d0407baSopenharmony_ci * This program is distributed in the hope that it will be useful,
103d0407baSopenharmony_ci * but WITHOUT ANY WARRANTY; without even the implied warranty of
113d0407baSopenharmony_ci * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
123d0407baSopenharmony_ci * GNU General Public License for more details.
133d0407baSopenharmony_ci *
143d0407baSopenharmony_ci */
153d0407baSopenharmony_ci
163d0407baSopenharmony_ci#ifndef _LINUX_CPUFREQ_TIMES_H
173d0407baSopenharmony_ci#define _LINUX_CPUFREQ_TIMES_H
183d0407baSopenharmony_ci
193d0407baSopenharmony_ci#include <linux/cpufreq.h>
203d0407baSopenharmony_ci#include <linux/pid.h>
213d0407baSopenharmony_ci
223d0407baSopenharmony_ci#ifdef CONFIG_CPU_FREQ_TIMES
233d0407baSopenharmony_civoid cpufreq_task_times_init(struct task_struct *p);
243d0407baSopenharmony_civoid cpufreq_task_times_alloc(struct task_struct *p);
253d0407baSopenharmony_civoid cpufreq_task_times_exit(struct task_struct *p);
263d0407baSopenharmony_ciint proc_time_in_state_show(struct seq_file *m, struct pid_namespace *ns,
273d0407baSopenharmony_ci			    struct pid *pid, struct task_struct *p);
283d0407baSopenharmony_civoid cpufreq_acct_update_power(struct task_struct *p, u64 cputime);
293d0407baSopenharmony_civoid cpufreq_times_create_policy(struct cpufreq_policy *policy);
303d0407baSopenharmony_civoid cpufreq_times_record_transition(struct cpufreq_policy *policy,
313d0407baSopenharmony_ci                                     unsigned int new_freq);
323d0407baSopenharmony_ci#else
333d0407baSopenharmony_cistatic inline void cpufreq_task_times_init(struct task_struct *p) {}
343d0407baSopenharmony_cistatic inline void cpufreq_task_times_alloc(struct task_struct *p) {}
353d0407baSopenharmony_cistatic inline void cpufreq_task_times_exit(struct task_struct *p) {}
363d0407baSopenharmony_cistatic inline void cpufreq_acct_update_power(struct task_struct *p,
373d0407baSopenharmony_ci					     u64 cputime) {}
383d0407baSopenharmony_cistatic inline void cpufreq_times_create_policy(struct cpufreq_policy *policy) {}
393d0407baSopenharmony_cistatic inline void cpufreq_times_record_transition(
403d0407baSopenharmony_ci	struct cpufreq_policy *policy, unsigned int new_freq) {}
413d0407baSopenharmony_ci#endif /* CONFIG_CPU_FREQ_TIMES */
423d0407baSopenharmony_ci#endif /* _LINUX_CPUFREQ_TIMES_H */
43