Count lines of code that get compiled in kernel. Mainly reply on the generated object files.
- build kernel source code
- copy
cloc4kernel.py
to kernel source root directory - run script, it will generate a folder at ../cloc and copy all C/assembly/header to this folder.
python cloc4kernel.py
- go to ../cloc, run
cloc .
to count lines of code
- cloc4kernel requires kernel to be compiled
- According to the generated .o file, it will find and copy all corresponding c and assembly files to ../cloc
- It will grep all c and assembly files to find all headers and copy all headers to ../cloc