Skip to content

Commit 1685748

Browse files
lukaszluba-armrafaeljw
authored andcommitted
PM: EM: Remove old debugfs files and print all 'flags'
The Energy Model gets more bits used in 'flags'. Avoid adding another debugfs file just to print what is the status of a new flag. Simply remove old debugfs files and add one generic which prints all flags as a hex value. Signed-off-by: Lukasz Luba <lukasz.luba@arm.com> Reviewed-by: Ionela Voinescu <ionela.voinescu@arm.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 75a3a99 commit 1685748

1 file changed

Lines changed: 5 additions & 19 deletions

File tree

kernel/power/energy_model.c

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -54,28 +54,15 @@ static int em_debug_cpus_show(struct seq_file *s, void *unused)
5454
}
5555
DEFINE_SHOW_ATTRIBUTE(em_debug_cpus);
5656

57-
static int em_debug_units_show(struct seq_file *s, void *unused)
57+
static int em_debug_flags_show(struct seq_file *s, void *unused)
5858
{
5959
struct em_perf_domain *pd = s->private;
60-
char *units = (pd->flags & EM_PERF_DOMAIN_MILLIWATTS) ?
61-
"milliWatts" : "bogoWatts";
6260

63-
seq_printf(s, "%s\n", units);
61+
seq_printf(s, "%#lx\n", pd->flags);
6462

6563
return 0;
6664
}
67-
DEFINE_SHOW_ATTRIBUTE(em_debug_units);
68-
69-
static int em_debug_skip_inefficiencies_show(struct seq_file *s, void *unused)
70-
{
71-
struct em_perf_domain *pd = s->private;
72-
int enabled = (pd->flags & EM_PERF_DOMAIN_SKIP_INEFFICIENCIES) ? 1 : 0;
73-
74-
seq_printf(s, "%d\n", enabled);
75-
76-
return 0;
77-
}
78-
DEFINE_SHOW_ATTRIBUTE(em_debug_skip_inefficiencies);
65+
DEFINE_SHOW_ATTRIBUTE(em_debug_flags);
7966

8067
static void em_debug_create_pd(struct device *dev)
8168
{
@@ -89,9 +76,8 @@ static void em_debug_create_pd(struct device *dev)
8976
debugfs_create_file("cpus", 0444, d, dev->em_pd->cpus,
9077
&em_debug_cpus_fops);
9178

92-
debugfs_create_file("units", 0444, d, dev->em_pd, &em_debug_units_fops);
93-
debugfs_create_file("skip-inefficiencies", 0444, d, dev->em_pd,
94-
&em_debug_skip_inefficiencies_fops);
79+
debugfs_create_file("flags", 0444, d, dev->em_pd,
80+
&em_debug_flags_fops);
9581

9682
/* Create a sub-directory for each performance state */
9783
for (i = 0; i < dev->em_pd->nr_perf_states; i++)

0 commit comments

Comments
 (0)