Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp386985lqt; Thu, 18 Apr 2024 20:33:38 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX1jDRYyLwjmJkNFtN/HoQo+n16FHFyoA9QiqpskHawsTgMjon24tdPK4yz+/Uji9jeZftLHB/EoYtc0BFQ2Q4UOnO0iL/0xG6CiiQbQQ== X-Google-Smtp-Source: AGHT+IGtI2/lkzMREouzzzwC0S/t3CUoGNXoVxdLWX8PLiIUt4Exb0U9Kc3+xEwya4/vtetTbfJf X-Received: by 2002:a05:6808:16a0:b0:3c7:619:7e10 with SMTP id bb32-20020a05680816a000b003c706197e10mr951180oib.27.1713497618097; Thu, 18 Apr 2024 20:33:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713497618; cv=pass; d=google.com; s=arc-20160816; b=Mj/Wbg8a2XU/RrbfewgMtn22HIbBZsA9w92h7+guY3WAULRwODN1UmfeOIjMt9l9df HkiC3I8VCGtRY0krYPhIPx4B07HE+RauolDdHl57IeIkov/aeUaxuFwozOSCGmQO33do GhWA6jJ82xBOtZIh+JZRQ96jE7JatUg4522+NHk13iM8SIJBFpN6rKu1db59JTC0VPB4 eYv6yUdoIApYBsx0/lB7kWfuY1isFpehdw3hIe5uhywsMIv/6tiktpXm9Jx5hhbENDCx hqFvGIDM4X+PlUX3ayAFzbiVtkrild90fqhBtCOI8ZSpQa2hmGThayMyzPgWFCt2UuoH cKtA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=IabUW6lAr7f1rglpjwtvePtW7LwZCd1taiTZJLcbPUE=; fh=+t2oCLCikOBjIlFuepMPH0uF1JUtcdGVkincvxiTMxA=; b=rmVp6y258LUjBcAwqxykIKfGfjJMeatEzyJ5VRUp2BuSvTcq7rqFzMLDdHmUkYeDAU u83xbOoWPm/34lYI8f8xA3fPwLNokXfBXcmfStFfoUV5Alr26v5U2p1hA+8Fwj+yy52N sPoppTX5OMTfxtflgeBfzdRPRR8lu2ZmmXRLlF2B92Opp6izIujrV5ntnM10HspPFg/k 8Vzf730HoKuzDP3F2B49YSl4uyXNB3lfmbvab7BG9LGMTtBl/yclv83grNT2DOib5EUV oFJrOp5vl1i3ACAo5k261yysV7CO2Hcxxk1/80HGDmeqzE/Y1D4YmOdKLDVIbn9zQ0x+ I/8Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-150967-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-150967-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id k188-20020a633dc5000000b005d8c0f44e73si2433190pga.262.2024.04.18.20.33.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 20:33:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-150967-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-150967-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-150967-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id B02C02811F3 for ; Fri, 19 Apr 2024 03:33:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 00CEC8F62; Fri, 19 Apr 2024 03:33:31 +0000 (UTC) Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2C3E82F29; Fri, 19 Apr 2024 03:33:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.191 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713497610; cv=none; b=EBY83si4louj9E/prGnLKAC92n+mdwM0pjcvwzQooasqWahKvkMjeElBYomtzLSCtypUkRcwnSyskJhVuZcejansHZFyiS6fHFYvv1XaVacPBEMw/8bpiPAqTLCiyp4/1S8N8Gjbsz8G4hycXODQJi+iRlIZjc6hkVVS35mThS8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713497610; c=relaxed/simple; bh=iXKYoXizLisUbRsk7HQWdagUkZG7Q/WnEvhvzK6djxg=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=GF+0kLTFSf9VoNPsdGRPy+SgKyUjzkOKVP8JvHJbnkZJVtSagnZU1BDP91eFPAbOGEIxS0xNevmkvBinHDqEKD84U4qV0Y1RY//JcD4z/pYDkaKbX/i2/U5Px00Zfisw8C5TukRuRHhOVasrWD9eMzJqM+v8Lm7oaiUZqDL3jbQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.191 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.88.214]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4VLKvt3mF6z1HBhj; Fri, 19 Apr 2024 11:32:26 +0800 (CST) Received: from dggpeml500023.china.huawei.com (unknown [7.185.36.114]) by mail.maildlp.com (Postfix) with ESMTPS id 1E19C1A016C; Fri, 19 Apr 2024 11:33:22 +0800 (CST) Received: from [10.67.110.112] (10.67.110.112) by dggpeml500023.china.huawei.com (7.185.36.114) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Fri, 19 Apr 2024 11:33:21 +0800 Message-ID: <9d01ab99-bbfd-536b-a375-9c44f988aa9a@huawei.com> Date: Fri, 19 Apr 2024 11:33:21 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 Subject: Re: [PATCH] cgroup: make cgroups info more readable Content-Language: en-US To: Huan Yang , Tejun Heo , Zefan Li , Johannes Weiner , , CC: References: <20240409021826.1171921-1-link@vivo.com> From: xiujianfeng In-Reply-To: <20240409021826.1171921-1-link@vivo.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpeml500023.china.huawei.com (7.185.36.114) 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 > --- > 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)); >