kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
* how can I find where is the macro or function deifined
@ 2015-07-28 16:03 Ahmed Soliman
  2015-07-28 16:37 ` Manavendra Nath Manav
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Ahmed Soliman @ 2015-07-28 16:03 UTC (permalink / raw)
  To: kernelnewbies

Hi;
when I used libc I never memorized where each function is located
beyond the basics (for example I never knew if strlen is in string.h
or ctype.h or strlib.h )
I just check out the functions man pages by man strlen
is their such functionality for the kernel where I dont need to
memorize the dependencies for example if MODULE_LICENSE is in kernel.h
or module.h with out using the internel to google them .

^ permalink raw reply	[flat|nested] 7+ messages in thread

* how can I find where is the macro or function deifined
  2015-07-28 16:03 how can I find where is the macro or function deifined Ahmed Soliman
@ 2015-07-28 16:37 ` Manavendra Nath Manav
  2015-07-28 17:41 ` Navy Cheng
  2015-07-29  1:14 ` Iuro Nascimento
  2 siblings, 0 replies; 7+ messages in thread
From: Manavendra Nath Manav @ 2015-07-28 16:37 UTC (permalink / raw)
  To: kernelnewbies

On Tue 28 Jul, 2015 21:41 Ahmed Soliman <ahmedsoliman0x666@gmail.com> wrote:

Hi;
when I used libc I never memorized where each function is located
beyond the basics (for example I never knew if strlen is in string.h
or ctype.h or strlib.h )
I just check out the functions man pages by man strlen
is their such functionality for the kernel where I dont need to
memorize the dependencies for example if MODULE_LICENSE is in kernel.h
or module.h with out using the internel to google them .

______________________________________________



You can use cscope and/or ctags to jump directly to the symbol definition.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20150728/16f84c78/attachment.html 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* how can I find where is the macro or function deifined
  2015-07-28 16:03 how can I find where is the macro or function deifined Ahmed Soliman
  2015-07-28 16:37 ` Manavendra Nath Manav
@ 2015-07-28 17:41 ` Navy Cheng
  2015-07-28 23:54   ` Gnoleba GNOGBO
  2015-07-29  1:14 ` Iuro Nascimento
  2 siblings, 1 reply; 7+ messages in thread
From: Navy Cheng @ 2015-07-28 17:41 UTC (permalink / raw)
  To: kernelnewbies

On Tue, Jul 28, 2015 at 06:03:16PM +0200, Ahmed Soliman wrote:
> Hi;
> when I used libc I never memorized where each function is located
> beyond the basics (for example I never knew if strlen is in string.h
> or ctype.h or strlib.h )
> I just check out the functions man pages by man strlen
> is their such functionality for the kernel where I dont need to
> memorize the dependencies for example if MODULE_LICENSE is in kernel.h
> or module.h with out using the internel to google them .
> 
*make tags* in the root directory of the kernel tree. Then a file named TAGS
is created. TAGS is treated as one part of the tree when *git status*. You
can load it with Vim or emacs. Google it for details. 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* how can I find where is the macro or function deifined
  2015-07-28 17:41 ` Navy Cheng
@ 2015-07-28 23:54   ` Gnoleba GNOGBO
  2015-07-29  0:25     ` Valdis.Kletnieks at vt.edu
  0 siblings, 1 reply; 7+ messages in thread
From: Gnoleba GNOGBO @ 2015-07-28 23:54 UTC (permalink / raw)
  To: kernelnewbies

Can you give a procedure step by step  please to answer please ?
B. Regards

Gnogbo
 Le 28 juil. 2015 17:41, "Navy Cheng" <navych@126.com> a ?crit :

> On Tue, Jul 28, 2015 at 06:03:16PM +0200, Ahmed Soliman wrote:
> > Hi;
> > when I used libc I never memorized where each function is located
> > beyond the basics (for example I never knew if strlen is in string.h
> > or ctype.h or strlib.h )
> > I just check out the functions man pages by man strlen
> > is their such functionality for the kernel where I dont need to
> > memorize the dependencies for example if MODULE_LICENSE is in kernel.h
> > or module.h with out using the internel to google them .
> >
> *make tags* in the root directory of the kernel tree. Then a file named
> TAGS
> is created. TAGS is treated as one part of the tree when *git status*. You
> can load it with Vim or emacs. Google it for details.
>
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20150728/9157b308/attachment.html 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* how can I find where is the macro or function deifined
  2015-07-28 23:54   ` Gnoleba GNOGBO
