lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250116214123.917928229@goodmis.org>
Date: Thu, 16 Jan 2025 16:41:23 -0500
From: Steven Rostedt <rostedt@...dmis.org>
To: linux-kernel@...r.kernel.org,
 linux-trace-kernel@...r.kernel.org,
 linux-mm@...ck.org,
 linux-perf-users@...r.kernel.org
Cc: Masami Hiramatsu <mhiramat@...nel.org>,
 Mark Rutland <mark.rutland@....com>,
 Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
 Andrew Morton <akpm@...ux-foundation.org>,
 Michael Petlan <mpetlan@...hat.com>,
 Veronika  Molnarova <vmolnaro@...hat.com>,
 Suren Baghdasaryan <surenb@...gle.com>,
 Linus Torvalds <torvalds@...ux-foundation.org>
Subject: [PATCH v2 0/2] tracing: gfp: Fix regression of printing GFP flags in user space tracing tooling


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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