blob: 5d7bf9b1dfc5219a8ff4676a834e57efb37e0117 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * drivers/cpufreq/cpufreq_stats.c
3 *
4 * Copyright (C) 2003-2004 Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>.
Dave Jones0a829c52009-01-18 01:49:04 -05005 * (C) 2004 Zou Nan hai <nanhai.zou@intel.com>.
Linus Torvalds1da177e2005-04-16 15:20:36 -07006 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
Linus Torvalds1da177e2005-04-16 15:20:36 -070012#include <linux/cpu.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070013#include <linux/cpufreq.h>
Paul Gortmaker5c720d372011-05-27 13:23:32 -040014#include <linux/module.h>
Viresh Kumar5ff0a262013-08-06 22:53:03 +053015#include <linux/slab.h>
Frederic Weisbeckerbfc3f022014-03-05 16:33:42 +010016#include <linux/cputime.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070017
18static spinlock_t cpufreq_stats_lock;
19
Linus Torvalds1da177e2005-04-16 15:20:36 -070020struct cpufreq_stats {
Linus Torvalds1da177e2005-04-16 15:20:36 -070021 unsigned int total_trans;
Viresh Kumarbb176f72013-06-19 14:19:33 +053022 unsigned long long last_time;
Linus Torvalds1da177e2005-04-16 15:20:36 -070023 unsigned int max_state;
24 unsigned int state_num;
25 unsigned int last_index;
Viresh Kumar1e7586a2012-10-26 00:51:21 +020026 u64 *time_in_state;
Linus Torvalds1da177e2005-04-16 15:20:36 -070027 unsigned int *freq_table;
28#ifdef CONFIG_CPU_FREQ_STAT_DETAILS
29 unsigned int *trans_table;
30#endif
31};
32
Viresh Kumar50941602015-01-06 21:09:07 +053033static int cpufreq_stats_update(struct cpufreq_stats *stats)
Linus Torvalds1da177e2005-04-16 15:20:36 -070034{
Viresh Kumar95313472015-01-06 21:09:03 +053035 unsigned long long cur_time = get_jiffies_64();
Venkatesh Pallipadi58f1df22005-05-25 14:46:50 -070036
Linus Torvalds1da177e2005-04-16 15:20:36 -070037 spin_lock(&cpufreq_stats_lock);
Viresh Kumar50941602015-01-06 21:09:07 +053038 if (stats->time_in_state)
39 stats->time_in_state[stats->last_index] +=
40 cur_time - stats->last_time;
41 stats->last_time = cur_time;
Linus Torvalds1da177e2005-04-16 15:20:36 -070042 spin_unlock(&cpufreq_stats_lock);
43 return 0;
44}
45
Dave Jones0a829c52009-01-18 01:49:04 -050046static ssize_t show_total_trans(struct cpufreq_policy *policy, char *buf)
Linus Torvalds1da177e2005-04-16 15:20:36 -070047{
Viresh Kumara9aaf292015-01-13 11:34:00 +053048 return sprintf(buf, "%d\n", policy->stats->total_trans);
Linus Torvalds1da177e2005-04-16 15:20:36 -070049}
50
Dave Jones0a829c52009-01-18 01:49:04 -050051static ssize_t show_time_in_state(struct cpufreq_policy *policy, char *buf)
Linus Torvalds1da177e2005-04-16 15:20:36 -070052{
Viresh Kumar50941602015-01-06 21:09:07 +053053 struct cpufreq_stats *stats = policy->stats;
Linus Torvalds1da177e2005-04-16 15:20:36 -070054 ssize_t len = 0;
55 int i;
Viresh Kumara9aaf292015-01-13 11:34:00 +053056
Viresh Kumar50941602015-01-06 21:09:07 +053057 cpufreq_stats_update(stats);
58 for (i = 0; i < stats->state_num; i++) {
59 len += sprintf(buf + len, "%u %llu\n", stats->freq_table[i],
Dave Jones0a829c52009-01-18 01:49:04 -050060 (unsigned long long)
Viresh Kumar50941602015-01-06 21:09:07 +053061 jiffies_64_to_clock_t(stats->time_in_state[i]));
Linus Torvalds1da177e2005-04-16 15:20:36 -070062 }
63 return len;
64}
65
66#ifdef CONFIG_CPU_FREQ_STAT_DETAILS
Dave Jones0a829c52009-01-18 01:49:04 -050067static ssize_t show_trans_table(struct cpufreq_policy *policy, char *buf)
Linus Torvalds1da177e2005-04-16 15:20:36 -070068{
Viresh Kumar50941602015-01-06 21:09:07 +053069 struct cpufreq_stats *stats = policy->stats;
Linus Torvalds1da177e2005-04-16 15:20:36 -070070 ssize_t len = 0;
71 int i, j;
72
Viresh Kumar50941602015-01-06 21:09:07 +053073 cpufreq_stats_update(stats);
Venkatesh Pallipadi58f1df22005-05-25 14:46:50 -070074 len += snprintf(buf + len, PAGE_SIZE - len, " From : To\n");
75 len += snprintf(buf + len, PAGE_SIZE - len, " : ");
Viresh Kumar50941602015-01-06 21:09:07 +053076 for (i = 0; i < stats->state_num; i++) {
Linus Torvalds1da177e2005-04-16 15:20:36 -070077 if (len >= PAGE_SIZE)
78 break;
Venkatesh Pallipadi58f1df22005-05-25 14:46:50 -070079 len += snprintf(buf + len, PAGE_SIZE - len, "%9u ",
Viresh Kumar50941602015-01-06 21:09:07 +053080 stats->freq_table[i]);
Venkatesh Pallipadi58f1df22005-05-25 14:46:50 -070081 }
82 if (len >= PAGE_SIZE)
Cesar Eduardo Barros25aca342008-02-16 08:41:25 -020083 return PAGE_SIZE;
Venkatesh Pallipadi58f1df22005-05-25 14:46:50 -070084
85 len += snprintf(buf + len, PAGE_SIZE - len, "\n");
86
Viresh Kumar50941602015-01-06 21:09:07 +053087 for (i = 0; i < stats->state_num; i++) {
Venkatesh Pallipadi58f1df22005-05-25 14:46:50 -070088 if (len >= PAGE_SIZE)
89 break;
90
91 len += snprintf(buf + len, PAGE_SIZE - len, "%9u: ",
Viresh Kumar50941602015-01-06 21:09:07 +053092 stats->freq_table[i]);
Linus Torvalds1da177e2005-04-16 15:20:36 -070093
Viresh Kumar50941602015-01-06 21:09:07 +053094 for (j = 0; j < stats->state_num; j++) {
Linus Torvalds1da177e2005-04-16 15:20:36 -070095 if (len >= PAGE_SIZE)
96 break;
Venkatesh Pallipadi58f1df22005-05-25 14:46:50 -070097 len += snprintf(buf + len, PAGE_SIZE - len, "%9u ",
Viresh Kumar50941602015-01-06 21:09:07 +053098 stats->trans_table[i*stats->max_state+j]);
Linus Torvalds1da177e2005-04-16 15:20:36 -070099 }
Cesar Eduardo Barros25aca342008-02-16 08:41:25 -0200100 if (len >= PAGE_SIZE)
101 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700102 len += snprintf(buf + len, PAGE_SIZE - len, "\n");
103 }
Cesar Eduardo Barros25aca342008-02-16 08:41:25 -0200104 if (len >= PAGE_SIZE)
105 return PAGE_SIZE;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700106 return len;
107}
Viresh Kumardf18e502013-02-04 11:38:52 +0000108cpufreq_freq_attr_ro(trans_table);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700109#endif
110
Viresh Kumardf18e502013-02-04 11:38:52 +0000111cpufreq_freq_attr_ro(total_trans);
112cpufreq_freq_attr_ro(time_in_state);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700113
114static struct attribute *default_attrs[] = {
Viresh Kumardf18e502013-02-04 11:38:52 +0000115 &total_trans.attr,
116 &time_in_state.attr,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700117#ifdef CONFIG_CPU_FREQ_STAT_DETAILS
Viresh Kumardf18e502013-02-04 11:38:52 +0000118 &trans_table.attr,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700119#endif
120 NULL
121};
122static struct attribute_group stats_attr_group = {
123 .attrs = default_attrs,
124 .name = "stats"
125};
126
Viresh Kumar50941602015-01-06 21:09:07 +0530127static int freq_table_get_index(struct cpufreq_stats *stats, unsigned int freq)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700128{
129 int index;
Viresh Kumar50941602015-01-06 21:09:07 +0530130 for (index = 0; index < stats->max_state; index++)
131 if (stats->freq_table[index] == freq)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700132 return index;
133 return -1;
134}
135
Viresh Kumar2d135942014-01-07 07:10:12 +0530136static void __cpufreq_stats_free_table(struct cpufreq_policy *policy)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700137{
Viresh Kumar50941602015-01-06 21:09:07 +0530138 struct cpufreq_stats *stats = policy->stats;
Viresh Kumarb8eed8a2013-01-14 13:23:03 +0000139
Viresh Kumara9aaf292015-01-13 11:34:00 +0530140 /* Already freed */
Viresh Kumar50941602015-01-06 21:09:07 +0530141 if (!stats)
Viresh Kumar2d135942014-01-07 07:10:12 +0530142 return;
143
Viresh Kumar50941602015-01-06 21:09:07 +0530144 pr_debug("%s: Free stats table\n", __func__);
Viresh Kumar2d135942014-01-07 07:10:12 +0530145
146 sysfs_remove_group(&policy->kobj, &stats_attr_group);
Viresh Kumar50941602015-01-06 21:09:07 +0530147 kfree(stats->time_in_state);
148 kfree(stats);
Viresh Kumara9aaf292015-01-13 11:34:00 +0530149 policy->stats = NULL;
steven finney98586ed2011-05-02 11:29:17 -0700150}
151
Viresh Kumar2d135942014-01-07 07:10:12 +0530152static void cpufreq_stats_free_table(unsigned int cpu)
steven finney98586ed2011-05-02 11:29:17 -0700153{
Viresh Kumar2d135942014-01-07 07:10:12 +0530154 struct cpufreq_policy *policy;
Dirk Brandewie633d47d2013-02-06 09:02:12 -0800155
Viresh Kumar2d135942014-01-07 07:10:12 +0530156 policy = cpufreq_cpu_get(cpu);
viresh kumar187da1d2013-03-22 10:13:52 +0000157 if (!policy)
Dirk Brandewie633d47d2013-02-06 09:02:12 -0800158 return;
159
Viresh Kumarf93dbbb2015-01-06 21:09:04 +0530160 __cpufreq_stats_free_table(policy);
viresh kumar187da1d2013-03-22 10:13:52 +0000161
viresh kumar187da1d2013-03-22 10:13:52 +0000162 cpufreq_cpu_put(policy);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700163}
164
Saravana Kannanad4c2302014-02-27 17:58:36 -0800165static int __cpufreq_stats_create_table(struct cpufreq_policy *policy)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700166{
Viresh Kumara685c6d2015-01-06 21:09:11 +0530167 unsigned int i = 0, count = 0, ret = -ENOMEM;
Viresh Kumar50941602015-01-06 21:09:07 +0530168 struct cpufreq_stats *stats;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700169 unsigned int alloc_size;
170 unsigned int cpu = policy->cpu;
Stratos Karafotis041526f2014-04-25 23:15:38 +0300171 struct cpufreq_frequency_table *pos, *table;
Saravana Kannanad4c2302014-02-27 17:58:36 -0800172
Viresh Kumara685c6d2015-01-06 21:09:11 +0530173 /* We need cpufreq table for creating stats table */
Saravana Kannanad4c2302014-02-27 17:58:36 -0800174 table = cpufreq_frequency_get_table(cpu);
175 if (unlikely(!table))
176 return 0;
177
Viresh Kumarb8c67442015-01-06 21:09:01 +0530178 /* stats already initialized */
Viresh Kumara9aaf292015-01-13 11:34:00 +0530179 if (policy->stats)
Viresh Kumarb8c67442015-01-06 21:09:01 +0530180 return -EEXIST;
181
Viresh Kumar50941602015-01-06 21:09:07 +0530182 stats = kzalloc(sizeof(*stats), GFP_KERNEL);
Viresh Kumara685c6d2015-01-06 21:09:11 +0530183 if (!stats)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700184 return -ENOMEM;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700185
Viresh Kumara685c6d2015-01-06 21:09:11 +0530186 /* Find total allocation size */
Stratos Karafotis041526f2014-04-25 23:15:38 +0300187 cpufreq_for_each_valid_entry(pos, table)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700188 count++;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700189
Viresh Kumar1e7586a2012-10-26 00:51:21 +0200190 alloc_size = count * sizeof(int) + count * sizeof(u64);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700191
192#ifdef CONFIG_CPU_FREQ_STAT_DETAILS
193 alloc_size += count * count * sizeof(int);
194#endif
Viresh Kumara685c6d2015-01-06 21:09:11 +0530195
196 /* Allocate memory for time_in_state/freq_table/trans_table in one go */
Viresh Kumar50941602015-01-06 21:09:07 +0530197 stats->time_in_state = kzalloc(alloc_size, GFP_KERNEL);
Viresh Kumara685c6d2015-01-06 21:09:11 +0530198 if (!stats->time_in_state)
199 goto free_stat;
200
Viresh Kumar50941602015-01-06 21:09:07 +0530201 stats->freq_table = (unsigned int *)(stats->time_in_state + count);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700202
203#ifdef CONFIG_CPU_FREQ_STAT_DETAILS
Viresh Kumar50941602015-01-06 21:09:07 +0530204 stats->trans_table = stats->freq_table + count;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700205#endif
Viresh Kumara685c6d2015-01-06 21:09:11 +0530206
207 stats->max_state = count;
208
209 /* Find valid-unique entries */
Stratos Karafotis041526f2014-04-25 23:15:38 +0300210 cpufreq_for_each_valid_entry(pos, table)
Viresh Kumar50941602015-01-06 21:09:07 +0530211 if (freq_table_get_index(stats, pos->frequency) == -1)
212 stats->freq_table[i++] = pos->frequency;
213 stats->state_num = i;
Viresh Kumara685c6d2015-01-06 21:09:11 +0530214
Linus Torvalds1da177e2005-04-16 15:20:36 -0700215 spin_lock(&cpufreq_stats_lock);
Viresh Kumar50941602015-01-06 21:09:07 +0530216 stats->last_time = get_jiffies_64();
217 stats->last_index = freq_table_get_index(stats, policy->cur);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700218 spin_unlock(&cpufreq_stats_lock);
Viresh Kumara685c6d2015-01-06 21:09:11 +0530219
220 policy->stats = stats;
221 ret = sysfs_create_group(&policy->kobj, &stats_attr_group);
222 if (!ret)
223 return 0;
224
225 /* We failed, release resources */
Viresh Kumara9aaf292015-01-13 11:34:00 +0530226 policy->stats = NULL;
Viresh Kumara685c6d2015-01-06 21:09:11 +0530227 kfree(stats->time_in_state);
228free_stat:
229 kfree(stats);
230
Linus Torvalds1da177e2005-04-16 15:20:36 -0700231 return ret;
232}
233
Viresh Kumarb3f9ff82014-01-07 07:10:13 +0530234static void cpufreq_stats_create_table(unsigned int cpu)
235{
236 struct cpufreq_policy *policy;
Viresh Kumarb3f9ff82014-01-07 07:10:13 +0530237
238 /*
239 * "likely(!policy)" because normally cpufreq_stats will be registered
240 * before cpufreq driver
241 */
242 policy = cpufreq_cpu_get(cpu);
243 if (likely(!policy))
244 return;
245
Saravana Kannanad4c2302014-02-27 17:58:36 -0800246 __cpufreq_stats_create_table(policy);
Viresh Kumarb3f9ff82014-01-07 07:10:13 +0530247
248 cpufreq_cpu_put(policy);
249}
250
Dave Jones0a829c52009-01-18 01:49:04 -0500251static int cpufreq_stat_notifier_policy(struct notifier_block *nb,
252 unsigned long val, void *data)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700253{
Viresh Kumarfcd7af92014-01-07 07:10:10 +0530254 int ret = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700255 struct cpufreq_policy *policy = data;
Viresh Kumarb8eed8a2013-01-14 13:23:03 +0000256
Viresh Kumarfcd7af92014-01-07 07:10:10 +0530257 if (val == CPUFREQ_CREATE_POLICY)
Saravana Kannanad4c2302014-02-27 17:58:36 -0800258 ret = __cpufreq_stats_create_table(policy);
Viresh Kumar2d135942014-01-07 07:10:12 +0530259 else if (val == CPUFREQ_REMOVE_POLICY)
260 __cpufreq_stats_free_table(policy);
Viresh Kumarfcd7af92014-01-07 07:10:10 +0530261
262 return ret;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700263}
264
Dave Jones0a829c52009-01-18 01:49:04 -0500265static int cpufreq_stat_notifier_trans(struct notifier_block *nb,
266 unsigned long val, void *data)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700267{
268 struct cpufreq_freqs *freq = data;
Viresh Kumara9aaf292015-01-13 11:34:00 +0530269 struct cpufreq_policy *policy = cpufreq_cpu_get(freq->cpu);
Viresh Kumar50941602015-01-06 21:09:07 +0530270 struct cpufreq_stats *stats;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700271 int old_index, new_index;
272
Viresh Kumara9aaf292015-01-13 11:34:00 +0530273 if (!policy) {
274 pr_err("%s: No policy found\n", __func__);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700275 return 0;
Viresh Kumara9aaf292015-01-13 11:34:00 +0530276 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700277
Viresh Kumara9aaf292015-01-13 11:34:00 +0530278 if (val != CPUFREQ_POSTCHANGE)
279 goto put_policy;
280
281 if (!policy->stats) {
282 pr_debug("%s: No stats found\n", __func__);
283 goto put_policy;
284 }
285
Viresh Kumar50941602015-01-06 21:09:07 +0530286 stats = policy->stats;
Venkatesh Pallipadi8edc59d92006-12-19 12:58:55 -0800287
Viresh Kumar50941602015-01-06 21:09:07 +0530288 old_index = stats->last_index;
289 new_index = freq_table_get_index(stats, freq->new);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700290
Viresh Kumar50941602015-01-06 21:09:07 +0530291 /* We can't do stats->time_in_state[-1]= .. */
Konrad Rzeszutek Wilk46a310b2011-06-16 15:36:38 -0400292 if (old_index == -1 || new_index == -1)
Viresh Kumara9aaf292015-01-13 11:34:00 +0530293 goto put_policy;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700294
Viresh Kumar50941602015-01-06 21:09:07 +0530295 cpufreq_stats_update(stats);
Konrad Rzeszutek Wilk46a310b2011-06-16 15:36:38 -0400296
297 if (old_index == new_index)
Viresh Kumara9aaf292015-01-13 11:34:00 +0530298 goto put_policy;
Venkatesh Pallipadi8edc59d92006-12-19 12:58:55 -0800299
Linus Torvalds1da177e2005-04-16 15:20:36 -0700300 spin_lock(&cpufreq_stats_lock);
Viresh Kumar50941602015-01-06 21:09:07 +0530301 stats->last_index = new_index;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700302#ifdef CONFIG_CPU_FREQ_STAT_DETAILS
Viresh Kumar50941602015-01-06 21:09:07 +0530303 stats->trans_table[old_index * stats->max_state + new_index]++;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700304#endif
Viresh Kumar50941602015-01-06 21:09:07 +0530305 stats->total_trans++;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700306 spin_unlock(&cpufreq_stats_lock);
Viresh Kumara9aaf292015-01-13 11:34:00 +0530307
308put_policy:
309 cpufreq_cpu_put(policy);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700310 return 0;
311}
312
313static struct notifier_block notifier_policy_block = {
314 .notifier_call = cpufreq_stat_notifier_policy
315};
316
317static struct notifier_block notifier_trans_block = {
318 .notifier_call = cpufreq_stat_notifier_trans
319};
320
Dave Jones0a829c52009-01-18 01:49:04 -0500321static int __init cpufreq_stats_init(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700322{
323 int ret;
324 unsigned int cpu;
Ashok Rajc32b6b82005-10-30 14:59:54 -0800325
Linus Torvalds1da177e2005-04-16 15:20:36 -0700326 spin_lock_init(&cpufreq_stats_lock);
Dave Jones0a829c52009-01-18 01:49:04 -0500327 ret = cpufreq_register_notifier(&notifier_policy_block,
328 CPUFREQ_POLICY_NOTIFIER);
329 if (ret)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700330 return ret;
331
Viresh Kumarb3f9ff82014-01-07 07:10:13 +0530332 for_each_online_cpu(cpu)
333 cpufreq_stats_create_table(cpu);
334
Dave Jones0a829c52009-01-18 01:49:04 -0500335 ret = cpufreq_register_notifier(&notifier_trans_block,
336 CPUFREQ_TRANSITION_NOTIFIER);
337 if (ret) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700338 cpufreq_unregister_notifier(&notifier_policy_block,
339 CPUFREQ_POLICY_NOTIFIER);
Konstantin Khlebnikov56836fb2012-12-15 00:22:02 +0100340 for_each_online_cpu(cpu)
341 cpufreq_stats_free_table(cpu);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700342 return ret;
343 }
344
Linus Torvalds1da177e2005-04-16 15:20:36 -0700345 return 0;
346}
Dave Jones0a829c52009-01-18 01:49:04 -0500347static void __exit cpufreq_stats_exit(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700348{
349 unsigned int cpu;
Ashok Rajc32b6b82005-10-30 14:59:54 -0800350
Linus Torvalds1da177e2005-04-16 15:20:36 -0700351 cpufreq_unregister_notifier(&notifier_policy_block,
352 CPUFREQ_POLICY_NOTIFIER);
353 cpufreq_unregister_notifier(&notifier_trans_block,
354 CPUFREQ_TRANSITION_NOTIFIER);
Viresh Kumar2d135942014-01-07 07:10:12 +0530355 for_each_online_cpu(cpu)
Satyam Sharma55395ae2007-10-02 13:28:15 -0700356 cpufreq_stats_free_table(cpu);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700357}
358
Dave Jones0a829c52009-01-18 01:49:04 -0500359MODULE_AUTHOR("Zou Nan hai <nanhai.zou@intel.com>");
Viresh Kumar00d0b292015-01-06 21:09:00 +0530360MODULE_DESCRIPTION("Export cpufreq stats via sysfs");
Dave Jones0a829c52009-01-18 01:49:04 -0500361MODULE_LICENSE("GPL");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700362
363module_init(cpufreq_stats_init);
364module_exit(cpufreq_stats_exit);