From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7036BC433E0 for ; Tue, 9 Feb 2021 10:56:38 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C318364E4F for ; Tue, 9 Feb 2021 10:56:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C318364E4F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 0A89B6B0005; Tue, 9 Feb 2021 05:56:37 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 059786B006C; Tue, 9 Feb 2021 05:56:37 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E8AC26B006E; Tue, 9 Feb 2021 05:56:36 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0219.hostedemail.com [216.40.44.219]) by kanga.kvack.org (Postfix) with ESMTP id D14486B0005 for ; Tue, 9 Feb 2021 05:56:36 -0500 (EST) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 82E548248047 for ; Tue, 9 Feb 2021 10:56:36 +0000 (UTC) X-FDA: 77798425992.22.cat29_3801f4827606 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin22.hostedemail.com (Postfix) with ESMTP id 52525180F2765 for ; Tue, 9 Feb 2021 10:56:36 +0000 (UTC) X-HE-Tag: cat29_3801f4827606 X-Filterd-Recvd-Size: 4944 Received: from mail-oi1-f179.google.com (mail-oi1-f179.google.com [209.85.167.179]) by imf39.hostedemail.com (Postfix) with ESMTP for ; Tue, 9 Feb 2021 10:56:35 +0000 (UTC) Received: by mail-oi1-f179.google.com with SMTP id l3so9013121oii.2 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=GHH431s3++QTYKapff3wFZlDuNVm6M92+vvsfFd4tPeQXKHQDKsz0y2dtdGmggD3Hz 4caLt/CodNaunrL50Trnku39sNmX2CP9GLnw/wipXeeRRBqkiRq9AmLbX28IIWQsLbnn M/plGkaTxZ+s/LA6sktqd6A+62Zl9X3dg1MQj3ukTfmckD36C0suqDloJG7ZDOWq6VO4 Of49aXBq7uaplbGLK75dHdGBvY05KYFi+1wlGTEHUKYgjVsYxoOGISK9+EIO+WAp7kZ7 WVE3tt9KQIhWVVxW8Nx2u7HQziCrMa0TnsEo8fO7rfJMV/aEEvJ+5XBqucImPDnxHgnG 3qbg== X-Gm-Message-State: AOAM531kZrfWIUF8F8glGgmwnhnvIkQ02AXgbxC28hig9xz80BjQvoxD Ay/n1HNRC/PWizxv8PNgwN0= X-Google-Smtp-Source: ABdhPJw3taIy/2xTOrFM8JMh7wECFUC8D1pbcYxIM7LLaa5k9UaGnmR4I5D2PNQc5E7WNVAIR8TO7Q== 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: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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=3D33 used=3D3 fp=3D0x00000= 000d04efc88 flags=3D0x17ffffc0010200(slab|head|node=3D0|zone=3D2|lastcpup= id=3D0x1fffff) 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(-) --=20 2.17.1