Commit 31f8eef3 authored by Dave Jones's avatar Dave Jones

[CPUFREQ] Add a few dprintks for the userspace cpufreq governor.

Signed-off-by: default avatarDominik Brodowski <linux@brodo.de>
Signed-off-by: default avatarDave Jones <davej@redhat.com>
parent 304865c1
...@@ -75,6 +75,7 @@ static struct cpufreq_policy current_policy[NR_CPUS]; ...@@ -75,6 +75,7 @@ static struct cpufreq_policy current_policy[NR_CPUS];
static DECLARE_MUTEX (userspace_sem); static DECLARE_MUTEX (userspace_sem);
#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_GOVERNOR, "userspace", msg)
/* keep track of frequency transitions */ /* keep track of frequency transitions */
static int static int
...@@ -83,6 +84,7 @@ userspace_cpufreq_notifier(struct notifier_block *nb, unsigned long val, ...@@ -83,6 +84,7 @@ userspace_cpufreq_notifier(struct notifier_block *nb, unsigned long val,
{ {
struct cpufreq_freqs *freq = data; struct cpufreq_freqs *freq = data;
dprintk("saving cpu_cur_freq of cpu %u to be %u kHz\n", freq->cpu, freq->new);
cpu_cur_freq[freq->cpu] = freq->new; cpu_cur_freq[freq->cpu] = freq->new;
return 0; return 0;
...@@ -104,6 +106,8 @@ static int _cpufreq_set(unsigned int freq, unsigned int cpu) ...@@ -104,6 +106,8 @@ static int _cpufreq_set(unsigned int freq, unsigned int cpu)
{ {
int ret = -EINVAL; int ret = -EINVAL;
dprintk("_cpufreq_set for cpu %u, freq %u kHz\n", cpu, freq);
down(&userspace_sem); down(&userspace_sem);
if (!cpu_is_managed[cpu]) if (!cpu_is_managed[cpu])
goto err; goto err;
...@@ -527,6 +531,7 @@ static int cpufreq_governor_userspace(struct cpufreq_policy *policy, ...@@ -527,6 +531,7 @@ static int cpufreq_governor_userspace(struct cpufreq_policy *policy,
cpu_set_freq[cpu] = policy->cur; cpu_set_freq[cpu] = policy->cur;
sysfs_create_file (&policy->kobj, &freq_attr_scaling_setspeed.attr); sysfs_create_file (&policy->kobj, &freq_attr_scaling_setspeed.attr);
memcpy (&current_policy[cpu], policy, sizeof(struct cpufreq_policy)); memcpy (&current_policy[cpu], policy, sizeof(struct cpufreq_policy));
dprintk("managing cpu %u started (%u - %u kHz, currently %u kHz)\n", cpu, cpu_min_freq[cpu], cpu_max_freq[cpu], cpu_cur_freq[cpu]);
up(&userspace_sem); up(&userspace_sem);
break; break;
case CPUFREQ_GOV_STOP: case CPUFREQ_GOV_STOP:
...@@ -536,12 +541,14 @@ static int cpufreq_governor_userspace(struct cpufreq_policy *policy, ...@@ -536,12 +541,14 @@ static int cpufreq_governor_userspace(struct cpufreq_policy *policy,
cpu_max_freq[cpu] = 0; cpu_max_freq[cpu] = 0;
cpu_set_freq[cpu] = 0; cpu_set_freq[cpu] = 0;
sysfs_remove_file (&policy->kobj, &freq_attr_scaling_setspeed.attr); sysfs_remove_file (&policy->kobj, &freq_attr_scaling_setspeed.attr);
dprintk("managing cpu %u stopped\n", cpu);
up(&userspace_sem); up(&userspace_sem);
break; break;
case CPUFREQ_GOV_LIMITS: case CPUFREQ_GOV_LIMITS:
down(&userspace_sem); down(&userspace_sem);
cpu_min_freq[cpu] = policy->min; cpu_min_freq[cpu] = policy->min;
cpu_max_freq[cpu] = policy->max; cpu_max_freq[cpu] = policy->max;
dprintk("limit event for cpu %u: %u - %u kHz, currently %u kHz, last set to %u kHz\n", cpu, cpu_min_freq[cpu], cpu_max_freq[cpu], cpu_cur_freq[cpu], cpu_set_freq[cpu]);
if (policy->max < cpu_set_freq[cpu]) { if (policy->max < cpu_set_freq[cpu]) {
__cpufreq_driver_target(&current_policy[cpu], policy->max, __cpufreq_driver_target(&current_policy[cpu], policy->max,
CPUFREQ_RELATION_H); CPUFREQ_RELATION_H);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment