From patchwork Thu Jan 16 21:41:23 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 13942346 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4731DC02183 for ; Thu, 16 Jan 2025 21:44:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 52FB06B008A; Thu, 16 Jan 2025 16:44:35 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 45D3A6B0089; Thu, 16 Jan 2025 16:44:35 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 32EE96B008C; Thu, 16 Jan 2025 16:44:35 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 0E9756B0088 for ; Thu, 16 Jan 2025 16:44:35 -0500 (EST) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id A166B16131E for ; Thu, 16 Jan 2025 21:44:34 +0000 (UTC) X-FDA: 83014644468.11.EADD190 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf23.hostedemail.com (Postfix) with ESMTP id 2F40C140002 for ; Thu, 16 Jan 2025 21:44:32 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf23.hostedemail.com: domain of "SRS0=fJp8=UI=goodmis.org=rostedt@kernel.org" designates 139.178.84.217 as permitted sender) smtp.mailfrom="SRS0=fJp8=UI=goodmis.org=rostedt@kernel.org" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1737063873; a=rsa-sha256; cv=none; b=nqgDGCQcPGNddCkfMgkVap4IiRkpQRZaYmPucVcrjx9gI9FvMz5CPeprw+aqzmewnHxw/z NJ9AztE5f9bGDzroMquvoaylDhtJCguicFeVYDMDy82g4Nbd4lntKLW0du/vI7faorOEpL HaBrRGcNqXBUtWhGA59DPoEy8jc8McY= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf23.hostedemail.com: domain of "SRS0=fJp8=UI=goodmis.org=rostedt@kernel.org" designates 139.178.84.217 as permitted sender) smtp.mailfrom="SRS0=fJp8=UI=goodmis.org=rostedt@kernel.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1737063873; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=MXZT7r+46aOWQMEdf5QMujOW2ChCrnmrsrE9J4NGw7I=; b=XAxZSCYAnpNUQSqiWV6SQm4udCoBABJp0akSyaR+943kxTKbwI3DJhq8njAz8yKJKkPcSB txhC3pX1UkWUirTjVtqZclQNN7VdJORmeXS0puSscOCQ0t6zUypJ12OJRLBO5VajyrfAUL OSCSKPtn1q7B4b8ky7Fpf/m9+IAbRCg= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 7F79F5C0554; Thu, 16 Jan 2025 21:43:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EB48EC4CED6; Thu, 16 Jan 2025 21:44:31 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.98) (envelope-from ) id 1tYXfK-00000000yxc-2opM; Thu, 16 Jan 2025 16:44:38 -0500 Message-ID: <20250116214123.917928229@goodmis.org> User-Agent: quilt/0.68 Date: Thu, 16 Jan 2025 16:41:23 -0500 From: Steven Rostedt To: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-mm@kvack.org, linux-perf-users@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , Michael Petlan , Veronika Molnarova , Suren Baghdasaryan , Linus Torvalds Subject: [PATCH v2 0/2] tracing: gfp: Fix regression of printing GFP flags in user space tracing tooling X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 2F40C140002 X-Stat-Signature: 67iin5wobakyq48xetuwcdmarcywbwk8 X-Rspam-User: X-HE-Tag: 1737063872-697100 X-HE-Meta: U2FsdGVkX1/QhxFexl/nntOdLaCJdTz9YALRSIso8jUApHmK5mQ5lPuLP3TUcK3iu5yUr3HyyaXcJzAEIduT3sC2zyHdu0QSkcx99w46uJirNfHibTyb3jJITk2+VYeE6eTmg1grCR0AsDLzSaqWC9yFDpZD/Efv7Q1omUrVl8OFj1/NvTIYkHEAWA5zDjE7TArlUX1DB+QMK97Sov3mdYvjx4EwDiR1Du4Jwjj2IS0gP/XOdhMDyuJF/WU0YMasQj3pDZeMXn89TFVE5NUrGIfuq0mih90hitcOLvFROjEDeY0MXY4/rolsug7wNEJ1oYP1rlGvgJySKGUBWd85qqYMi9090AG09bSAtxeb66sOMR13AvTXrW5kD/1LR6Fw1FXkXk2gv+TQEIySCZhqcGxUDJSAXHOOWX6A7y77qU+0J6M7SJQYOMQVa0tkyo26+uZ+4Yt7Sgm3QmaaK1mnOXXULYAHC0n/qkHuq/Iz2F2GaAFPgKvBkqrW0R40CSjtjP0FCkh9K8y0AMauQp56YPEmG6Ewte4idAuvWiaIDfY1q4FjdFWaEkZy75b+EaDRNRfJAAto2E5pv/g2NoIjXvbyA26w4xE/PDXHVEoZlEr51m5bOF5epBCEXp/uzubrYVD3Siomf/G2CRtA7tvVnE43Gb7PwzHaNvUDnWsC05Fb1JfI+uXBZB/WN6hB3W8hBn7poHIL7ly42yUa8aUKGEO8gqEHxVnSUBmlrBx6BOGb1tU9S48rOtjaEWbP4BhjCJsmy/dORgjH8Tmxhag5Qs85FKrJ0XIs8YGCsV9ggI37RgeO8p0/G58PDB4vOLQbUC9kVCwBZOfgJRIvq2edjJTYLantJgvA1m5S2JoyzamAdrfZLe95Ahr+Cb2M6qlRKbb6NrhNQZ8o7BuUJ5/+pPa8ilmAI+NNuGiN3YZJoS/CSOBk5Qly83G87MOF76QVXlGzEkH9S7xRwHiubKB xou1azfy uO8AnzMp7L3a185Fr9Su36UfobRdeb53UFV1YhPm8qWKVgbrEpWEvI6BIEMSKvBPuHxqjk5HLuPa+WuiJxRI9An8T3jDjqHSdwRBhS3wzQ5KgK4fDNhWC5XUce5cdIYFQtdp8FC9rpcmVn0l4e2uPNc2chpV/9QaWz5XZU8BHbLzR8DNFqRqT81wm2MElGBVSSfG/eZfN/+dsqly7N5C/WWcMSvqzPzMSfWzaFxlaKuniDX7zskuPSdmSsKdzLgd+J1fPfOwo8etrsHwF4bsHltB5bX5U/hDvSLs3 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: List-Subscribe: List-Unsubscribe: This fixes a regression that was brought up last year[1], but due to missing a response it was forgotten about. The commit 772dd0342727c ("mm: enumerate all gfp flags") introduced usage of enums in creating of the __GFP_* flags. But enums are not converted to their values like macros are in the trace event format files that are exported to user space to allow tools to properly parse the raw binary events. This broke the parsing of gfp flags. Instead of having something like: gfp_flags=GFP_HIGHUSER_MOVABLE|__GFP_COMP It would just have a raw hex value: gfp_flags=0x140cca Which is mostly useless or hard to decipher. Instead of reverting the enums into macros, use the TRACE_DEFINE_ENUM() macro that informs the tracing subsystem about enums and it converts them to their proper values. The first patch is a fix that fixes the regression and should go into the current rc release as well as be backported to stable. The second patch is a clean up that removes duplication of the GFP flags in the macros of mmflags.h and should be added in the coming merge window. I kept the two together so that one can see why the solution to the first patch was made. The use of TRACE_GFP_EM() internally was added to make it easier to reuse the TRACE_GFP_FLAGS macro. Changes since v1: https://lore.kernel.org/20250116132359.1f20cdec@gandalf.local.home - Moved the updates to only include/trace/events/mmflags.h - Removed the macro call in include/trace/events/kmem.h - Use an internal TRACE_GFP_EM() macro in TRACE_GFP_FLAGS to allow it to be expanded later for use with the __def_gfpflags_names() macro - Added the second non critical patch to show he clean up of removing duplicate defines of the ___GFP_*_BITs. [1] https://lore.kernel.org/all/87be5f7c-1a0-dad-daa0-54e342efaea7@redhat.com/ Steven Rostedt (2): tracing: gfp: Fix the GFP enum values shown for user space tracing tools tracing: gfp: Remove duplication of recording GFP flags ---- include/trace/events/mmflags.h | 104 +++++++++++++++++++++++++++++------------ 1 file changed, 73 insertions(+), 31 deletions(-)