Commit Graph

37 Commits

Author SHA1 Message Date
Jaegeuk Kim 11b2019de2 scripts/tags.sh: catch 4.9-rc6
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2016-12-09 11:37:57 -08:00
Kirill Tkhai 987d0c8e9d scripts/tags.sh: Add magic for OFFSET and DEFINE
Add rules for definitions which is generally used in asm-offsets files.

Signed-off-by: Kirill V Tkhai <tkhai@yandex.ru>
CC: Michal Marek <mmarek@suse.cz>
CC: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2013-03-27 14:22:03 +01:00
Linus Torvalds ad60a93330 Merge branch 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild
Pull misc non-critical kbuild changes from Michal Marek:

 - Fix for make TAGS

 - Fix for make rpm

 - Some new coccinelle semantic patches

* 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
  scripts/coccinelle: find constant additions that could be bit ors
  coccicheck: Allow to show the executed command line
  coccicheck: Allow the user to give a V= (verbose) argument
  scripts/coccinelle/misc/memcpy-assign.cocci: Replace memcpy with struct assignment
  kbuild: clear KBUILD_SRC when calling 'make' in RPM spec
  scripts/coccinelle/misc/semicolon.cocci: Add unneeded semicolon test
  scripts/tags.sh: Fix regex syntax for etags
2013-02-27 12:27:18 -08:00
Kirill Tkhai 1b2643f0d0 scripts/tags.sh: add ctags magic for declarations of popular kernel type
- Add magic for declarations of variables of popular kernel type like
  spinlock_t, list_head, wait_queue_head_t and other.

- Add a set of specially handled declaration extentions like
  __attribute, __aligned and other.

- Simplify pci_bus_* magic

Signed-off-by: Kirill V Tkhai <tkhai@yandex.ru>
Cc: Michal Marek <mmarek@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-02-21 17:22:19 -08:00
Andreas Schwab 9f14b42012 scripts/tags.sh: Fix regex syntax for etags
Signed-off-by: Andreas Schwab <schwab@linux-m68k.org>
Tested-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2013-01-13 22:15:27 +01:00
Joonsoo Kim 923e02ecf3 scripts/tags.sh: Support compiled source
We usually have interst in compiled files only,
because they are strongly related to individual's work.
Current tags.sh can't select compiled files, so support it.

We can use this functionality like below.
"make cscope O=. SRCARCH=xxxx COMPILED_SOURCE=compiled"

It must be executed after building the kernel.

Signed-off-by: Joonsoo Kim <js1304@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2012-12-11 14:25:42 +01:00
Joonsoo Kim 596585090a scripts/tags.sh: Support subarch for ARM
Current tags.sh doesn't handle subarch for ARM.
There are too many subarch on ARM, it is hard that we locate some
functions which are defined in every subarch with tags util family.
Therefore support subarch for removing this unconvenience.

We can use ARM subarch functionality like below.
"make cscope O=. SRCARCH=arm SUBARCH=xxx"

Signed-off-by: Joonsoo Kim <js1304@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2012-12-11 14:24:35 +01:00
Kirill Tkhai 22beb565d4 scripts/tags.sh: Add magic for pci access functions
scripts/tags.sh: Add magic for pci access functions

Make [ce]tags find the pci_bus_read_config_* and pci_bus_write_config_*
definitions

Signed-off-by: Kirill Tkhai <tkhai@yandex.ru>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2012-08-31 17:14:19 +02:00
Namhyung Kim 1fa850596d scripts/tags.sh: Teach [ce]tags about libtraceeevent error codes
As we use a macro trick to sync each error codes with its
description string, teach [ce]tags to process them properly.

Suggested-by: Steven Rostedt <rostedt@goodmis.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Link: http://lkml.kernel.org/n/tip-qt5fv4pzigr2nnl27ydimg4h@git.kernel.org
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2012-07-26 14:31:23 +02:00
Stephen Boyd 0eb043d0ee Subject: [PATCH] tags.sh: Add missing quotes
When $remove_structs is empty a test for empty string will turn
into test -n with no arguments meaning true. Add quotes so an
empty string is tested and so that make cscope works again.

