Documentation/dev-tools/coccinelle.rst

Source file repositories/reference/linux-study-clean/Documentation/dev-tools/coccinelle.rst

File Facts

System
Linux kernel
Corpus path
Documentation/dev-tools/coccinelle.rst
Extension
.rst
Size
17149 bytes
Lines
524
Domain
Support Tooling And Documentation
Bucket
Documentation
Inferred role
Support Tooling And Documentation: documentation
Status
atlas-only

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

.. Copyright 2010 Nicolas Palix <npalix@diku.dk>
.. Copyright 2010 Julia Lawall <julia@diku.dk>
.. Copyright 2010 Gilles Muller <Gilles.Muller@lip6.fr>

.. highlight:: none

.. _devtools_coccinelle:

Coccinelle
==========

Coccinelle is a tool for pattern matching and text transformation that has
many uses in kernel development, including the application of complex,
tree-wide patches and detection of problematic programming patterns.

Getting Coccinelle
------------------

The semantic patches included in the kernel use features and options
which are provided by Coccinelle version 1.0.0-rc11 and above.
Using earlier versions will fail as the option names used by
the Coccinelle files and coccicheck have been updated.

Coccinelle is available through the package manager
of many distributions, e.g. :

 - Debian
 - Fedora
 - Ubuntu
 - OpenSUSE
 - Arch Linux
 - Gentoo
 - NetBSD
 - FreeBSD

Some distribution packages are obsolete and it is recommended
to use the latest version released from the Coccinelle homepage at
https://coccinelle.gitlabpages.inria.fr/website

Or from Github at:

https://github.com/coccinelle/coccinelle

Once you have it, run the following commands::

        ./autogen
        ./configure
        make

as a regular user, and install it with::

        sudo make install

More detailed installation instructions to build from source can be
found at:

https://github.com/coccinelle/coccinelle/blob/master/install.txt

Supplemental documentation
--------------------------

For supplemental documentation refer to the wiki:

https://bottest.wiki.kernel.org/coccicheck.html

The wiki documentation always refers to the linux-next version of the script.

For Semantic Patch Language(SmPL) grammar documentation refer to:

https://coccinelle.gitlabpages.inria.fr/website/docs/main_grammar.html

Annotation

Implementation Notes