@ 2015-07-29  0:25     ` Valdis.Kletnieks at vt.edu
  2015-07-29  2:54       ` Navy Cheng
  0 siblings, 1 reply; 7+ messages in thread
From: Valdis.Kletnieks at vt.edu @ 2015-07-29  0:25 UTC (permalink / raw)
  To: kernelnewbies

On Tue, 28 Jul 2015 23:54:36 -0000, Gnoleba GNOGBO said:
> Can you give a procedure step by step  please to answer please ?

http://www.lmgtfy.com/?q=ctags+vim+tutorial
http://www.lmgtfy.com/?q=ctags+emacs+tutorial
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 848 bytes
Desc: not available
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20150728/6da2deb3/attachment.bin 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* how can I find where is the macro or function deifined
  2015-07-28 16:03 how can I find where is the macro or function deifined Ahmed Soliman
  2015-07-28 16:37 ` Manavendra Nath Manav
  2015-07-28 17:41 ` Navy Cheng
@ 2015-07-29  1:14 ` Iuro Nascimento
  2 siblings, 0 replies; 7+ messages in thread
From: Iuro Nascimento @ 2015-07-29  1:14 UTC (permalink / raw)
  To: kernelnewbies

Hi,

git grep is very usefull to find stuff in the kernel tree. You can find macros using:

git grep -n '#define list_entry('

to find file and line number of the macro list_entry.

Regards,

Iuro Nascimento

On Tue, Jul 28, 2015 at 06:03:16PM +0200, Ahmed Soliman wrote:
> Hi;
> when I used libc I never memorized where each function is located
> beyond the basics (for example I never knew if strlen is in string.h
> or ctype.h or strlib.h )
> I just check out the functions man pages by man strlen
> is their such functionality for the kernel where I dont need to
> memorize the dependencies for example if MODULE_LICENSE is in kernel.h
> or module.h with out using the internel to google them .
> 
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 7+ messages in thread

* how can I find where is the macro or function deifined
  2015-07-29  0:25     ` Valdis.Kletnieks at vt.edu
@ 2015-07-29  2:54       ` Navy Cheng
  0 siblings, 0 replies; 7+ messages in thread
From: Navy Cheng @ 2015-07-29  2:54 UTC (permalink / raw)
  To: kernelnewbies

On Tue, Jul 28, 2015 at 08:25:04PM -0400, Valdis.Kletnieks at vt.edu wrote:
> On Tue, 28 Jul 2015 23:54:36 -0000, Gnoleba GNOGBO said:
> > Can you give a procedure step by step  please to answer please ?
> 
> http://www.lmgtfy.com/?q=ctags+vim+tutorial
> http://www.lmgtfy.com/?q=ctags+emacs+tutorial

Hi, Valdis
Thanks for your answer but I can't  open these links. 


For example, you have a kernel tree, ~/linux-4.1, in your pc. 

steps:

+ cd ~/linux-4.1
+ make tags  => Now,TAGS is created
+ Both emacs and vim can use TAGS. I don't konw if other editers can do such
  things
  + for emacs: 
    + *M-x visit-tags-table* and load TAGS
    + M-. =>find tag
    + C-u M-. =>go to the next matched tag
    + M-*  => return to last tag
  + for vim:
    + Just open vim in ~/linux-4.1
    + open the source files and put the cursor on the tags you are interested
    + ctrl + ] => goto the tag
    + ctrl + t => return to your last tag
    
tips:

Hi,gnognoleba
I think these answers is easy to find on the internet, and learning from the
internet is a important skill. Finding on net is faster for you. It's better to
google it first. If there is not answers you want, come to here and every one 
is pleasure to help you.
Hi 

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-07-29  2:54 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-28 16:03 how can I find where is the macro or function deifined Ahmed Soliman
2015-07-28 16:37 ` Manavendra Nath Manav
2015-07-28 17:41 ` Navy Cheng
2015-07-28 23:54   ` Gnoleba GNOGBO
2015-07-29  0:25     ` Valdis.Kletnieks at vt.edu
2015-07-29  2:54       ` Navy Cheng
2015-07-29  1:14 ` Iuro Nascimento

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).