Hi,

Just wanted to summarize my coccinelle experiences from using it for 
a short term practical project: lock push down on a widely used
driver interface on the linux kernel. 

Overall I liked it:

- coccinelle is a powerful useful tool for doing changes to a large 
source base.

Issues I ran into:

- the documentation could be improved
- the grammar is not very easy to interpret.
- the examples in the kernel source are too complicated, it would be nice
if there were simpler ones without python and fancy features.
- the support on the list is good and helpful.

- one problem is that larger drivers often consist out of multiple
files for different pattern matches (e.g. one file has the callback
definitio and the other the actual callback). I had to manually adjust
the command lines in this case and didn't find an obvious way to automate
this.

- Since it's pretty slow on large files I found it useful to use
it from a makefile with -jN to parallelize the runs

- I ran into some problems with the version (0.2.2 from opensuse buildservice)
looping forever on some files. I ended up patching these files manually
after killing the process after a few minutes. Maybe it needs a watchdog at 
least?

- White space management is a problem. I had to do quite some manual
changes to get rid of empty lines in the wrong places. Also sometimes
there are extra spaces when replacing identifiers (but I read there were
some fixes for this after 0.2.2)

- One thing I missed was a way to express expressions without side effects.
For example when pushing down a lock I usually want to add a unlock
before the return. But sometimes returns do tail calls to other functions,
in this case the code needs to be refactored to first assign to a temporary.
I didn't find a straight forward way to detect this automatically and
ended up looking for it manually (had one case in a large change)

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

Reply via email to