[PATCH] cgroup: /proc/cgroups output alignment

From: liuq
Date: Mon Jan 30 2023 - 04:19:26 EST


/proc/cgroups output alignment for easy read

Signed-off-by: liuq <liuq131@xxxxxxxxxxxxxxx>
---
kernel/cgroup/cgroup-v1.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/cgroup/cgroup-v1.c b/kernel/cgroup/cgroup-v1.c
index 52bb5a74a23b..ff82d61ae76f 100644
--- a/kernel/cgroup/cgroup-v1.c
+++ b/kernel/cgroup/cgroup-v1.c
@@ -670,14 +670,14 @@ int proc_cgroupstats_show(struct seq_file *m, void *v)
struct cgroup_subsys *ss;
int i;

- seq_puts(m, "#subsys_name\thierarchy\tnum_cgroups\tenabled\n");
+ seq_puts(m, "#subsys_name hierarchy num_cgroups enabled\n");
/*
* Grab the subsystems state racily. No need to add avenue to
* cgroup_mutex contention.
*/

for_each_subsys(ss, i)
- seq_printf(m, "%s\t%d\t%d\t%d\n",
+ seq_printf(m, "%-20s%-14d%-14d%-14d\n",
ss->legacy_name, ss->root->hierarchy_id,
atomic_read(&ss->root->nr_cgrps),
cgroup_ssid_enabled(i));
--
2.27.0