Here is an example that will explain better:

enter image description here

I have a selected the audio driver from the picture and i would like to browse through its source. How do i get to the path of the source files from here?

enter image description here


You have to use grep -r CONFIG_SND_SOC_MXS_SGTL5000.

Each of these config options just represents a #define macro. Many of them don't belong to a single file but instead are checked in multiple source files. CONFIG_64BIT for example appears in around 1k source code files.

  • 1
    grep -r is generally safer to use since it doesn't follow symlinks (which can create an infinite loop). Also with a self contained directory tree like the kernel, -R would search symlinked files multiple times. – Graeme Mar 3 '14 at 10:05
  • grep -r CONFIG_SND_SOC_MXS_SGTL5000 ./ For starting from the current directory – TheMeaningfulEngineer Mar 3 '14 at 10:46
  • 1
    And if you've got many of them to search for, you could use cscope for instance to index your source tree first (there's also a nice integration of cscope in vim). – Stéphane Chazelas Mar 3 '14 at 10:54
  • 1
    It might also control whether a file is even compiled, without appearing inside it. – vonbrand Mar 3 '14 at 14:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.