[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140415125325.GH13914@redhat.com>
Date: Tue, 15 Apr 2014 13:53:25 +0100
From: "Daniel P. Berrange" <berrange@...hat.com>
To: Jianyu Zhan <nasa4836@...il.com>
Cc: tj@...nel.org, lizefan@...wei.com, cgroups@...r.kernel.org,
containers@...ts.linux-foundation.org, linux-kernel@...r.kernel.org
Subject: Re: [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 :|
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists