Loading kernel/power/energy_model.c +30 −0 Original line number Diff line number Diff line Loading @@ -55,6 +55,11 @@ static void em_debug_create_pd(struct em_perf_domain *pd, int cpu) char name[8]; int i; if (!rootdir) { pr_err("Power domains created prior to em_debug_init\n"); return; } snprintf(name, sizeof(name), "pd%d", cpu); /* Create the directory of the performance domain */ Loading @@ -69,9 +74,34 @@ static void em_debug_create_pd(struct em_perf_domain *pd, int cpu) static int __init em_debug_init(void) { int cpu; struct em_perf_domain *pd; cpumask_t span; cpumask_copy(&span, cpu_possible_mask); /* Create /sys/kernel/debug/energy_model directory */ rootdir = debugfs_create_dir("energy_model", NULL); for_each_cpu(cpu, &span) { char name[8]; pd = em_cpu_get(cpu); if (!pd) { pr_info("Power domains not created yet\n"); break; } snprintf(name, sizeof(name), "pd%d", cpu); if (debugfs_lookup(name, rootdir)) { pr_info("Power domains already created\n"); break; } em_debug_create_pd(pd, cpu); cpumask_andnot(&span, &span, to_cpumask(pd->cpus)); } return 0; } fs_initcall(em_debug_init); Loading Loading
kernel/power/energy_model.c +30 −0 Original line number Diff line number Diff line Loading @@ -55,6 +55,11 @@ static void em_debug_create_pd(struct em_perf_domain *pd, int cpu) char name[8]; int i; if (!rootdir) { pr_err("Power domains created prior to em_debug_init\n"); return; } snprintf(name, sizeof(name), "pd%d", cpu); /* Create the directory of the performance domain */ Loading @@ -69,9 +74,34 @@ static void em_debug_create_pd(struct em_perf_domain *pd, int cpu) static int __init em_debug_init(void) { int cpu; struct em_perf_domain *pd; cpumask_t span; cpumask_copy(&span, cpu_possible_mask); /* Create /sys/kernel/debug/energy_model directory */ rootdir = debugfs_create_dir("energy_model", NULL); for_each_cpu(cpu, &span) { char name[8]; pd = em_cpu_get(cpu); if (!pd) { pr_info("Power domains not created yet\n"); break; } snprintf(name, sizeof(name), "pd%d", cpu); if (debugfs_lookup(name, rootdir)) { pr_info("Power domains already created\n"); break; } em_debug_create_pd(pd, cpu); cpumask_andnot(&span, &span, to_cpumask(pd->cpus)); } return 0; } fs_initcall(em_debug_init); Loading