diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2011-03-27 09:04:46 -0400 |
---|---|---|
committer | Dave Jones <davej@redhat.com> | 2011-05-04 11:50:57 -0400 |
commit | 2d06d8c49afdcc9bb35a85039fa50f0fe35bd40e (patch) | |
tree | d933a68fc71f6e2c3b95b744a87fa1d817bea3d6 /drivers/cpufreq/freq_table.c | |
parent | 27ecddc2a9f99ce4ac9a59a0acd77f7100b6d034 (diff) |
[CPUFREQ] use dynamic debug instead of custom infrastructure
With dynamic debug having gained the capability to report debug messages
also during the boot process, it offers a far superior interface for
debug messages than the custom cpufreq infrastructure. As a first step,
remove the old cpufreq_debug_printk() function and replace it with a call
to the generic pr_debug() function.
How can dynamic debug be used on cpufreq? You need a kernel which has
CONFIG_DYNAMIC_DEBUG enabled.
To enabled debugging during runtime, mount debugfs and
$ echo -n 'module cpufreq +p' > /sys/kernel/debug/dynamic_debug/control
for debugging the complete "cpufreq" module. To achieve the same goal during
boot, append
ddebug_query="module cpufreq +p"
as a boot parameter to the kernel of your choice.
For more detailled instructions, please see
Documentation/dynamic-debug-howto.txt
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Dave Jones <davej@redhat.com>
Diffstat (limited to 'drivers/cpufreq/freq_table.c')
-rw-r--r-- | drivers/cpufreq/freq_table.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/drivers/cpufreq/freq_table.c b/drivers/cpufreq/freq_table.c index 05432216e224..90431cb92804 100644 --- a/drivers/cpufreq/freq_table.c +++ b/drivers/cpufreq/freq_table.c | |||
@@ -14,9 +14,6 @@ | |||
14 | #include <linux/init.h> | 14 | #include <linux/init.h> |
15 | #include <linux/cpufreq.h> | 15 | #include <linux/cpufreq.h> |
16 | 16 | ||
17 | #define dprintk(msg...) \ | ||
18 | cpufreq_debug_printk(CPUFREQ_DEBUG_CORE, "freq-table", msg) | ||
19 | |||
20 | /********************************************************************* | 17 | /********************************************************************* |
21 | * FREQUENCY TABLE HELPERS * | 18 | * FREQUENCY TABLE HELPERS * |
22 | *********************************************************************/ | 19 | *********************************************************************/ |
@@ -31,11 +28,11 @@ int cpufreq_frequency_table_cpuinfo(struct cpufreq_policy *policy, | |||
31 | for (i = 0; (table[i].frequency != CPUFREQ_TABLE_END); i++) { | 28 | for (i = 0; (table[i].frequency != CPUFREQ_TABLE_END); i++) { |
32 | unsigned int freq = table[i].frequency; | 29 | unsigned int freq = table[i].frequency; |
33 | if (freq == CPUFREQ_ENTRY_INVALID) { | 30 | if (freq == CPUFREQ_ENTRY_INVALID) { |
34 | dprintk("table entry %u is invalid, skipping\n", i); | 31 | pr_debug("table entry %u is invalid, skipping\n", i); |
35 | 32 | ||
36 | continue; | 33 | continue; |
37 | } | 34 | } |
38 | dprintk("table entry %u: %u kHz, %u index\n", | 35 | pr_debug("table entry %u: %u kHz, %u index\n", |
39 | i, freq, table[i].index); | 36 | i, freq, table[i].index); |
40 | if (freq < min_freq) | 37 | if (freq < min_freq) |
41 | min_freq = freq; | 38 | min_freq = freq; |
@@ -61,7 +58,7 @@ int cpufreq_frequency_table_verify(struct cpufreq_policy *policy, | |||
61 | unsigned int i; | 58 | unsigned int i; |
62 | unsigned int count = 0; | 59 | unsigned int count = 0; |
63 | 60 | ||
64 | dprintk("request for verification of policy (%u - %u kHz) for cpu %u\n", | 61 | pr_debug("request for verification of policy (%u - %u kHz) for cpu %u\n", |
65 | policy->min, policy->max, policy->cpu); | 62 | policy->min, policy->max, policy->cpu); |
66 | 63 | ||
67 | if (!cpu_online(policy->cpu)) | 64 | if (!cpu_online(policy->cpu)) |
@@ -86,7 +83,7 @@ int cpufreq_frequency_table_verify(struct cpufreq_policy *policy, | |||
86 | cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq, | 83 | cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq, |
87 | policy->cpuinfo.max_freq); | 84 | policy->cpuinfo.max_freq); |
88 | 85 | ||
89 | dprintk("verification lead to (%u - %u kHz) for cpu %u\n", | 86 | pr_debug("verification lead to (%u - %u kHz) for cpu %u\n", |
90 | policy->min, policy->max, policy->cpu); | 87 | policy->min, policy->max, policy->cpu); |
91 | 88 | ||
92 | return 0; | 89 | return 0; |
@@ -110,7 +107,7 @@ int cpufreq_frequency_table_target(struct cpufreq_policy *policy, | |||
110 | }; | 107 | }; |
111 | unsigned int i; | 108 | unsigned int i; |
112 | 109 | ||
113 | dprintk("request for target %u kHz (relation: %u) for cpu %u\n", | 110 | pr_debug("request for target %u kHz (relation: %u) for cpu %u\n", |
114 | target_freq, relation, policy->cpu); | 111 | target_freq, relation, policy->cpu); |
115 | 112 | ||
116 | switch (relation) { | 113 | switch (relation) { |
@@ -167,7 +164,7 @@ int cpufreq_frequency_table_target(struct cpufreq_policy *policy, | |||
167 | } else | 164 | } else |
168 | *index = optimal.index; | 165 | *index = optimal.index; |
169 | 166 | ||
170 | dprintk("target is %u (%u kHz, %u)\n", *index, table[*index].frequency, | 167 | pr_debug("target is %u (%u kHz, %u)\n", *index, table[*index].frequency, |
171 | table[*index].index); | 168 | table[*index].index); |
172 | 169 | ||
173 | return 0; | 170 | return 0; |
@@ -216,14 +213,14 @@ EXPORT_SYMBOL_GPL(cpufreq_freq_attr_scaling_available_freqs); | |||
216 | void cpufreq_frequency_table_get_attr(struct cpufreq_frequency_table *table, | 213 | void cpufreq_frequency_table_get_attr(struct cpufreq_frequency_table *table, |
217 | unsigned int cpu) | 214 | unsigned int cpu) |
218 | { | 215 | { |
219 | dprintk("setting show_table for cpu %u to %p\n", cpu, table); | 216 | pr_debug("setting show_table for cpu %u to %p\n", cpu, table); |
220 | per_cpu(cpufreq_show_table, cpu) = table; | 217 | per_cpu(cpufreq_show_table, cpu) = table; |
221 | } | 218 | } |
222 | EXPORT_SYMBOL_GPL(cpufreq_frequency_table_get_attr); | 219 | EXPORT_SYMBOL_GPL(cpufreq_frequency_table_get_attr); |
223 | 220 | ||
224 | void cpufreq_frequency_table_put_attr(unsigned int cpu) | 221 | void cpufreq_frequency_table_put_attr(unsigned int cpu) |
225 | { | 222 | { |
226 | dprintk("clearing show_table for cpu %u\n", cpu); | 223 | pr_debug("clearing show_table for cpu %u\n", cpu); |
227 | per_cpu(cpufreq_show_table, cpu) = NULL; | 224 | per_cpu(cpufreq_show_table, cpu) = NULL; |
228 | } | 225 | } |
229 | EXPORT_SYMBOL_GPL(cpufreq_frequency_table_put_attr); | 226 | EXPORT_SYMBOL_GPL(cpufreq_frequency_table_put_attr); |