[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.00.1108150853170.22335@router.home>
Date: Mon, 15 Aug 2011 08:55:28 -0500 (CDT)
From: Christoph Lameter <cl@...ux.com>
To: Iliyan Malchev <malchev@...gle.com>
cc: Pekka Enberg <penberg@...nel.org>, Matt Mackall <mpm@...enic.com>,
linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] slub: extend slub_debug to handle multiple slabs
On Mon, 8 Aug 2011, Iliyan Malchev wrote:
> Extend the slub_debug syntax to "slub_debug=<flags>[,<slub>]*", where <slub>
> may contain an asterisk at the end. For example, the following would poison
> all kmalloc slabs:
>
> slub_debug=P,kmalloc*
The use of the star suggests that general regexps will be working. But
this is only allowing a star at the end. It is explained later. So maybe
that ok.
> + n = slub_debug_slabs;
> + while (*n) {
> + int cmplen;
> +
> + end = strchr(n, ',');
> + if (!end)
> + end = n + strlen(n);
> +
> + glob = strnchr(n, end - n, '*');
> + if (glob)
> + cmplen = glob - n;
> + else
> + cmplen = max(len, end - n);
> +
> + if (!strncmp(name, n, cmplen)) {
> + flags |= slub_debug;
> + break;
> + }
> +
> + n = *end ? end + 1 : end;
Ugg.. Confusing
How about
if (!*end)
break;
n = end + 1;
or make the while loop into a for loop?
--
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