lkml.org 
[lkml]   [2012]   [Mar]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: decode GFP flags in oom killer output.
Date
From
On Thu, 08 Mar 2012 01:04:21 +0100, Joe Perches <joe@perches.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@google.com>--------------ooO--(_)--Ooo--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2012-03-08 01:21    [W:0.101 / U:0.228 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site