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/22 13:27]
Luis R. Rodriguez
coccicheck [2015/10/22 13:46]
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. 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.+'''​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.
  
-SmPL patches exist for these different types of categories, documented below.+If you're a developer you are encouraged to vet for your patch using cocciecheck to ensure you are not introducing issues which are known semantically. If you're a maintainer 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. Automatic code bot setups which test patches for inlusion upstream are encouraged to consider using 'make coccicheck'​ as well. 
 + 
 +SmPL patches exist for a few 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 86: Line 92:
 ===== Who runs these tests ===== ===== Who runs these tests =====
  
-Anyone+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. 
 + 
 +It seems the zero day bot test infrastructure also makes use of 'make coccicheck'​ --- this section needs to be extended to document in what capacity this is done, how often, etc. 
 + 
 +===== How often are these tests run ===== 
 + 
 +The point of merging these SmPL patches upstream was to enable develoeprs and maintainers vet for code themselves. Ideally developers would run 'make coccicheck M=path/​to-their-code/'​ prior to submitting a patch upstream, and maintainers would use it regularly, perhaps after applying new patches, to avoid introducing new issues. 
 + 
 +Time permitting Julia will also run these tests on her own when possible as linux-next moves on. There is no specific regular interval in which these tests are run. The zero day bot tests infrasctructure also seems to use 'make coccicheck'​ -- but this section should be extended to document this.
coccicheck.txt · Last modified: 2018/01/17 14:05 by Himanshu Jha