lkml.org 
[lkml]   [2014]   [Apr]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] cgroup: print pretty format in /proc/cgroups
On Tue, Apr 15, 2014 at 08:47:45PM +0800, Jianyu Zhan wrote:
> I found that /proc/cgroups printed format has ugly alignment(see below).

[snip]

> diff --git a/kernel/cgroup.c b/kernel/cgroup.c
> index 9fcdaa7..d981697 100644
> --- a/kernel/cgroup.c
> +++ b/kernel/cgroup.c
> @@ -4347,7 +4347,7 @@ static int proc_cgroupstats_show(struct seq_file *m, void *v)
> mutex_lock(&cgroup_mutex);
>
> for_each_subsys(ss, i)
> - seq_printf(m, "%s\t%d\t%d\t%d\n",
> + seq_printf(m, "%-16s%-16d%-16d%-16d\n",
> ss->name, ss->root->hierarchy_id,
> atomic_read(&ss->root->nr_cgrps), !ss->disabled);

This is liable to break userspace apps which might currently parse the
file by splitting on '\t'

Regards,
Daniel
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|


\
 
 \ /
  Last update: 2014-04-15 15:21    [W:0.050 / U:39.988 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site