mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: xiujianfeng <xiujianfeng@huawei.com>
To: Huan Yang <link@vivo.com>, Tejun Heo <tj@kernel.org>,
	Zefan Li <lizefan.x@bytedance.com>,
	Johannes Weiner <hannes@cmpxchg.org>, <cgroups@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Cc: <opensource.kernel@vivo.com>
Subject: Re: [PATCH] cgroup: make cgroups info more readable
Date: Fri, 19 Apr 2024 11:33:21 +0800	[thread overview]
Message-ID: <9d01ab99-bbfd-536b-a375-9c44f988aa9a@huawei.com> (raw)
In-Reply-To: <20240409021826.1171921-1-link@vivo.com>

Hi,

I found a discussion about this change in the email thread bellow, and
hope it helps you.

https://lore.kernel.org/all/YwMwlMv%2FtK3sRXbB@slm.duckdns.org/#t

On 2024/4/9 10:18, Huan Yang wrote:
> The current cgroups output format is based on tabs, which
> may cause misalignment of output information.
> 
> Using placeholder formatting can make the output information
> more readable.
> 
> Signed-off-by: Huan Yang <link@vivo.com>
> ---
>  kernel/cgroup/cgroup-v1.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/kernel/cgroup/cgroup-v1.c b/kernel/cgroup/cgroup-v1.c
> index 520a11cb12f4..c082a78f4c22 100644
> --- a/kernel/cgroup/cgroup-v1.c
> +++ b/kernel/cgroup/cgroup-v1.c
> @@ -669,15 +669,16 @@ 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_printf(m, "%16s %16s %16s %16s\n", "#subsys_name", "hierarchy",
> +		   "num_cgroups", "enabled");
>  	/*
>  	 * 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",
> -			   ss->legacy_name, ss->root->hierarchy_id,
> +		seq_printf(m, "%16s %16d %16d %16d\n", ss->legacy_name,
> +			   ss->root->hierarchy_id,
>  			   atomic_read(&ss->root->nr_cgrps),
>  			   cgroup_ssid_enabled(i));
>  

  reply	other threads:[~2024-04-19  3:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-09  2:18 Huan Yang
2024-04-19  3:33 ` xiujianfeng [this message]
2024-04-19  6:25   ` Huan Yang
2024-04-20  2:47     ` xiujianfeng
2024-04-22  1:37       ` Huan Yang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9d01ab99-bbfd-536b-a375-9c44f988aa9a@huawei.com \
    --to=xiujianfeng@huawei.com \
    --cc=cgroups@vger.kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=link@vivo.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan.x@bytedance.com \
    --cc=opensource.kernel@vivo.com \
    --cc=tj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®