#include <linux/cpu.h>
#include <linux/cpufreq.h>
#include <linux/module.h>
#include <linux/sched/clock.h>
#include <linux/slab.h>
struct cpufreq_stats { … };
static void cpufreq_stats_update(struct cpufreq_stats *stats,
unsigned long long time)
{ … }
static void cpufreq_stats_reset_table(struct cpufreq_stats *stats)
{ … }
static ssize_t show_total_trans(struct cpufreq_policy *policy, char *buf)
{ … }
cpufreq_freq_attr_ro(…);
static ssize_t show_time_in_state(struct cpufreq_policy *policy, char *buf)
{ … }
cpufreq_freq_attr_ro(…);
static ssize_t store_reset(struct cpufreq_policy *policy, const char *buf,
size_t count)
{ … }
cpufreq_freq_attr_wo(…);
static ssize_t show_trans_table(struct cpufreq_policy *policy, char *buf)
{ … }
cpufreq_freq_attr_ro(…);
static struct attribute *default_attrs[] = …;
static const struct attribute_group stats_attr_group = …;
static int freq_table_get_index(struct cpufreq_stats *stats, unsigned int freq)
{ … }
void cpufreq_stats_free_table(struct cpufreq_policy *policy)
{ … }
void cpufreq_stats_create_table(struct cpufreq_policy *policy)
{ … }
void cpufreq_stats_record_transition(struct cpufreq_policy *policy,
unsigned int new_freq)
{ … }