Skip to contentSkip to conversation

cgroup: Fix indent for /proc/cgroups

PATCH In review Gui Jianfeng 5 participants 9 messages Jul 3, 2009 3 messages not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cgroup: Fix indent for /proc/cgroups

Currently, /proc/cgroups outputs is fairly ugly as following,

#subsys_name    hierarchy       num_cgroups     enabled
cpuset  0       1       1
debug   0       1       1
ns      0       1       1

indent it in a good-looking way.

#subsys_name    hierarchy       num_cgroups     enabled
cpuset          0               1               1
debug           0               1               1
ns              0               1               1
---
 kernel/cgroup.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
kernel/cgroup.c +1 -1
index 3737a68..99fc160 100644
@@ -2963,7 +2963,7 @@ static int proc_cgroupstats_show(struct seq_file *m, void *v)
 	mutex_lock(&cgroup_mutex);
 	for (i = 0; i < CGROUP_SUBSYS_COUNT; i++) {
 		struct cgroup_subsys *ss = subsys[i];
-		seq_printf(m, "%s\t%lu\t%d\t%d\n",
+		seq_printf(m, "%s\t\t%lu\t\t%d\t\t%d\n",
 			   ss->name, ss->root->subsys_bits,
 			   ss->root->number_of_cgroups, !ss->disabled);
 	}
Signature · 1 line
1.5.4.rc3
#1 lore raw
CC container list
Quoted 6 lines · Gui Jianfeng

Currently, /proc/cgroups outputs is fairly ugly as following,

#subsys_name    hierarchy       num_cgroups     enabled
cpuset  0       1       1
debug   0       1       1
ns      0       1       1
Quoted 6 lines

indent it in a good-looking way.

#subsys_name    hierarchy       num_cgroups     enabled
cpuset          0               1               1
debug           0               1               1
ns              0               1               1

But if there's a subsystem with name length >= 8,
it won't be aligned properly..

Quoted 19 lines
---
 kernel/cgroup.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
kernel/cgroup.c +1 -1
index 3737a68..99fc160 100644
@@ -2963,7 +2963,7 @@ static int proc_cgroupstats_show(struct seq_file *m, void *v)
 	mutex_lock(&cgroup_mutex);
 	for (i = 0; i < CGROUP_SUBSYS_COUNT; i++) {
 		struct cgroup_subsys *ss = subsys[i];
-		seq_printf(m, "%s\t%lu\t%d\t%d\n",
+		seq_printf(m, "%s\t\t%lu\t\t%d\t\t%d\n",
 			   ss->name, ss->root->subsys_bits,
 			   ss->root->number_of_cgroups, !ss->disabled);
 	}

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw
Quoted 16 lines · Li Zefan
CC container list
Quoted 6 lines · Gui Jianfeng

Currently, /proc/cgroups outputs is fairly ugly as following,

#subsys_name    hierarchy       num_cgroups     enabled
cpuset  0       1       1
debug   0       1       1
ns      0       1       1
Quoted 6 lines

indent it in a good-looking way.

#subsys_name    hierarchy       num_cgroups     enabled
cpuset          0               1               1
debug           0               1               1
ns              0               1               1
Quoted 2 lines

But if there's a subsystem with name length >= 8,
it won't be aligned properly..

Yeap, but there isn't such a case at least by now.

Quoted 23 lines
Quoted 19 lines
---
 kernel/cgroup.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
kernel/cgroup.c +1 -1
index 3737a68..99fc160 100644
@@ -2963,7 +2963,7 @@ static int proc_cgroupstats_show(struct seq_file *m, void *v)
 	mutex_lock(&cgroup_mutex);
 	for (i = 0; i < CGROUP_SUBSYS_COUNT; i++) {
 		struct cgroup_subsys *ss = subsys[i];
-		seq_printf(m, "%s\t%lu\t%d\t%d\n",
+		seq_printf(m, "%s\t\t%lu\t\t%d\t\t%d\n",
 			   ss->name, ss->root->subsys_bits,
 			   ss->root->number_of_cgroups, !ss->disabled);
 	}
Signature · 2 lines
Regards
Gui Jianfeng
#4 lore raw
In reply to Li Zefan
Quoted 16 lines · Li Zefan
CC container list
Quoted 6 lines · Gui Jianfeng

Currently, /proc/cgroups outputs is fairly ugly as following,

#subsys_name    hierarchy       num_cgroups     enabled
cpuset  0       1       1
debug   0       1       1
ns      0       1       1
Quoted 6 lines

indent it in a good-looking way.

#subsys_name    hierarchy       num_cgroups     enabled
cpuset          0               1               1
debug           0               1               1
ns              0               1               1
Quoted 2 lines

But if there's a subsystem with name length >= 8,
it won't be aligned properly..

Yeap, but there isn't such a case at least by now.

Quoted 23 lines
Quoted 19 lines
---
 kernel/cgroup.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
kernel/cgroup.c +1 -1
index 3737a68..99fc160 100644
@@ -2963,7 +2963,7 @@ static int proc_cgroupstats_show(struct seq_file *m, void *v)
 	mutex_lock(&cgroup_mutex);
 	for (i = 0; i < CGROUP_SUBSYS_COUNT; i++) {
 		struct cgroup_subsys *ss = subsys[i];
-		seq_printf(m, "%s\t%lu\t%d\t%d\n",
+		seq_printf(m, "%s\t\t%lu\t\t%d\t\t%d\n",
 			   ss->name, ss->root->subsys_bits,
 			   ss->root->number_of_cgroups, !ss->disabled);
 	}
Signature · 2 lines
Regards
Gui Jianfeng
#5 lore raw
Quoted 16 lines · Gui Jianfeng
Quoted 15 lines · Li Zefan
CC container list
Quoted 12 lines · Gui Jianfeng

Currently, /proc/cgroups outputs is fairly ugly as following,

#subsys_name    hierarchy       num_cgroups     enabled
cpuset  0       1       1
debug   0       1       1
ns      0       1       1

indent it in a good-looking way.

#subsys_name    hierarchy       num_cgroups     enabled
cpuset          0               1               1
debug           0               1               1
ns              0               1               1
Quoted 5 lines
Quoted 2 lines

But if there's a subsystem with name length >= 8,
it won't be aligned properly..

Yeap, but there isn't such a case at least by now.

This is not a good reason.

We'll probably have such a subsystem. Actually there's a proposed subsystem named "maxdepth" which is of length 8.

See:
http://lkml.org/lkml/2009/7/1/581

#6 lore raw
Quoted 22 lines · Li Zefan
Quoted 16 lines · Gui Jianfeng
Quoted 15 lines · Li Zefan
CC container list
Quoted 12 lines · Gui Jianfeng

Currently, /proc/cgroups outputs is fairly ugly as following,

#subsys_name    hierarchy       num_cgroups     enabled
cpuset  0       1       1
debug   0       1       1
ns      0       1       1

indent it in a good-looking way.

#subsys_name    hierarchy       num_cgroups     enabled
cpuset          0               1               1
debug           0               1               1
ns              0               1               1
Quoted 4 lines
Quoted 2 lines

But if there's a subsystem with name length >= 8,
it won't be aligned properly..

Yeap, but there isn't such a case at least by now.

Quoted 7 lines

This is not a good reason.

We'll probably have such a subsystem. Actually there's a proposed subsystem named "maxdepth" which is of length 8.

See:
http://lkml.org/lkml/2009/7/1/581

yes, this is a case. But at least others can be aligned properly, right? Anyway, please ignore it if you don't like this change.

Quoted 4 lines
Signature · 2 lines
Regards
Gui Jianfeng

A message that is not in the archive (sent off-list or not yet received): [email protected]

#8 lore raw
Quoted 16 lines · Gui Jianfeng
Quoted 15 lines · Li Zefan
CC container list
Quoted 12 lines · Gui Jianfeng

Currently, /proc/cgroups outputs is fairly ugly as following,

#subsys_name    hierarchy       num_cgroups     enabled
cpuset  0       1       1
debug   0       1       1
ns      0       1       1

indent it in a good-looking way.

#subsys_name    hierarchy       num_cgroups     enabled
cpuset          0               1               1
debug           0               1               1
ns              0               1               1
Quoted 5 lines
Quoted 2 lines

But if there's a subsystem with name length >= 8,
it won't be aligned properly..

Yeap, but there isn't such a case at least by now.

This is not a good reason.

We'll probably have such a subsystem. Actually there's a proposed subsystem named "maxdepth" which is of length 8.

See:
http://lkml.org/lkml/2009/7/1/581

A message that is not in the archive (sent off-list or not yet received): [email protected]

#10 lore raw
CC container list
Quoted 6 lines · Gui Jianfeng

Currently, /proc/cgroups outputs is fairly ugly as following,

#subsys_name    hierarchy       num_cgroups     enabled
cpuset  0       1       1
debug   0       1       1
ns      0       1       1
Quoted 6 lines

indent it in a good-looking way.

#subsys_name    hierarchy       num_cgroups     enabled
cpuset          0               1               1
debug           0               1               1
ns              0               1               1

But if there's a subsystem with name length >= 8,
it won't be aligned properly..

Quoted 19 lines
---
 kernel/cgroup.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
kernel/cgroup.c +1 -1
index 3737a68..99fc160 100644
@@ -2963,7 +2963,7 @@ static int proc_cgroupstats_show(struct seq_file *m, void *v)
 	mutex_lock(&cgroup_mutex);
 	for (i = 0; i < CGROUP_SUBSYS_COUNT; i++) {
 		struct cgroup_subsys *ss = subsys[i];
-		seq_printf(m, "%s\t%lu\t%d\t%d\n",
+		seq_printf(m, "%s\t\t%lu\t\t%d\t\t%d\n",
 			   ss->name, ss->root->subsys_bits,
 			   ss->root->number_of_cgroups, !ss->disabled);
 	}
#11 lore raw
In reply to Gui Jianfeng
Quoted 1 line · Gui Jianfeng

Currently, /proc/cgroups outputs is fairly ugly as following,

Yes, I agree it's somewhat ugly. But it's at least very easily machine parseable, and fairly easily human parseable, which are the important points.

Paul