[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: simple problem



On Monday 29 November 2004 13:45, Paul Akkermans wrote:
> Hi group,
>
> I am trying to find a specific function/procedure in the kernel 2.6.7
> kernel source. But the problem is that there are so many files I have to
> search through that it could take hours to find this procedure. Isn't there
> an easier way to do this with some sort of application? Can anybody help
> me?
>

This one doesn't seem to have been suggested before :-)

At the head of your linux source run

ctags -R

in the same directory run vim (you don't need to open any file)

if you think there is only one occurrence of this routine type

:tjump <routine name>

in which case vim opens the file with it in an places the cursor at the start

if you think there might be multiple occurrences type 
:tselect <routine name>

in this case vim lists each occurrence with a number beside it.  Type the 
number you want with a carriage return.

You can do this with any identifier, not just routine names.

Once inside a source file, if you see an identify you want to find, place the 
cursor on it and type ctrl-].  this will do a tjump on the identifier.  
Again, if more that one type g ctrl-] and it will do a tselect.

You can continue to do this and build up a stack of up to 20 deep jumps.  
Ctrl-t returns you one step at a time from whence you came.

-- 
Alan Chandler
alan@chandlerfamily.org.uk
First they ignore you, then they laugh at you,
 then they fight you, then you win. --Gandhi



Reply to: