Re: [GIT PULL v2] bkl tracepoints + filter regex support

From: Frederic Weisbecker
Date: Sat Oct 03 2009 - 07:36:38 EST


On Sat, Sep 26, 2009 at 06:44:21AM -0400, Steven Rostedt wrote:
>
> Perhaps when we put full perl regex into the kernel (my goal ;-) then we
> should look to keep different kinds of equals.
>
> == - is direct match. Only use of strcmp is needed.
>
> ~ - is globing. We can add a '*' which means match anything.
>
> and if we do add true regex...
>
> =~ could be that. field =~ '^spin.*{lock|unlock}$'


Ok.
I'm personnally fine with it.



> Perl is considered a much better language for regex. It has one of the
> most (if not the most) powerful regex engines. I'm sure recordmcount.pl
> would be much larger if I chose to do it in python. Same goes with
> streamline_config.pl. They both have strong needs for complex regex.


Yeah, python was a joke. I mean I think it's a nice language
but not a syntax for what we want to do. It's an object oriented
language and I guess we don't want to do:

import re

r = re.compile("blah")
m = r.match("string")
m.group(1)
....

:-)


> >
> > More seriously, as I said above, I think most developers are familiar with C
> > syntax, so IMHO this is one of our best possibility.
> >
>
> To avoid the Python vs Perl, I say we stick with sed/awk. That is also a
> requirement for most unix developers.


Yeah I'm fine with it. As long as this is something already familiar
for most users.

Let's then pick ~ for glob and ~= for regex

I'll fix that soon.

Thanks.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/