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/cpufreq_userspace.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/cpufreq_userspace.c')
-rw-r--r-- | drivers/cpufreq/cpufreq_userspace.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/cpufreq/cpufreq_userspace.c b/drivers/cpufreq/cpufreq_userspace.c index 66d2d1d6c80f..f231015904c0 100644 --- a/drivers/cpufreq/cpufreq_userspace.c +++ b/drivers/cpufreq/cpufreq_userspace.c | |||
@@ -37,9 +37,6 @@ static DEFINE_PER_CPU(unsigned int, cpu_is_managed); | |||
37 | static DEFINE_MUTEX(userspace_mutex); | 37 | static DEFINE_MUTEX(userspace_mutex); |
38 | static int cpus_using_userspace_governor; | 38 | static int cpus_using_userspace_governor; |
39 | 39 | ||
40 | #define dprintk(msg...) \ | ||
41 | cpufreq_debug_printk(CPUFREQ_DEBUG_GOVERNOR, "userspace", msg) | ||
42 | |||
43 | /* keep track of frequency transitions */ | 40 | /* keep track of frequency transitions */ |
44 | static int | 41 | static int |
45 | userspace_cpufreq_notifier(struct notifier_block *nb, unsigned long val, | 42 | userspace_cpufreq_notifier(struct notifier_block *nb, unsigned long val, |
@@ -50,7 +47,7 @@ userspace_cpufreq_notifier(struct notifier_block *nb, unsigned long val, | |||
50 | if (!per_cpu(cpu_is_managed, freq->cpu)) | 47 | if (!per_cpu(cpu_is_managed, freq->cpu)) |
51 | return 0; | 48 | return 0; |
52 | 49 | ||
53 | dprintk("saving cpu_cur_freq of cpu %u to be %u kHz\n", | 50 | pr_debug("saving cpu_cur_freq of cpu %u to be %u kHz\n", |
54 | freq->cpu, freq->new); | 51 | freq->cpu, freq->new); |
55 | per_cpu(cpu_cur_freq, freq->cpu) = freq->new; | 52 | per_cpu(cpu_cur_freq, freq->cpu) = freq->new; |
56 | 53 | ||
@@ -73,7 +70,7 @@ static int cpufreq_set(struct cpufreq_policy *policy, unsigned int freq) | |||
73 | { | 70 | { |
74 | int ret = -EINVAL; | 71 | int ret = -EINVAL; |
75 | 72 | ||
76 | dprintk("cpufreq_set for cpu %u, freq %u kHz\n", policy->cpu, freq); | 73 | pr_debug("cpufreq_set for cpu %u, freq %u kHz\n", policy->cpu, freq); |
77 | 74 | ||
78 | mutex_lock(&userspace_mutex); | 75 | mutex_lock(&userspace_mutex); |
79 | if (!per_cpu(cpu_is_managed, policy->cpu)) | 76 | if (!per_cpu(cpu_is_managed, policy->cpu)) |
@@ -134,7 +131,7 @@ static int cpufreq_governor_userspace(struct cpufreq_policy *policy, | |||
134 | per_cpu(cpu_max_freq, cpu) = policy->max; | 131 | per_cpu(cpu_max_freq, cpu) = policy->max; |
135 | per_cpu(cpu_cur_freq, cpu) = policy->cur; | 132 | per_cpu(cpu_cur_freq, cpu) = policy->cur; |
136 | per_cpu(cpu_set_freq, cpu) = policy->cur; | 133 | per_cpu(cpu_set_freq, cpu) = policy->cur; |
137 | dprintk("managing cpu %u started " | 134 | pr_debug("managing cpu %u started " |
138 | "(%u - %u kHz, currently %u kHz)\n", | 135 | "(%u - %u kHz, currently %u kHz)\n", |
139 | cpu, | 136 | cpu, |
140 | per_cpu(cpu_min_freq, cpu), | 137 | per_cpu(cpu_min_freq, cpu), |
@@ -156,12 +153,12 @@ static int cpufreq_governor_userspace(struct cpufreq_policy *policy, | |||
156 | per_cpu(cpu_min_freq, cpu) = 0; | 153 | per_cpu(cpu_min_freq, cpu) = 0; |
157 | per_cpu(cpu_max_freq, cpu) = 0; | 154 | per_cpu(cpu_max_freq, cpu) = 0; |
158 | per_cpu(cpu_set_freq, cpu) = 0; | 155 | per_cpu(cpu_set_freq, cpu) = 0; |
159 | dprintk("managing cpu %u stopped\n", cpu); | 156 | pr_debug("managing cpu %u stopped\n", cpu); |
160 | mutex_unlock(&userspace_mutex); | 157 | mutex_unlock(&userspace_mutex); |
161 | break; | 158 | break; |
162 | case CPUFREQ_GOV_LIMITS: | 159 | case CPUFREQ_GOV_LIMITS: |
163 | mutex_lock(&userspace_mutex); | 160 | mutex_lock(&userspace_mutex); |
164 | dprintk("limit event for cpu %u: %u - %u kHz, " | 161 | pr_debug("limit event for cpu %u: %u - %u kHz, " |
165 | "currently %u kHz, last set to %u kHz\n", | 162 | "currently %u kHz, last set to %u kHz\n", |
166 | cpu, policy->min, policy->max, | 163 | cpu, policy->min, policy->max, |
167 | per_cpu(cpu_cur_freq, cpu), | 164 | per_cpu(cpu_cur_freq, cpu), |