Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Documentation: Coccinelle: document debug log handling

The current debug documentation does not mention that logs are printed
to stdout unless DEBUG_FILE is set. It also doesn't mention that
Coccinelle cannot overwrite debug files.

Document this behaviour in the examples and reference it in the
debugging section.

Signed-off-by: Benjamin Philip <benjamin.philip495@gmail.com>
Signed-off-by: Julia Lawall <julia.lawall@inria.fr>

authored by

Benjamin Philip and committed by
Julia Lawall
e3a22b53 bb1c9ccf

+16 -5
+16 -5
Documentation/dev-tools/coccinelle.rst
··· 127 127 128 128 make coccicheck MODE=report V=1 129 129 130 + By default, coccicheck will print debug logs to stdout and redirect stderr to 131 + /dev/null. This can make coccicheck output difficult to read and understand. 132 + Debug and error messages can instead be written to a debug file instead by 133 + setting the ``DEBUG_FILE`` variable:: 134 + 135 + make coccicheck MODE=report DEBUG_FILE="cocci.log" 136 + 137 + Coccinelle cannot overwrite a debug file. Instead of repeatedly deleting a log 138 + file, you could include the datetime in the debug file name:: 139 + 140 + make coccicheck MODE=report DEBUG_FILE="cocci-$(date -Iseconds).log" 141 + 130 142 Coccinelle parallelization 131 143 -------------------------- 132 144 ··· 220 208 You can learn what these options are by using V=1; you could then 221 209 manually run Coccinelle with debug options added. 222 210 223 - Alternatively you can debug running Coccinelle against SmPL patches 224 - by asking for stderr to be redirected to stderr. By default stderr 225 - is redirected to /dev/null; if you'd like to capture stderr you 226 - can specify the ``DEBUG_FILE="file.txt"`` option to coccicheck. For 227 - instance:: 211 + An easier approach to debug running Coccinelle against SmPL patches is to ask 212 + coccicheck to redirect stderr to a debug file. As mentioned in the examples, by 213 + default stderr is redirected to /dev/null; if you'd like to capture stderr you 214 + can specify the ``DEBUG_FILE="file.txt"`` option to coccicheck. For instance:: 228 215 229 216 rm -f cocci.err 230 217 make coccicheck COCCI=scripts/coccinelle/free/kfree.cocci MODE=report DEBUG_FILE=cocci.err