Skip to content

Add decoder for GFP masks to tools.

Cody P Schafer lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2gfp: split out defines for gfp flags into seperate headerinclude/linux/gfp-flags.h include/linux/gfp.h+144 -1430 replies
2/2tools: add gfp mask decodertools/gfp-decode/.gitignore tools/gfp-decode/Makefile tools/gfp-decode/gfp-decode.c+101 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] Add decoder for GFP masks to tools.

I needed to decode some gfp_masks to debug an oom-killer invocation, and wrote this tool to avoid doing the decoding manually.

Bad things about this: slightly hacky use of code intended for use with ftrace, splitting linux/gfp.h into 2 parts.

Good things: No additional places need modification to keep the decoder up to date, no mistakes from manual gfp_mask decoding.

 include/linux/gfp-flags.h     | 143 +++++++++++++++++++++++++++++++++++++++++
 include/linux/gfp.h           | 144 +-----------------------------------------
 tools/gfp-decode/.gitignore   |   1 +
 tools/gfp-decode/Makefile     |  11 ++++
 tools/gfp-decode/gfp-decode.c |  89 ++++++++++++++++++++++++++
 5 files changed, 245 insertions(+), 143 deletions(-)

---

On the topic of writing Makefiles for tools/*, it would be extremely convienient if a system was setup which allowed simple specification of final executable(s) and the objects to compose them rather than having each tool write a custom Makefile.

For example (potentially):

TARGETS = gfp-decode
obj-gfp-decode = gfp-decode.o
include ../scripts/Makefile.magic