Hello Julia,
Julia Lawall wrote:
> On Wed, 13 Jan 2010, Michael Stefaniuc wrote:
>> Nicolas Palix wrote:
>>> On Saturday 09 January 2010 17:26:37 Michael Stefaniuc wrote:
>>>> coccinelle 0.1.11 introduced regexp support for meta-identifier/function
>>>> and constant. The release notes says it's an OCaml regexp and points to
>>>> "man Str" for details but I don
>>>>
>>>> I tried to make use of grouping and alternatives but I get errors like:
>>>> identifier SPAM ~= "\(WINE_\)?\(ERR\|FIXME\|WARN\)";
>>>> Fatal error: exception Lexer_cocci.Lexical("unrecognised symbol:\(")
>>>> identifier SPAM ~= "ERR\|FIXME\|WARN";
>>>> Fatal error: exception Lexer_cocci.Lexical("unrecognised symbol:\|")
>>>>
>>>> Is this a known limitation or just a bug?
>>> The following patch will fix this bug.
>> thanks for the fix; I have tried coccinelle 0.2.0 and it works fine.
>> Using the coccinelle/OCaml regexp seems to be way faster than just using
>> "identifier SPAM;" and filtering it later on in python. For my script on
>> a Wine C file it's the difference between finishing in 12 minutes or
>> killing the spatch process after 90+ minutes of burned CPU time (though
>> the python variant was timed with coccinelle 0.2.0-rc1).
>
> Thanks for the report. Previously we had some trouble with Python being
> very slow, due to some memory management problems. If you have the
it doesn't look like python is the culprit. If I remove the identifier
SPAM and use separate rules for the ERR/WARN/FIXME like Nicolas proposed
and I see the same effect. On small test C files all solution provide
the same result and are basically instantaneous but on bigger files
there is a huge difference in performance.
> impression that there is one particular file that is the bottleneck,
> perhaps we should look into it.
As there seems to be an interest in this I'll re-run all variants of
that script tonight with coccinelle 0.2.0 and will report the results. I
will also attach the cocci files; it might well be that I've done
something wrong in them.
thanks
bye
michael
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)