Linux Kernel Source browsing using cscope

Source code browsing in large projects is always tedious job to narrow down. In repositories like Linux Kernel, where the source code grows everyday needs regular updating and indexing to keep the search efficient and correct.

For browsing the source code in Linux Kernel, there are few options and built-in ways to remember when using ‘cscope‘ and ‘ctags‘. This blog shows those options.

Note: This blog will not explain how to use cscope and ctags for browsing.

Linux Kernel Make provides a direct way to index the source code by the following command.

make cscope tags

We can filter our search to specific architecture by specifying the ARCH option

make ARCH=arm cscope tags

Both of the above command is equivalent to the following cscope and ctags command.

cscope -bqkR ; ctags -R

Where,

-b Build the cross-reference only

-q Enable  fast  symbol  lookup  via  an  inverted index

-k For kernel mode (avoids indexing /usr/include and other system directories)

-R Recursive for all directories

Refer man page of cscope and ctags for more options.

Written by

No Comment

Please Post Your Comments & Reviews

Your email address will not be published. Required fields are marked *