Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp388879pxb; Tue, 9 Feb 2021 03:04:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJzqaV7LX8IzHtkDugm8vxGBZNQofCCdgScPNdsUGycmm0ZY/6nRNrDxIg3XIjdl9gD4lVCm X-Received: by 2002:a17:906:4bc2:: with SMTP id x2mr1895680ejv.143.1612868690289; Tue, 09 Feb 2021 03:04:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612868690; cv=none; d=google.com; s=arc-20160816; b=twcN9rE/+8Kf0UcDp3zxEluEi6z+W0l8KFc7acnjEz+p5Ouxr64NMbwOWAQxzxS7xK Hh0fmMGIkVX+/9MKlgX+tlg5ddfsYbuWRJWhWbcfWU3q5BxWEQcLq/fnyFiF3QY3a+F4 cbhjHcmMMxcx6Q8coW/gWgEy2dpbctR9qndJ/403nfjYAA44BjWaOfzMW1C19CdWnmoD iDBtd7yGy3RsACTp1rMh1Wu6tT3+/O5qnPKBQgDpVfXrmcEJTnmOQqR2TJbVXcwOoeMy 4+iaSmKA6O1uK24Fx13RrvC+ZYSxLS0b04l4m0Epix0yHVk5yMJTSpTDXzX15UDQ6S0R dTOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=vkhNliH3YgOPkCyynn/prx2ea2eFAhGQKtJVcxGFNyM=; b=h3JQm4qXJckea2DqO6euoTuEKszNacYU92CLkyxcJbOsHHABi+gd+nAjCGp0c3h/Uj QQUsDcEZ0xOxn9H9Dv1zvhFLJV0wjo+dp1S3J9l/+hpCLX19PnVDBGGPB82rgWqTR81M G53BW854Ol9XqY40Y8cMxpobf9H4Q9pOa+ZcLZwzlXS2TfmBQQw06RNJr/cfnQDQkZyA 7QIYz0ONJFnBoxS0+ZAH9IuBi4imZ0yblIcZB0wzkY8J7VBCfAprRHsdYYYDFFUla85y i1SCZ/rmengYMX5cvpE7z7a0MxKUuqNzWAmy19098HpPDS/hlPSVYiuGGiKU+0PV3i2r qoKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CXVTXGhT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t18si13145688ejc.249.2021.02.09.03.04.25; Tue, 09 Feb 2021 03:04:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CXVTXGhT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232222AbhBILBO (ORCPT + 99 others); Tue, 9 Feb 2021 06:01:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232050AbhBIK5Q (ORCPT ); Tue, 9 Feb 2021 05:57:16 -0500 Received: from mail-oi1-x22e.google.com (mail-oi1-x22e.google.com [IPv6:2607:f8b0:4864:20::22e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D90FBC061786 for ; Tue, 9 Feb 2021 02:56:35 -0800 (PST) Received: by mail-oi1-x22e.google.com with SMTP id v193so13502808oie.8 for ; Tue, 09 Feb 2021 02:56:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=vkhNliH3YgOPkCyynn/prx2ea2eFAhGQKtJVcxGFNyM=; b=CXVTXGhT1jpdGSdaOF6wbIPMBso7LA4dIX+i1WnR/+slTJmAcyQNwSJXPmixmMwMVY 1X7eSuWcqhnYKhPkC5bNFpzaM/lR2ROVHs08glmlEknll7gQZo+1FduWUYOOOfGiODNG sF4k2TysZS27Bk6G2WzY5b9Hwd6k18wmuVxhO/bSwYQ7Y8uPe5AqcIhLvHbNhUCqo6zo Mv6wDlGQlMSosNWC6a0fyYdtpdphWAhMy/cl26CEuiBmaXhZ5pKtluamgCWr05NkrFLj nkOYbqVMN9b/ClEqUghgX37CDQ9AIYL2UDI5AS6xPafD/+32t2FmQHJt4c66Z+MdxiWS 5gRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=vkhNliH3YgOPkCyynn/prx2ea2eFAhGQKtJVcxGFNyM=; b=aR6OJtcak9y/HDA4GFmbLBc/eIRxRk6u5VAag8f0KscEHCGAK+lHKdTpoQrfY0Os2d RzvUsY+CtsF7StI+0Ee535RIk0ms6xpMHs1vxv2n4XM2a4QPiDikkiRMaqw0A+r97XYv guX3GI/oy+iEx7NgGwOGvzWOvd+sVWdm9ZjMq9oQvX7CXvpqtEtkt7wS2pqCxmXD84DN bRYyZl+QuowNj583JF0C2jwpsskTllszOrvOkQIrPfqMKJZIWEpLGWShuGCpfjtF3/ms QVP5Sy4o2ENuoM8gl8hjzwDyEzpDwmQa8fkq3C8RWTe0ON3DTyI+j+3d3GqlzwgWyFWK uMfg== X-Gm-Message-State: AOAM533r/e2jOj097NDPJr57d7CPBmP3Tmsc6K5SCXVKkAVv9wKAHXD7 5jvbSwXXFwQEYgBoJquD9do= X-Received: by 2002:aca:da44:: with SMTP id r65mr2135902oig.154.1612868195347; Tue, 09 Feb 2021 02:56:35 -0800 (PST) Received: from localhost.localdomain ([50.236.19.102]) by smtp.gmail.com with ESMTPSA id g3sm4171377ooi.28.2021.02.09.02.56.26 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Feb 2021 02:56:34 -0800 (PST) From: Yafang Shao To: willy@infradead.org, andriy.shevchenko@linux.intel.com, david@redhat.com, linmiaohe@huawei.com, vbabka@suse.cz, cl@linux.com, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, akpm@linux-foundation.org, pmladek@suse.com, rostedt@goodmis.org, sergey.senozhatsky@gmail.com, joe@perches.com Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Yafang Shao Subject: [PATCH v4 0/3] mm, vsprintf: dump full information of page flags in pGp Date: Tue, 9 Feb 2021 18:56:10 +0800 Message-Id: <20210209105613.42747-1-laoar.shao@gmail.com> X-Mailer: git-send-email 2.24.3 (Apple Git-128) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The existed pGp shows the names of page flags only, rather than the full information including section, node, zone, last cpuipid and kasan tag. While it is not easy to parse these information manually because there are so many flavors. We'd better interpret them in printf. To be compitable with the existed format of pGp, the new introduced ones also use '|' as the separator, then the user tools parsing pGp won't need to make change, suggested by Matthew. The new added information is tracked onto the end of the existed one, e.g. [ 8838.835456] Slab 0x000000002828b78a objects=33 used=3 fp=0x00000000d04efc88 flags=0x17ffffc0010200(slab|head|node=0|zone=2|lastcpupid=0x1fffff) The documentation and test cases are also updated. The result of the test cases as follows, [ 501.485081] test_printf: loaded. [ 501.485768] test_printf: all 388 tests passed [ 501.488762] test_printf: unloaded. This patchset also includes some code cleanup in mm/slub.c. v4: - extend %pGp instead of introducing new format, per Matthew v3: - coding improvement, per Joe and Andy - the possible impact on debugfs and the fix of it, per Joe and Matthew - introduce new format instead of changing pGp, per Andy v2: - various coding improvement, per Joe, Miaohe, Vlastimil and Andy - remove the prefix completely in patch #2, per Vlastimil - Update the test cases, per Andy Yafang Shao (3): mm, slub: use pGp to print page flags mm, slub: don't combine pr_err with INFO vsprintf: dump full information of page flags in pGp Documentation/core-api/printk-formats.rst | 2 +- lib/test_printf.c | 60 +++++++++++++++++---- lib/vsprintf.c | 66 +++++++++++++++++++++-- mm/slub.c | 13 ++--- 4 files changed, 121 insertions(+), 20 deletions(-) -- 2.17.1