lkml.org 
[lkml]   [2013]   [Jan]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 0/2] Add decoder for GFP masks to tools.
On Tue, Jan 08, 2013 at 03:24:13PM -0800, Cody P Schafer wrote:
> 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.
>

Any particular reason you did not use scripts/gfp-translate?

$ bash ./scripts/gfp-translate 0x1000d0
Source: /home/mel/git-public/linux-2.6
Parsing: 0x1000d0
#define ___GFP_WAIT 0x10
#define ___GFP_IO 0x40
#define ___GFP_FS 0x80
#define ___GFP_KMEMCG 0x100000

Script is dumb as rocks, requires access to the source code and does not
translate flag combinations into something like GFP_KERNEL but it's usually
sufficient. I'm not pushed either way but if you want to push your tool
then the patch should also delete scripts/gfp-translate.

--
Mel Gorman
SUSE Labs


\
 
 \ /
  Last update: 2013-01-10 13:21    [W:0.040 / U:0.284 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site