[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <op.watsgmo13l0zgt@mpn-glaptop>
Date: Thu, 08 Mar 2012 01:18:12 +0100
From: "Michal Nazarewicz" <mina86@...a86.com>
To: "Dave Jones" <davej@...hat.com>, "Joe Perches" <joe@...ches.com>
Cc: "Linux Kernel" <linux-kernel@...r.kernel.org>, linux-mm@...ck.org
Subject: Re: decode GFP flags in oom killer output.
On Thu, 08 Mar 2012 01:04:21 +0100, Joe Perches <joe@...ches.com> wrote:
> On Wed, 2012-03-07 at 18:39 -0500, Dave Jones wrote:
>> +static void decode_gfp_mask(gfp_t gfp_mask, char *out_string)
>> +{
>> + unsigned int i;
>> +
>> + for (i = 0; i < 32; i++) {
>
> < sizeof(gfp_t * 8)
>
>> + if (gfp_mask & (1 << i)) {
>
> (gfp_t)1 << i
>
>> + if (gfp_flag_texts[i])
>> + out_string += sprintf(out_string, "%s ", gfp_flag_texts[i]);
>> + else
>> + out_string += sprintf(out_string, "reserved! ");
>
> not much use to exclamation points.
>
>> + }
>> + }
>> + out_string = "\0";
>
> out_string[-1] = 0;
Will break if gfp_mask == 0.
>> +}
>> +
--
Best regards, _ _
.o. | Liege of Serenely Enlightened Majesty of o' \,=./ `o
..o | Computer Science, Michał “mina86” Nazarewicz (o o)
ooo +----<email/xmpp: mpn@...gle.com>--------------ooO--(_)--Ooo--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists