On Thu, 15 Dec 2011, Josh Triplett wrote:

On Thu, Dec 15, 2011 at 07:37:01AM +0100, Julia Lawall wrote:
Sigh.  Ideally I'd love for the include options to run quickly enough to
allow their use by default in the Linux kernel's coccicheck; trying to
process C files while ignoring include files seems like a losing battle.
Otherwise, I'll have to write explicit rules for current as well as
various functions which return task_struct pointers or structures which
contain them.

It is possible to cache the parsing of files with the -use_cache
argument. You can also use the -cache_prefix dirname argument to
specify where the cached parsed files should go.  Perhaps this would
improve performance. (-cache_prefix is a recent addition - let me
know if you don't have it).

That seems like a really good idea.  Looks like I have that option.
Would it make sense to use that by default in "make coccicheck"
(regardless of whether or not coccicheck uses includes by default)?

It really takes up a lot of space... I tried using it in the context of our ASPLOS paper in which we apply a bunch of rules to all versions of Linux, and finally I got rid of it because the space cost outweighed the time benefit. I think that if you don't need header files and if you have done some preliminary indexing of the code, the caching is not worthwhile.

Note also that the caching is sensitive to the set of header files that are included. I think that it tries to take this into account, but I haven't tested it extensively.

julia
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)

Reply via email to