User Tools

Site Tools


coccicheck

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
coccicheck [2015/10/21 16:03]
Luis R. Rodriguez
coccicheck [2015/10/22 13:34]
Luis R. Rodriguez
Line 3: Line 3:
 ===== coccicheck ===== ===== coccicheck =====
  
-'''​coccicheck'''​ is one of the targets of the Linux kernel, this page documents how you can use it, what it provides and how to help extend it. '''​coccicheck'''​ provides a series of semantic patches written in Semantic Patch Language (SmPL) and make use of the [[http://​coccinelle.lip6.fr/​|Coccinelle engine]] to interpret and complete these tests. These tests can help you vet for correctness and avoid certain bugs which have been able to be expressed semantically.+'''​coccicheck'''​ is one of the targets of the Linux kernel, this page documents how you can use it, what it provides and how to help extend it. '''​coccicheck'''​ provides a series of semantic patches written in Semantic Patch Language (SmPL) and make use of the [[http://​coccinelle.lip6.fr/​|Coccinelle engine]] to interpret and complete these tests. These tests can help you vet for correctness and avoid certain bugs which have been able to be expressed semantically. If you're a maintainer please note you are encouraged to be using coccicheck with M=your/​maintained-code-path so you can make use of the learned SmPL patches to avoid bugs in your maintained code. How maintainers can use this is explained below.
  
 SmPL patches exist for these different types of categories, documented below. SmPL patches exist for these different types of categories, documented below.
 +
 +==== Confidence ====
 +
 +Eeach SmPL patch has a '''​confidence'''​ tag associated with it, to help highlight how confident the devlelopers of the SmPL patch are that the reports / fixes generated by the SmPL patch will be accurate or relevant. If an SmPL patch has a '''​High'''​ confidence annotated on it, it means that if you use coccicheck with it and it generates a report for a file there is a high degree of confidence that the report should be valid. Likewise if the confidence annotated is '''​Low'''​ you should take good care to review the report/​patch generated and vet for the validity of it before sending it to maintainers.
  
 ==== Modes ==== ==== Modes ====
Line 23: Line 27:
 <code bash> <code bash>
 make coccicheck MODE=report make coccicheck MODE=report
 +</​code>​
 +
 +If you are a maintainer you may want to use M=your/​maintained-path/​ to limit the scope to only the files you maintain. For instance the following will generate a report for all files in drivers/​net/​ only.
 +
 +<code bash>
 +make coccicheck MODE=report M=drivers/​net/​
 </​code>​ </​code>​
  
Line 77: Line 87:
  
 Certain tests which are known to help with consistent kernel use. Certain tests which are known to help with consistent kernel use.
 +
 +===== Who runs these tests =====
 +
 +Linux kernel maintainers are encouraged to make use of the cocciecheck to vet for issues on their tree. This can be used to help review quality of patches before they get merged into your tree as well.
 +
 +These days coccicheck is run every now and then by Julia Lawall, false possitives are reviewed (in particular cocci files where confidence is annotated as low), and then once issues are confirmed patches typically are sent to maintainers.
 +
 +Average developers can and should use coccicheck as well but care should be taken to ensure the '''​Confidence'''​ tag is reviewed and proper dilligence is done before sending any reports / fixes to kernel maintainers.
coccicheck.txt ยท Last modified: 2018/01/17 14:05 by Himanshu Jha