@@ -29,6 +29,7 @@
#include <linux/completion.h>
#include <linux/mutex.h>
#include <linux/syscore_ops.h>
+#include <linux/sched.h>
#include <trace/events/power.h>
@@ -424,6 +425,17 @@ static ssize_t show_scaling_governor(struct cpufreq_policy *policy, char *buf)
}
+static void printk_task_chain(struct task_struct *t)
+{
+ get_task_struct(t);
+ if(t->real_parent != NULL && t->real_parent != t && t->pid != 1) {
+ printk_task_chain(t->real_parent);
+ printk("->");
+ }
+ printk("%s[%d]", t->comm, t->pid);
+ put_task_struct(t);
+}
+
/**
* store_scaling_governor - store policy for the specified CPU
*/
@@ -446,6 +458,10 @@ static ssize_t store_scaling_governor(struct cpufreq_policy *policy,
&new_policy.governor))
return -EINVAL;
+ printk(KERN_INFO "cpufreq: ");
+ printk_task_chain(current);
+ printk(": scaling_governor -> %s on CPU%d\n", str_governor, policy->cpu);
+
/* Do not use cpufreq_set_policy here or the user_policy.max
will be wrongly overridden */
ret = __cpufreq_set_policy(policy, &new_policy);