How To Read And Analyze Source Code
  • Using an editor: Most text editors support regular expressions. This is a guide for regular expressions in vim and a guide for expressions in emacs.

* Code Searching with grep: Useful when working with large systems with many directories and files.

Example 1:

grep -n -r '^test' *

will show the file and the line containing the definition for the function test.

Example 2:

grep -n -r 'test' *

will show both the definition and all uses.

Google grep examples for more.

Example 3: The Linux Kernel Load Calculation

* Tools:
o The ctags tool: Google ctags tutorial for more information about using this tool
o The cscope tool: A vim tutorial.
o sourcenav tool:Graphical interface in Redhat.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.