linux-trace-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] tracing: gfp: Fix regression of printing GFP flags in user space tracing tooling
@ 2025-01-16 21:41 Steven Rostedt
  2025-01-16 21:41 ` [PATCH v2 1/2] tracing: gfp: Fix the GFP enum values shown for user space tracing tools Steven Rostedt
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Steven Rostedt @ 2025-01-16 21:41 UTC (permalink / raw)
  To: linux-kernel, linux-trace-kernel, linux-mm, linux-perf-users
  Cc: Masami Hiramatsu, Mark Rutland, Mathieu Desnoyers, Andrew Morton,
	Michael Petlan, Veronika Molnarova, Suren Baghdasaryan,
	Linus Torvalds


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(-)

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-01-16 21:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-16 21:41 [PATCH v2 0/2] tracing: gfp: Fix regression of printing GFP flags in user space tracing tooling Steven Rostedt
2025-01-16 21:41 ` [PATCH v2 1/2] tracing: gfp: Fix the GFP enum values shown for user space tracing tools Steven Rostedt
2025-01-16 21:41 ` [PATCH v2 2/2] tracing: gfp: Remove duplication of recording GFP flags Steven Rostedt
2025-01-16 21:48 ` [PATCH v2 0/2] tracing: gfp: Fix regression of printing GFP flags in user space tracing tooling Steven Rostedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).