diff options
author | Luis R. Rodriguez <mcgrof@kernel.org> | 2016-06-29 15:14:54 -0700 |
---|---|---|
committer | Michal Marek <mmarek@suse.com> | 2016-07-22 12:13:39 +0200 |
commit | be1fa90066644c5a7fdf4a08767c4a359f95096f (patch) | |
tree | a87c51ce5eff2cdf0567e9352853d0a6f3f33132 /Documentation/coccinelle.txt | |
parent | c930a1b23bb7a22439cf505db130a8db60e22688 (diff) | |
download | linux-stable-be1fa90066644c5a7fdf4a08767c4a359f95096f.tar.gz linux-stable-be1fa90066644c5a7fdf4a08767c4a359f95096f.tar.bz2 linux-stable-be1fa90066644c5a7fdf4a08767c4a359f95096f.zip |
coccicheck: add support for DEBUG_FILE
Enable to capture stderr via a DEBUG_FILE variable passed to
coccicheck. You can now do:
$ rm -f cocci.err
$ export COCCI=scripts/coccinelle/free/kfree.cocci
$ make coccicheck MODE=report DEBUG_FILE=cocci.err
...
$ cat cocci.err
This will be come more useful once we add support to
use more things which would go into stderr, such as
profiling. That will be done separately in another
commit.
Expand Documentation/coccinelle.txt with details.
Signed-off-by: Luis R. Rodriguez <mcgrof@kernel.org>
Acked-by: Nicolas Palix <nicolas.palix@imag.fr>
Signed-off-by: Michal Marek <mmarek@suse.com>
Diffstat (limited to 'Documentation/coccinelle.txt')
-rw-r--r-- | Documentation/coccinelle.txt | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Documentation/coccinelle.txt b/Documentation/coccinelle.txt index 64daaf18874b..2516c5ef1691 100644 --- a/Documentation/coccinelle.txt +++ b/Documentation/coccinelle.txt @@ -157,6 +157,26 @@ semantic patch as shown in the previous section. The "report" mode is the default. You can select another one with the MODE variable explained above. + Debugging Coccinelle SmPL patches +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Using coccicheck is best as it provides in the spatch command line +include options matching the options used when we compile the kernel. +You can learn what these options are by using V=1, you could then +manually run Coccinelle with debug options added. + +Alternatively you can debug running Coccinelle against SmPL patches +by asking for stderr to be redirected to stderr, by default stderr +is redirected to /dev/null, if you'd like to capture stderr you +can specify the DEBUG_FILE="file.txt" option to coccicheck. For +instance: + + rm -f cocci.err + make coccicheck COCCI=scripts/coccinelle/free/kfree.cocci MODE=report DEBUG_FILE=cocci.err + cat cocci.err + +DEBUG_FILE support is only supported when using coccinelle >= 1.2. + Additional flags ~~~~~~~~~~~~~~~~~~ |