Skip to content

Commit

Permalink
[docs] Explain how to use Kernel-Doc and it's converter on the kernel
Browse files Browse the repository at this point in the history
- Kernel-Doc documentation in report converter explains the usage
  of kernel-doc tool on kernel sources
- Kernel-Doc is accessible from the main readme file and supported
  code analyzer file
- Kernel-Doc updated in usage
  • Loading branch information
jay24rajput committed Oct 23, 2020
1 parent b91e32e commit 943d8a4
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/README.md
Expand Up @@ -109,6 +109,7 @@ The following tools are supported:
| | [Facebook Infer](/tools/report-converter/README.md#facebook-infer) |
| | [Coccinelle](/tools/report-converter/README.md#coccinelle) |
| | [Smatch](/tools/report-converter/README.md#smatch) |
| | [Kernel-Doc](/tools/report-converter/README.md#kernel-doc) |
| **Java** | [SpotBugs](/tools/report-converter/README.md#spotbugs) |
| | [Facebook Infer](/tools/report-converter/README.md#fbinfer) |
| **Python** | [Pylint](/tools/report-converter/README.md#pylint) |
Expand Down
1 change: 1 addition & 0 deletions docs/supported_code_analyzers.md
Expand Up @@ -17,6 +17,7 @@ CodeChecker result directory which can be stored to a CodeChecker server.
| | [Facebook Infer](/tools/report-converter/README.md#fbinfer) ||
| | [Coccinelle](/tools/report-converter/README.md#coccinelle) ||
| | [Smatch](/tools/report-converter/README.md#smatch) ||
| | [Kernel-Doc](/tools/report-converter/README.md#kernel-doc) ||
| **Java** | [FindBugs](http://findbugs.sourceforge.net/) ||
| | [SpotBugs](/tools/report-converter/README.md#spotbugs) ||
| | [Facebook Infer](/tools/report-converter/README.md#fbinfer) ||
Expand Down
29 changes: 29 additions & 0 deletions tools/report-converter/README.md
Expand Up @@ -22,6 +22,7 @@ a CodeChecker server.
* [Markdownlint](#markdownlint)
* [Coccinelle](#coccinelle)
* [Smatch](#smatch)
* [Kernel-Doc](#kernel-doc)
* [License](#license)

## Install guide
Expand Down Expand Up @@ -86,6 +87,7 @@ Supported analyzers:
eslint - ESLint, https://eslint.org/
fbinfer - Facebook Infer, https://fbinfer.com
golint - Golint, https://github.com/golang/lint
kernel-doc - Kernel-Doc, https://github.com/torvalds/linux/blob/master/scripts/kernel-doc
mdl - Markdownlint, https://github.com/markdownlint/markdownlint
msan - MemorySanitizer, https://clang.llvm.org/docs/MemorySanitizer.html
pyflakes - Pyflakes, https://github.com/PyCQA/pyflakes
Expand Down Expand Up @@ -441,6 +443,33 @@ report-converter -t smatch -o ./codechecker_smatch_reports ./smatch_warns.txt
CodeChecker store ./codechecker_smatch_reports -n smatch
```
## [Kernel-Doc](https://github.com/torvalds/linux/blob/master/scripts/kernel-doc)
[Kernel-Doc](https://github.com/torvalds/linux/blob/master/scripts/kernel-doc) structure is extracted
from the comments, and proper Sphinx C Domain function and type descriptions with anchors are generated
from them.The descriptions are filtered for special kernel-doc highlights and cross-references.
The recommended way of running Kernel-Doc is to redirect the output to a file and
give this file to the report converter tool.
The following example shows you how to run Smatch on kernel sources
and store the results found by Kernel-Doc to the CodeChecker database.
```sh
# Change Directory to your project
cd path/to/linux/kernel/repository

# Run Kernel-Doc
# Note: The output of the following command will be both of sphinx and kernel-doc,
# but the parser will parse only kernel-doc output
make htmldocs 2>&1 | tee kernel-docs.out

# Use 'report-converter' to create a CodeChecker report directory from the
# analyzer result of Coccicheck
report-converter -t kernel-doc -o ./codechecker_kernel-doc_reports ./sphinx_output.out

# Store the Kernel-Doc reports with CodeChecker.
CodeChecker store ./codechecker_kernel-doc_reports -n kernel-doc
```
## License
The project is licensed under Apache License v2.0 with LLVM Exceptions.
Expand Down

0 comments on commit 943d8a4

Please sign in to comment.