lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9d01ab99-bbfd-536b-a375-9c44f988aa9a@huawei.com>
Date: Fri, 19 Apr 2024 11:33:21 +0800
From: xiujianfeng <xiujianfeng@...wei.com>
To: Huan Yang <link@...o.com>, Tejun Heo <tj@...nel.org>, Zefan Li
	<lizefan.x@...edance.com>, Johannes Weiner <hannes@...xchg.org>,
	<cgroups@...r.kernel.org>, <linux-kernel@...r.kernel.org>
CC: <opensource.kernel@...o.com>
Subject: Re: [PATCH] cgroup: make cgroups info more readable

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@...o.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));
>  

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