Re: dget()

From: Pete Wyckoff (pw@osc.edu)
Date: Sat May 19 2001 - 09:58:20 EST


tigran@veritas.com said:
> # cd /usr/src/linux
> # find -name '*.[ch]' | ctags -L- &
>
> On 15 May 2001, Xavier Bestel wrote:
> > # cd /usr/src/linux
> > # make tags
>
> No, I never use that one because it skips very useful entries like the
> ones from EXPORT_SYMBOL etc. Also, it only shows the current architecture.
> So, the tags target in the Makefile would only become useful when it is
> stripped of extra (unnecessary, imho) logic and turned into a plain one I
> suggested above.

You can use the -I feature to ignore some keywords, but not the
functions they modify. Without ignoring __initdata, for instance, you
get a couple hundred tags for it, and none for the actual variable,
e.g. cpu_vendor_names. My current ignore list for the kernel is at
http://www.osc.edu/~pw/ctags-ignore .
If you really want to see the EXPORT_SYMBOL(tag) lines, you'll want
to remove that one from the list (and be sure to do the sorting...),

Next, the wonderful editor Vim doesn't read my mind quite well enough.
When I want to see the tag for "page", for example, I really
want to look at the definition of the struct in include/linux/mm.h, not
at any of the 16 other places which declare a variable struct page *page;.
So I run the tags file through a perl script which percolates those
interesting items to the top when there are multiple entries for the
same identifier. It's here: http://www.osc.edu/~pw/sort-tags .

Finally, I modify the Makefile to generate tags with these
modifications. Here's the snippet:

tags: dummy
        ( find include/asm-$(ARCH) -name "*.h" ;\
          find include -type d \( -name "asm-*" -o -name config \) -prune \
          -o -name "*.h" -print ; find $(SUBDIRS) init -name '*.[chS]' ) |\
        ctags -I../ctags-ignore -L - -f - | sort-tags > tags

Note that this only generates tags for your current architecture,
and that your ctags must be Exuberant and version >= 5.0.

                -- Pete
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed May 23 2001 - 21:00:33 EST