Reported-and-tested-by: Jike Song <albcamus@gmail.com>
Reported-by: Prarit Bhargava <prarit@redhat.com>
Acked-by: Yang Bai <hamo.by@gmail.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2012-04-02 11:28:17 +02:00
Yang Bai 66979224c0 scripts: refactor remove structure forward declarations
Since now it has some problems when generate TAGS,
refactor this code. Now it will not show the error
message and will remove declarations using emacs etags.

Signed-off-by: Yang Bai <hamo.by@gmail.com>
Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2012-03-26 22:22:15 +02:00
Jianbin Kang 98bd462233 kbuild: incremental tags update for GNU Global
GNU gtags support '-i' for updating tag files incrementally.
It runs more quickly than generating new tags after kernel source update.

Signed-off-by:  Jianbin Kang <kjbmail@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2012-03-26 15:29:52 +02:00
Alexey Dobriyan ff894e396b ctags: remove struct forward declarations
They're quite pointless and obscure location of real structure definition.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2011-12-18 22:36:06 +01:00
Stephen Boyd 358142dd8c scripts/tags.sh: Add Page flag function magic
It takes a while to find the macro-magically defined Page*()
functions defined in include/linux/page-flags.h if you're new to
the kernel. Add some magic to the tags script to transform these
macros into the actual functions they are, so that tag jumping in
the mm code is a bit easier.

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2011-11-14 22:19:25 +01:00
Ian Munsie 9c65426ad2 tags, powerpc: Update tags.sh to support _GLOBAL symbols
On PowerPC we use _GLOBAL throughout the assembly to define symbols, but
currently these symbols are missing from the tags generated with
ARCH=powerpc make tags. This patch modifies the tags.sh script to
recognise _GLOBAL(.*) so that these symbols will be in the tags.

This is almost (but not quite) PowerPC specific and this change should
not affect anyone else:

$ git grep -E '^_GLOBAL\(([^)]*)\).*' |sed 's/^\([^/]*\/[^/]*\)\/.*$/\1/'|uniq -c
    627 arch/powerpc
      2 arch/um

Signed-off-by: Ian Munsie <imunsie@au1.ibm.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2011-08-31 16:31:18 +02:00
Steven Rostedt 4d7a2fa876 scripts/tags.sh: Add magic for trace-events for etags too
Seems that Peter Zijlstra treats us emacs users as second class
citizens and the commit:

 commit 15664125f7
 Author: Peter Zijlstra <peterz@infradead.org>
 scripts/tags.sh: Add magic for trace-events

only updated ctags (for vim) and did not do the work to let us
lowly emacs users benefit from such a change.

Cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2011-05-25 19:56:31 -04:00
Steven Rostedt 50d6828e89 scripts/tags.sh: Fix ctags for DEFINE_EVENT()
The regex to handle DEFINE_EVENT() should not be the same as
the TRACE_EVENT() as the first parameter in DEFINE_EVENT is the
template name, not the event name. We need the second parameter
as that is what the trace_... will use.

Tested-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2011-05-25 19:56:28 -04:00
Linus Torvalds b87a2d3e31 Merge branch 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6
* 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6:
  scripts/extract-ikconfig: add xz compression support
  kbuild: add GNU GLOBAL tags generation
  setlocalversion: update mercurial tag parsing
