Skip to content

Commit a1b2566

Browse files
rmurphy-armgregkh
authored andcommitted
perf/arm-cmn: Improve debugfs pretty-printing for large configs
[ Upstream commit a1083ee ] The debugfs pretty-printer was written for the CMN-600 assumptions of a maximum 8x8 mesh, but CMN-700 now allows coordinates and ID values up to 12 and 128 respectively, which can overflow the format strings, mess up the alignment of the table and hurt overall readability. This table does prove useful for double-checking that the driver is picking up the topology of new systems correctly and for verifying user expectations, so tweak the formatting to stay nice and readable with wider values. Signed-off-by: Robin Murphy <[email protected]> Link: https://lore.kernel.org/r/1d1517eadd1bac5992fab679c9dc531b381944da.1702484646.git.robin.murphy@arm.com Signed-off-by: Will Deacon <[email protected]> Stable-dep-of: e79634b ("perf/arm-cmn: Refactor node ID handling. Again.") Signed-off-by: Sasha Levin <[email protected]>
1 parent f5c4ec8 commit a1b2566

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

drivers/perf/arm-cmn.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,7 @@ static void arm_cmn_show_logid(struct seq_file *s, int x, int y, int p, int d)
493493

494494
for (dn = cmn->dns; dn->type; dn++) {
495495
struct arm_cmn_nodeid nid = arm_cmn_nid(cmn, dn->id);
496+
int pad = dn->logid < 10;
496497

497498
if (dn->type == CMN_TYPE_XP)
498499
continue;
@@ -503,7 +504,7 @@ static void arm_cmn_show_logid(struct seq_file *s, int x, int y, int p, int d)
503504
if (nid.x != x || nid.y != y || nid.port != p || nid.dev != d)
504505
continue;
505506

506-
seq_printf(s, " #%-2d |", dn->logid);
507+
seq_printf(s, " %*c#%-*d |", pad + 1, ' ', 3 - pad, dn->logid);
507508
return;
508509
}
509510
seq_puts(s, " |");
@@ -516,7 +517,7 @@ static int arm_cmn_map_show(struct seq_file *s, void *data)
516517

517518
seq_puts(s, " X");
518519
for (x = 0; x < cmn->mesh_x; x++)
519-
seq_printf(s, " %d ", x);
520+
seq_printf(s, " %-2d ", x);
520521
seq_puts(s, "\nY P D+");
521522
y = cmn->mesh_y;
522523
while (y--) {
@@ -526,13 +527,13 @@ static int arm_cmn_map_show(struct seq_file *s, void *data)
526527
for (x = 0; x < cmn->mesh_x; x++)
527528
seq_puts(s, "--------+");
528529

529-
seq_printf(s, "\n%d |", y);
530+
seq_printf(s, "\n%-2d |", y);
530531
for (x = 0; x < cmn->mesh_x; x++) {
531532
struct arm_cmn_node *xp = cmn->xps + xp_base + x;
532533

533534
for (p = 0; p < CMN_MAX_PORTS; p++)
534535
port[p][x] = arm_cmn_device_connect_info(cmn, xp, p);
535-
seq_printf(s, " XP #%-2d |", xp_base + x);
536+
seq_printf(s, " XP #%-3d|", xp_base + x);
536537
}
537538

538539
seq_puts(s, "\n |");

0 commit comments

Comments
 (0)