Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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

share|improve this question

1 Answer 1

up vote 8 down vote accepted

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.

share|improve this answer
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 at 10:05
    
@Graeme Thanks! I edited my answer. –  scai Mar 3 at 10:17
    
grep -r CONFIG_SND_SOC_MXS_SGTL5000 ./ For starting from the current directory –  Alan Mar 3 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 at 10:54
1  
It might also control whether a file is even compiled, without appearing inside it. –  vonbrand Mar 3 at 14:39

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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