Skip to content

Commit c6ccb69

Browse files
geertustorulf
authored andcommitted
pmdomain: core: Reduce debug summary table width
Commit 9094e53 ("pmdomain: core: Use dev_name() instead of kobject_get_path() in debugfs") severely shortened the names of devices in a PM Domain. Now the most common format[1] consists of a 32-bit unit-address (8 characters), followed by a dot and a node name (20 characters for "air-pollution-sensor" and "interrupt-controller", which are the longest generic node names documented in the Devicetree Specification), for a typical maximum of 29 characters. This offers a good opportunity to reduce the table width of the debug summary: - Reduce the device name field width from 50 to 30 characters, which matches the PM Domain name width, - Reduce the large inter-column space between the "performance" and "managed by" columns. Visual impact: - The "performance" column now starts at a position that is a multiple of 16, just like the "status" and "children" columns, - All of the "/device", "runtime status", and "managed by" columns are now indented 4 characters more than the columns right above them, - Everything fits in (one less than) 80 characters again ;-) [1] Note that some device names (e.g. TI AM335x interconnect target modules) do not follow this convention, and may be much longer, but these didn't fit in the old 50-character column width either. Signed-off-by: Geert Uytterhoeven <[email protected]> Link: https://lore.kernel.org/r/f8e1821364b6d5d11350447c128f6d2b470f33fe.1725459707.git.geert+renesas@glider.be Signed-off-by: Ulf Hansson <[email protected]>
1 parent 2fc9341 commit c6ccb69

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

drivers/pmdomain/core.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3227,7 +3227,7 @@ static void rtpm_status_str(struct seq_file *s, struct device *dev)
32273227
else
32283228
WARN_ON(1);
32293229

3230-
seq_printf(s, "%-25s ", p);
3230+
seq_printf(s, "%-26s ", p);
32313231
}
32323232

32333233
static void perf_status_str(struct seq_file *s, struct device *dev)
@@ -3245,7 +3245,7 @@ static void mode_status_str(struct seq_file *s, struct device *dev)
32453245

32463246
gpd_data = to_gpd_data(dev->power.subsys_data->domain_data);
32473247

3248-
seq_printf(s, "%9s", gpd_data->hw_mode ? "HW" : "SW");
3248+
seq_printf(s, "%2s", gpd_data->hw_mode ? "HW" : "SW");
32493249
}
32503250

32513251
static int genpd_summary_one(struct seq_file *s,
@@ -3272,7 +3272,7 @@ static int genpd_summary_one(struct seq_file *s,
32723272
else
32733273
snprintf(state, sizeof(state), "%s",
32743274
status_lookup[genpd->status]);
3275-
seq_printf(s, "%-30s %-49s %u", genpd->name, state, genpd->performance_state);
3275+
seq_printf(s, "%-30s %-30s %u", genpd->name, state, genpd->performance_state);
32763276

32773277
/*
32783278
* Modifications on the list require holding locks on both
@@ -3288,7 +3288,7 @@ static int genpd_summary_one(struct seq_file *s,
32883288
}
32893289

32903290
list_for_each_entry(pm_data, &genpd->dev_list, list_node) {
3291-
seq_printf(s, "\n %-50s ", dev_name(pm_data->dev));
3291+
seq_printf(s, "\n %-30s ", dev_name(pm_data->dev));
32923292
rtpm_status_str(s, pm_data->dev);
32933293
perf_status_str(s, pm_data->dev);
32943294
mode_status_str(s, pm_data->dev);
@@ -3306,9 +3306,9 @@ static int summary_show(struct seq_file *s, void *data)
33063306
struct generic_pm_domain *genpd;
33073307
int ret = 0;
33083308

3309-
seq_puts(s, "domain status children performance\n");
3310-
seq_puts(s, " /device runtime status managed by\n");
3311-
seq_puts(s, "------------------------------------------------------------------------------------------------------------\n");
3309+
seq_puts(s, "domain status children performance\n");
3310+
seq_puts(s, " /device runtime status managed by\n");
3311+
seq_puts(s, "------------------------------------------------------------------------------\n");
33123312

33133313
ret = mutex_lock_interruptible(&gpd_list_lock);
33143314
if (ret)

0 commit comments

Comments
 (0)