Coccinelle: A program matching and transformation tool
Channel: Linux.conf.au 2015 -- Auckland, New Zealand
Date: 16/01/2015

Himangi Saraogi
http://lca2015.linux.org.au/schedule/30195/view_talk
        Coccinelle is a program matching and transformation engine. It provides the Semantic Patch Language for specifying desired matches and transformations in C code. Coccinelle has been used in the past for finding bugs in Linux and performing collateral evolutions. Coccinelle scripts are part of the Linux source distribution and are being used by Linux developers on a regular basis.

        In the presentation, Himangi will review the impact of Coccinelle on the Linux kernel. Himangi will briefly introduce the structure of Coccinelle scripts. She will talk about managed interfaces like devm_ functions. Using example code changes, she  will explain how coccinelle helps in detecting and transforming cases for possible use of the managed interfaces in place of the unmanaged interfaces. Himangi will discuss about coccinelle patches such as ARRAY_SIZE, BUG_ON, missing iounmap(which leads to memory leaks) etc.

        She will elaborate the various uses of Coccinelle like searching for all functions that have a specific return type or probe function definitions of a driver, renaming a function, adding a function argument whose value is somehow context-dependent, and reorganizing a data structure.  Himangi will also highlight the capabilities of coccinelle and the limitations of the tool.

        The audience is anyone who are involved in Linux development. Coccinelle, though a very powerful tool is fairly new and is known to limited people in the community. Developers who look at Coccinelle patches initially find it new, feel it is very confusing and when unaware of its capabilities may decide to avoid it.

        This presentation will give an overview of how coccinelle can be a very useful tool and will give developers as well as maintainers an opportunity to consider using coccinelle after being exposed to its capabilities and limitations. The maintainers may also suggest using coccinelle or add TODOs if they find a use-case that is well suited to be solved by Coccinelle.