2011-03-20 18:13:09 -07:00
Jianbin Kang f4ed1009fc kbuild: add GNU GLOBAL tags generation
GNU GLOBAL (http://www.gnu.org/software/global/) is a source code tagging system
It is really cheap to support it in kbuild system.

Signed-off-by: Jianbin Kang <kjbmail@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2011-01-15 00:48:16 +01:00
Linus Torvalds e3166331a3 Merge branch 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6
* 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6:
  Documentation/kbuild: add info that 'choice' can have a symbol name
  kbuild: add numeric --set-val option to scripts/config
  headers_check: Fix warning text
  headers_check: better search for functions in headers
  scripts/coccinelle: update for compatability with Coccinelle 0.2.4
  tags: put function prototypes back!
  Kconfig: fix single letter command in scripts/config
  gitignore: add scripts/recordmcount
2011-01-10 08:29:25 -08:00
Peter Zijlstra 15664125f7 scripts/tags.sh: Add magic for trace-events
Make tags find the trace-event definitions

Acked-by: WANG Cong <xiyou.wangcong@gmail.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <1290591835.2072.438.camel@laptop>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2010-12-02 09:39:48 -05:00
Uwe Kleine-König 0a18a9386c tags: put function prototypes back!
Commit 7db86dc (ctags: usability fix) removed function prototypes from
tags file claiming "It makes no real sense to include function
prototypes".
But it is useful for quickly determining which header file developer
needs to include to fix compilation.

Now if someone wants to remove forward declarations (which I agree are
baggage), write a postprocessing script.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-12-02 12:46:18 +01:00
Michal Marek e93bc1a0ca Revert "kbuild: specify absolute paths for cscope"
This reverts commit eb8f844c0a. Ian
Campbell writes:
> I keep my kernel source tree on a more powerful build box where I run my
> builds etc (including "make cscope") but run my editor from my
> workstation with an NFS mount to the source. This worked fine for me
> using relative paths for cscope. Using absolute paths in cscope breaks
> this previously working setup because the root path is not the same on
> both systems. I guess this is similar to moving the source tree around.
>
> Without wanting to start a flamewar it really sounds to me like we are
> working around a vim (or cscope) bug here, emacs with cscope bindings
> works fine in this configuration.

Given that absolute paths can be forced by make O=. cscope, change the
default back to relative paths.

Ian Campbell <ijc@hellion.org.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-03-08 10:26:22 +01:00
John Kacur bc75cc6b56 tags: Add the ability to make tags for all archs using "all"
make ALLSOURCE_ARCHS=all tags
- Document this in kbuild.txt
Without this change you have to type each arch separately.

Signed-off-by: John Kacur <jkacur@redhat.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-03-03 10:47:09 +01:00
John Kacur 4431d4ce99 tags: Fix spelling error in comment (is->if)
Signed-off-by: John Kacur <jkacur@redhat.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-03-03 10:45:22 +01:00
Michal Marek a8bac511c8 tags: Use $SRCARCH
$ make mrproper
$ make tags
  GEN     tags
  find: `arch/x86_64/': No such file or directory

Caused by commit f81b1be (tags: include headers before source files)

Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: WANG Cong <xiyou.wangcong@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-02-22 11:23:23 +01:00
Guennadi Liakhovetski f81b1be40c tags: include headers before source files
Currently looking up a structure definition in TAGS / tags takes one to
one of multiple "static struct X" definitions in arch sources, which makes
it for many structs practically impossible to get to the required header.
This patch changes the order of sources being tagged to first scan
architecture includes, then the top-level include/ directory, and only
then the rest. It also takes into account, that many architectures have
more than one include directory, i.e., not only arch/$ARCH/include, but
also arch/$ARCH/mach-X/include etc.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Reviewed-by: WANG Cong <xiyou.wangcong@gmail.com>
[mmarek@suse.cz: fix 'var+=text' bashism]
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-02-17 13:59:13 +01:00
Daniel Vetter eb8f844c0a kbuild: specify absolute paths for cscope
Cscope doesn't hadle relative paths when cscope.out is not in $PWD. Use
absolute paths when generating cscope.files, which seems to be the
recommended way to generate cscope.out, anyway (at least according to
cscope.sf.net). The speed and size differences are minimal, the only
drawback is that the database needs to be regenerated if the source
directory is moved.

[mmarek: fixed for O= builds, modified changelog]

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2009-12-12 13:08:16 +01:00
Stefani Seibold 7db86dc97f ctags: usability fix
The tag file generated by the tags.sh script has some issue.

First:
  The identifier-list miss the
  DEFINE_TRACE,EXPORT_TRACEPOINT_SYMBOL,EXPORT_TRACEPOINT_SYMBOL_GPL
  special handling, which can result in a wrong tag, not to jump to the
  right variable definition or function implementation.

Second:
  It makes no real sense to include function prototypes and external and
  forward variable declarations, because jumping to a tag will sometimes
  go to this and not to the real definition and implementation. The information
  about the declaration is still there at the definition and implementation
  place.

So this patch make it lot easier to navigate through the kernel source
tree using vi.

Signed-off-by: Stefani Seibold <stefani@seibold.net>
Acked-by: WANG Cong <xiyou.wangcong@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2009-09-20 12:27:43 +02:00
Matt Kraai 2e6cb8b0dc kbuild: remove a tag file before it is regenerated
If a tag file is not removed before it is regenerated, the newly
generated data is appended to the old, which preserves stale data and
makes the tag file grow over time.

Signed-off-by: Matt Kraai <kraai@ftbfs.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2009-05-01 10:54:02 +02:00
Rabin Vincent 5123b327c1 kbuild: add sys_* entries for syscalls in tags
Currently, it is no longer possible to use the tags file to jump to
system call function definitions with sys_foo, because the definitions
are obscured by use of the SYSCALL_DEFINE* macros.

This patch adds the appropriate option to ctags to make it see through
the macro.  Also, it adds the ENTRY() work already done for Exuberant
to Emacs too.

Signed-off-by: Rabin Vincent <rabin@rab.in>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2009-02-15 12:50:09 +01:00
Alexey Dobriyan 953fae66d1 kbuild: fix tags generation of config symbols
commit 4f628248a5 aka "kbuild: reintroduce
ALLSOURCE_ARCHS support for tags/cscope" breaks tags generation for
Kconfig symbols.

Steps to reproduce:

	make tags
	vi -t PROC_FS

It should jump to 'config PROC_FS' line.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Tested-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2009-02-15 12:50:09 +01:00
Jike Song 4f628248a5 kbuild: reintroduce ALLSOURCE_ARCHS support for tags/cscope
This patch reintroduce the ALLSOURCE_ARCHS support for tags/TAGS/
cscope targets. The Kbuild previously has this feature, but after
moving the targets into scripts/tags.sh, ALLSOURCE_ARCHS disappears.

It's something like this:

	$ make ALLSOURCE_ARCHS="x86 mips arm" tags cscope

Signed-off-by: Jike Song <albcamus@gmail.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2009-01-07 21:44:21 +01:00
Sam Ravnborg 521b0c774d kbuild: drop debugging leftover in tags.sh
Noticed by Jike.

Reported-by: "Jike Song" <albcamus@gmail.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2009-01-02 20:43:26 +01:00
Jiri Slaby a6ba0cb35d kbuild: fix string equality testing in tags.sh
Test of string equality in shells is =, not C-like ==.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2008-12-14 00:15:09 +01:00
Jiri Slaby 709cc372ca kbuild: fix make tags/cscope
- fix combining O=... and tags
- don't allow * expansion during sh function calls

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
[sam: use KBUILD_SRC to check if we use O=...]
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2008-12-14 00:15:09 +01:00
Sam Ravnborg a680eedc6c tags and cscope support really belongs in a shell script
as they do not benefit from the make functionality.

Moving the support to a shell script has several benefits:
- The readability of the code has increased a lot
- More people is able to extend the tags support
- We see less changes to the top-level Makefile

The shell script version includes improvements from:
Alexey Dobriyan <adobriyan@gmail.com> (jump to kconfig symbols)
Alexey Dobriyan <adobriyan@gmail.com> (drop ./ in paths)
Ian Campbell <ijc@hellion.org.uk> (simplified find algorithms)

This version has a few caveats:
=> It does not support ALLSOURCE_ARCHS
   - it is easy to add if it is really used
=> It assumes all archs have moved to arch/$ARCH/include
   - until that happens we have a few additional hits in the archs

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Tested-by: Ian Campbell <ijc@hellion.org.uk>
2008-12-03 22:24:13 +01:00