lkml.org 
[lkml]   [2011]   [Aug]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [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?


    \
     
     \ /
      Last update: 2011-08-15 15:57    [W:5.468 / U:0.024 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site