2008-12-03 14:24:13 -07:00
|
|
|
#!/bin/sh
|
|
|
|
# Generate tags or cscope files
|
|
|
|
# Usage tags.sh <mode>
|
|
|
|
#
|
|
|
|
# mode may be any of: tags, TAGS, cscope
|
|
|
|
#
|
|
|
|
# Uses the following environment variables:
|
2010-02-19 08:18:41 -07:00
|
|
|
# ARCH, SUBARCH, SRCARCH, srctree, src, obj
|
2008-12-03 14:24:13 -07:00
|
|
|
|
2008-12-10 05:48:38 -07:00
|
|
|
if [ "$KBUILD_VERBOSE" = "1" ]; then
|
2008-12-03 14:24:13 -07:00
|
|
|
set -x
|
|
|
|
fi
|
|
|
|
|
2014-02-06 05:51:42 -07:00
|
|
|
# RCS_FIND_IGNORE has escaped ()s -- remove them.
|
|
|
|
ignore="$(echo "$RCS_FIND_IGNORE" | sed 's|\\||g' )"
|
|
|
|
# tags and cscope files should also ignore MODVERSION *.mod.c files
|
|
|
|
ignore="$ignore ( -name *.mod.c ) -prune -o"
|
2008-12-03 14:24:13 -07:00
|
|
|
|
2010-03-02 07:38:10 -07:00
|
|
|
# Do not use full path if we do not use O=.. builds
|
2010-03-08 02:26:22 -07:00
|
|
|
# Use make O=. {tags|cscope}
|
|
|
|
# to force full paths for a non-O= build
|
2008-12-10 05:48:38 -07:00
|
|
|
if [ "${KBUILD_SRC}" = "" ]; then
|
2008-12-03 14:24:13 -07:00
|
|
|
tree=
|
|
|
|
else
|
2008-12-10 05:10:13 -07:00
|
|
|
tree=${srctree}/
|
2008-12-03 14:24:13 -07:00
|
|
|
fi
|
|
|
|
|
2014-04-21 02:03:08 -06:00
|
|
|
# ignore userspace tools
|
|
|
|
ignore="$ignore ( -path ${tree}tools ) -prune -o"
|
|
|
|
|
2010-03-02 08:57:52 -07:00
|
|
|
# Find all available archs
|
|
|
|
find_all_archs()
|
|
|
|
{
|
|
|
|
ALLSOURCE_ARCHS=""
|
|
|
|
for arch in `ls ${tree}arch`; do
|
|
|
|
ALLSOURCE_ARCHS="${ALLSOURCE_ARCHS} "${arch##\/}
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2009-01-04 23:57:03 -07:00
|
|
|
# Detect if ALLSOURCE_ARCHS is set. If not, we assume SRCARCH
|
|
|
|
if [ "${ALLSOURCE_ARCHS}" = "" ]; then
|
|
|
|
ALLSOURCE_ARCHS=${SRCARCH}
|
2010-03-02 08:57:52 -07:00
|
|
|
elif [ "${ALLSOURCE_ARCHS}" = "all" ]; then
|
|
|
|
find_all_archs
|
2009-01-04 23:57:03 -07:00
|
|
|
fi
|
|
|
|
|
2008-12-03 14:24:13 -07:00
|
|
|
# find sources in arch/$ARCH
|
|
|
|
find_arch_sources()
|
|
|
|
{
|
2010-02-07 16:25:59 -07:00
|
|
|
for i in $archincludedir; do
|
|
|
|
prune="$prune -wholename $i -prune -o"
|
|
|
|
done
|
scripts/tags.sh: ignore symlink'ed source files
Since commit 22d651dcef536c75f75537290bf3da5038e68b6b ('selftests/powerpc:
Import Anton's memcpy / copy_tofrom_user tests'), some source files in the
tree appear as symlink.
Until commit 8c38a5328af8080bc69a25b3e4e144b03eeea95e ('scripts/tags.sh:
ignore code of user space tools'), those symlinks made cscope report some
warnings:
$ make ALLSOURCE_ARCHS=all O=./obj-cscope/ cscope
GEN cscope
cscope: cannot find
file .../tools/testing/selftests/powerpc/copyloops/copyuser_power7.S
cscope: cannot find
file .../tools/testing/selftests/powerpc/copyloops/memcpy_64.S
cscope: cannot find
file .../tools/testing/selftests/powerpc/copyloops/memcpy_power7.S
cscope: cannot find
file .../tools/testing/selftests/powerpc/copyloops/copyuser_64.S
In order to prevent the same kind of warnings to be triggered by future
addition of symlinks, the best option is to ignore all symlinks when
building the file list to be processed by cscope (and other tools
supported by scripts/tags.sh).
Ignoring symlinks won't hide source files from cscope (and others) as the
target of these symlinks already appear somewhere else in the tree, and,
as such, should be processed by cscope (or others).
Note that, cscope, when used with -R option to make it find the files to
process by itself, already skip symlinks: it's not expected that cscope
access source files through symlink.
On top of commit 8c38a5328af8080bc69a25b3e4e144b03eeea95e ('scripts/tags.sh:
ignore code of user space tools'), scripts/tags.sh output from
"make cscope tags TAGS" is the same with and without this patch: it doesn't
seems to introduce any regression (on Fedora 20).
Link: http://lkml.kernel.org/r/1396530975.4361.28.camel@localhost.localdomain
Link: http://mid.gmane.org/534312F8.5090609@t-online.de
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Anton Blanchard <anton@samba.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Hans-Bernhard Bröker <broeker@users.sourceforge.net>,
Cc: Hans-Bernhard Broeker <broeker@physik.rwth-aachen.de>,
Cc: Neil Horman <nhorman@users.sourceforge.net>
Cc: Neil Horman <nhorman@tuxdriver.com>
Cc: Gerhard Sittig <gsi@denx.de>
Cc: Konstantin Khlebnikov <koct9i@gmail.com>
Signed-off-by: Yann Droneaud <ydroneaud@opteya.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2014-05-21 07:32:17 -06:00
|
|
|
find ${tree}arch/$1 $ignore $subarchprune $prune -name "$2" \
|
|
|
|
-not -type l -print;
|
2008-12-03 14:24:13 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
# find sources in arch/$1/include
|
|
|
|
find_arch_include_sources()
|
|
|
|
{
|
2012-12-10 08:11:45 -07:00
|
|
|
include=$(find ${tree}arch/$1/ $subarchprune \
|
|
|
|
-name include -type d -print);
|
2010-02-07 16:25:59 -07:00
|
|
|
if [ -n "$include" ]; then
|
|
|
|
archincludedir="$archincludedir $include"
|
scripts/tags.sh: ignore symlink'ed source files
Since commit 22d651dcef536c75f75537290bf3da5038e68b6b ('selftests/powerpc:
Import Anton's memcpy / copy_tofrom_user tests'), some source files in the
tree appear as symlink.
Until commit 8c38a5328af8080bc69a25b3e4e144b03eeea95e ('scripts/tags.sh:
ignore code of user space tools'), those symlinks made cscope report some
warnings:
$ make ALLSOURCE_ARCHS=all O=./obj-cscope/ cscope
GEN cscope
cscope: cannot find
file .../tools/testing/selftests/powerpc/copyloops/copyuser_power7.S
cscope: cannot find
file .../tools/testing/selftests/powerpc/copyloops/memcpy_64.S
cscope: cannot find
file .../tools/testing/selftests/powerpc/copyloops/memcpy_power7.S
cscope: cannot find
file .../tools/testing/selftests/powerpc/copyloops/copyuser_64.S
In order to prevent the same kind of warnings to be triggered by future
addition of symlinks, the best option is to ignore all symlinks when
building the file list to be processed by cscope (and other tools
supported by scripts/tags.sh).
Ignoring symlinks won't hide source files from cscope (and others) as the
target of these symlinks already appear somewhere else in the tree, and,
as such, should be processed by cscope (or others).
Note that, cscope, when used with -R option to make it find the files to
process by itself, already skip symlinks: it's not expected that cscope
access source files through symlink.
On top of commit 8c38a5328af8080bc69a25b3e4e144b03eeea95e ('scripts/tags.sh:
ignore code of user space tools'), scripts/tags.sh output from
"make cscope tags TAGS" is the same with and without this patch: it doesn't
seems to introduce any regression (on Fedora 20).
Link: http://lkml.kernel.org/r/1396530975.4361.28.camel@localhost.localdomain
Link: http://mid.gmane.org/534312F8.5090609@t-online.de
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Anton Blanchard <anton@samba.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Hans-Bernhard Bröker <broeker@users.sourceforge.net>,
Cc: Hans-Bernhard Broeker <broeker@physik.rwth-aachen.de>,
Cc: Neil Horman <nhorman@users.sourceforge.net>
Cc: Neil Horman <nhorman@tuxdriver.com>
Cc: Gerhard Sittig <gsi@denx.de>
Cc: Konstantin Khlebnikov <koct9i@gmail.com>
Signed-off-by: Yann Droneaud <ydroneaud@opteya.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2014-05-21 07:32:17 -06:00
|
|
|
find $include $ignore -name "$2" -not -type l -print;
|
2010-02-07 16:25:59 -07:00
|
|
|
fi
|
2008-12-03 14:24:13 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
# find sources in include/
|
|
|
|
find_include_sources()
|
|
|
|
{
|
scripts/tags.sh: ignore symlink'ed source files
Since commit 22d651dcef536c75f75537290bf3da5038e68b6b ('selftests/powerpc:
Import Anton's memcpy / copy_tofrom_user tests'), some source files in the
tree appear as symlink.
Until commit 8c38a5328af8080bc69a25b3e4e144b03eeea95e ('scripts/tags.sh:
ignore code of user space tools'), those symlinks made cscope report some
warnings:
$ make ALLSOURCE_ARCHS=all O=./obj-cscope/ cscope
GEN cscope
cscope: cannot find
file .../tools/testing/selftests/powerpc/copyloops/copyuser_power7.S
cscope: cannot find
file .../tools/testing/selftests/powerpc/copyloops/memcpy_64.S
cscope: cannot find
file .../tools/testing/selftests/powerpc/copyloops/memcpy_power7.S
cscope: cannot find
file .../tools/testing/selftests/powerpc/copyloops/copyuser_64.S
In order to prevent the same kind of warnings to be triggered by future
addition of symlinks, the best option is to ignore all symlinks when
building the file list to be processed by cscope (and other tools
supported by scripts/tags.sh).
Ignoring symlinks won't hide source files from cscope (and others) as the
target of these symlinks already appear somewhere else in the tree, and,
as such, should be processed by cscope (or others).
Note that, cscope, when used with -R option to make it find the files to
process by itself, already skip symlinks: it's not expected that cscope
access source files through symlink.
On top of commit 8c38a5328af8080bc69a25b3e4e144b03eeea95e ('scripts/tags.sh:
ignore code of user space tools'), scripts/tags.sh output from
"make cscope tags TAGS" is the same with and without this patch: it doesn't
seems to introduce any regression (on Fedora 20).
Link: http://lkml.kernel.org/r/1396530975.4361.28.camel@localhost.localdomain
Link: http://mid.gmane.org/534312F8.5090609@t-online.de
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Anton Blanchard <anton@samba.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Hans-Bernhard Bröker <broeker@users.sourceforge.net>,
Cc: Hans-Bernhard Broeker <broeker@physik.rwth-aachen.de>,
Cc: Neil Horman <nhorman@users.sourceforge.net>
Cc: Neil Horman <nhorman@tuxdriver.com>
Cc: Gerhard Sittig <gsi@denx.de>
Cc: Konstantin Khlebnikov <koct9i@gmail.com>
Signed-off-by: Yann Droneaud <ydroneaud@opteya.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2014-05-21 07:32:17 -06:00
|
|
|
find ${tree}include $ignore -name config -prune -o -name "$1" \
|
|
|
|
-not -type l -print;
|
2008-12-03 14:24:13 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
# find sources in rest of tree
|
|
|
|
# we could benefit from a list of dirs to search in here
|
|
|
|
find_other_sources()
|
|
|
|
{
|
|
|
|
find ${tree}* $ignore \
|
|
|
|
\( -name include -o -name arch -o -name '.tmp_*' \) -prune -o \
|
scripts/tags.sh: ignore symlink'ed source files
Since commit 22d651dcef536c75f75537290bf3da5038e68b6b ('selftests/powerpc:
Import Anton's memcpy / copy_tofrom_user tests'), some source files in the
tree appear as symlink.
Until commit 8c38a5328af8080bc69a25b3e4e144b03eeea95e ('scripts/tags.sh:
ignore code of user space tools'), those symlinks made cscope report some
warnings:
$ make ALLSOURCE_ARCHS=all O=./obj-cscope/ cscope
GEN cscope
cscope: cannot find
file .../tools/testing/selftests/powerpc/copyloops/copyuser_power7.S
cscope: cannot find
file .../tools/testing/selftests/powerpc/copyloops/memcpy_64.S
cscope: cannot find
file .../tools/testing/selftests/powerpc/copyloops/memcpy_power7.S
cscope: cannot find
file .../tools/testing/selftests/powerpc/copyloops/copyuser_64.S
In order to prevent the same kind of warnings to be triggered by future
addition of symlinks, the best option is to ignore all symlinks when
building the file list to be processed by cscope (and other tools
supported by scripts/tags.sh).
Ignoring symlinks won't hide source files from cscope (and others) as the
target of these symlinks already appear somewhere else in the tree, and,
as such, should be processed by cscope (or others).
Note that, cscope, when used with -R option to make it find the files to
process by itself, already skip symlinks: it's not expected that cscope
access source files through symlink.
On top of commit 8c38a5328af8080bc69a25b3e4e144b03eeea95e ('scripts/tags.sh:
ignore code of user space tools'), scripts/tags.sh output from
"make cscope tags TAGS" is the same with and without this patch: it doesn't
seems to introduce any regression (on Fedora 20).
Link: http://lkml.kernel.org/r/1396530975.4361.28.camel@localhost.localdomain
Link: http://mid.gmane.org/534312F8.5090609@t-online.de
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Anton Blanchard <anton@samba.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Hans-Bernhard Bröker <broeker@users.sourceforge.net>,
Cc: Hans-Bernhard Broeker <broeker@physik.rwth-aachen.de>,
Cc: Neil Horman <nhorman@users.sourceforge.net>
Cc: Neil Horman <nhorman@tuxdriver.com>
Cc: Gerhard Sittig <gsi@denx.de>
Cc: Konstantin Khlebnikov <koct9i@gmail.com>
Signed-off-by: Yann Droneaud <ydroneaud@opteya.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2014-05-21 07:32:17 -06:00
|
|
|
-name "$1" -not -type l -print;
|
2008-12-03 14:24:13 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
find_sources()
|
|
|
|
{
|
2008-12-10 05:10:13 -07:00
|
|
|
find_arch_sources $1 "$2"
|
2008-12-03 14:24:13 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
all_sources()
|
|
|
|
{
|
2010-02-19 08:18:41 -07:00
|
|
|
find_arch_include_sources ${SRCARCH} '*.[chS]'
|
2008-12-03 14:24:13 -07:00
|
|
|
if [ ! -z "$archinclude" ]; then
|
2008-12-10 05:10:13 -07:00
|
|
|
find_arch_include_sources $archinclude '*.[chS]'
|
2008-12-03 14:24:13 -07:00
|
|
|
fi
|
2009-01-04 23:57:03 -07:00
|
|
|
find_include_sources '*.[chS]'
|
2010-02-07 16:25:59 -07:00
|
|
|
for arch in $ALLSOURCE_ARCHS
|
|
|
|
do
|
|
|
|
find_sources $arch '*.[chS]'
|
|
|
|
done
|
2009-01-04 23:57:03 -07:00
|
|
|
find_other_sources '*.[chS]'
|
2008-12-03 14:24:13 -07:00
|
|
|
}
|
|
|
|
|
2012-12-10 08:11:46 -07:00
|
|
|
all_compiled_sources()
|
|
|
|
{
|
|
|
|
for i in $(all_sources); do
|
|
|
|
case "$i" in
|
|
|
|
*.[cS])
|
|
|
|
j=${i/\.[cS]/\.o}
|
|
|
|
if [ -e $j ]; then
|
|
|
|
echo $i
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo $i
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
all_target_sources()
|
|
|
|
{
|
|
|
|
if [ -n "$COMPILED_SOURCE" ]; then
|
|
|
|
all_compiled_sources
|
|
|
|
else
|
|
|
|
all_sources
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2008-12-03 14:24:13 -07:00
|
|
|
all_kconfigs()
|
|
|
|
{
|
2009-02-11 14:24:09 -07:00
|
|
|
for arch in $ALLSOURCE_ARCHS; do
|
|
|
|
find_sources $arch 'Kconfig*'
|
|
|
|
done
|
|
|
|
find_other_sources 'Kconfig*'
|
2008-12-03 14:24:13 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
all_defconfigs()
|
|
|
|
{
|
2009-01-04 23:57:03 -07:00
|
|
|
find_sources $ALLSOURCE_ARCHS "defconfig"
|
2008-12-03 14:24:13 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
docscope()
|
|
|
|
{
|
2012-12-10 08:11:46 -07:00
|
|
|
(echo \-k; echo \-q; all_target_sources) > cscope.files
|
2008-12-03 14:24:13 -07:00
|
|
|
cscope -b -f cscope.out
|
|
|
|
}
|
|
|
|
|
2011-01-14 05:07:05 -07:00
|
|
|
dogtags()
|
|
|
|
{
|
2012-12-10 08:11:46 -07:00
|
|
|
all_target_sources | gtags -i -f -
|
2011-01-14 05:07:05 -07:00
|
|
|
}
|
|
|
|
|
2008-12-03 14:24:13 -07:00
|
|
|
exuberant()
|
|
|
|
{
|
2012-12-10 08:11:46 -07:00
|
|
|
all_target_sources | xargs $1 -a \
|
2013-11-06 18:09:51 -07:00
|
|
|
-I __initdata,__exitdata,__initconst, \
|
2015-04-27 15:37:53 -06:00
|
|
|
-I __initdata_memblock \
|
2013-10-23 07:08:44 -06:00
|
|
|
-I __refdata,__attribute,__maybe_unused,__always_unused \
|
2013-02-21 17:42:42 -07:00
|
|
|
-I __acquires,__releases,__deprecated \
|
|
|
|
-I __read_mostly,__aligned,____cacheline_aligned \
|
2008-12-03 14:24:13 -07:00
|
|
|
-I ____cacheline_aligned_in_smp \
|
2013-10-23 07:08:44 -06:00
|
|
|
-I __cacheline_aligned,__cacheline_aligned_in_smp \
|
2008-12-03 14:24:13 -07:00
|
|
|
-I ____cacheline_internodealigned_in_smp \
|
2013-02-21 17:42:42 -07:00
|
|
|
-I __used,__packed,__packed2__,__must_check,__must_hold \
|
2013-10-23 07:08:44 -06:00
|
|
|
-I EXPORT_SYMBOL,EXPORT_SYMBOL_GPL,ACPI_EXPORT_SYMBOL \
|
2009-09-18 13:49:24 -06:00
|
|
|
-I DEFINE_TRACE,EXPORT_TRACEPOINT_SYMBOL,EXPORT_TRACEPOINT_SYMBOL_GPL \
|
2013-02-21 17:42:42 -07:00
|
|
|
-I static,const \
|
2010-11-04 03:24:16 -06:00
|
|
|
--extra=+f --c-kinds=+px \
|
2011-08-29 19:47:58 -06:00
|
|
|
--regex-asm='/^(ENTRY|_GLOBAL)\(([^)]*)\).*/\2/' \
|
2010-11-24 02:43:55 -07:00
|
|
|
--regex-c='/^SYSCALL_DEFINE[[:digit:]]?\(([^,)]*).*/sys_\1/' \
|
2014-08-08 15:23:33 -06:00
|
|
|
--regex-c='/^COMPAT_SYSCALL_DEFINE[[:digit:]]?\(([^,)]*).*/compat_sys_\1/' \
|
2010-11-24 02:43:55 -07:00
|
|
|
--regex-c++='/^TRACE_EVENT\(([^,)]*).*/trace_\1/' \
|
2015-06-16 19:00:37 -06:00
|
|
|
--regex-c++='/^TRACE_EVENT\(([^,)]*).*/trace_\1_rcuidle/' \
|
2011-11-03 11:09:57 -06:00
|
|
|
--regex-c++='/^DEFINE_EVENT\([^,)]*, *([^,)]*).*/trace_\1/' \
|
2015-06-16 19:00:37 -06:00
|
|
|
--regex-c++='/^DEFINE_EVENT\([^,)]*, *([^,)]*).*/trace_\1_rcuidle/' \
|
2011-11-03 11:09:57 -06:00
|
|
|
--regex-c++='/PAGEFLAG\(([^,)]*).*/Page\1/' \
|
|
|
|
--regex-c++='/PAGEFLAG\(([^,)]*).*/SetPage\1/' \
|
|
|
|
--regex-c++='/PAGEFLAG\(([^,)]*).*/ClearPage\1/' \
|
|
|
|
--regex-c++='/TESTSETFLAG\(([^,)]*).*/TestSetPage\1/' \
|
|
|
|
--regex-c++='/TESTPAGEFLAG\(([^,)]*).*/Page\1/' \
|
|
|
|
--regex-c++='/SETPAGEFLAG\(([^,)]*).*/SetPage\1/' \
|
|
|
|
--regex-c++='/__SETPAGEFLAG\(([^,)]*).*/__SetPage\1/' \
|
|
|
|
--regex-c++='/TESTCLEARFLAG\(([^,)]*).*/TestClearPage\1/' \
|
|
|
|
--regex-c++='/__TESTCLEARFLAG\(([^,)]*).*/TestClearPage\1/' \
|
|
|
|
--regex-c++='/CLEARPAGEFLAG\(([^,)]*).*/ClearPage\1/' \
|
|
|
|
--regex-c++='/__CLEARPAGEFLAG\(([^,)]*).*/__ClearPage\1/' \
|
|
|
|
--regex-c++='/__PAGEFLAG\(([^,)]*).*/__SetPage\1/' \
|
|
|
|
--regex-c++='/__PAGEFLAG\(([^,)]*).*/__ClearPage\1/' \
|
|
|
|
--regex-c++='/PAGEFLAG_FALSE\(([^,)]*).*/Page\1/' \
|
|
|
|
--regex-c++='/TESTSCFLAG\(([^,)]*).*/TestSetPage\1/' \
|
|
|
|
--regex-c++='/TESTSCFLAG\(([^,)]*).*/TestClearPage\1/' \
|
|
|
|
--regex-c++='/SETPAGEFLAG_NOOP\(([^,)]*).*/SetPage\1/' \
|
|
|
|
--regex-c++='/CLEARPAGEFLAG_NOOP\(([^,)]*).*/ClearPage\1/' \
|
|
|
|
--regex-c++='/__CLEARPAGEFLAG_NOOP\(([^,)]*).*/__ClearPage\1/' \
|
|
|
|
--regex-c++='/TESTCLEARFLAG_FALSE\(([^,)]*).*/TestClearPage\1/' \
|
2012-06-17 20:50:51 -06:00
|
|
|
--regex-c++='/__TESTCLEARFLAG_FALSE\(([^,)]*).*/__TestClearPage\1/' \
|
2012-08-24 03:50:28 -06:00
|
|
|
--regex-c++='/_PE\(([^,)]*).*/PEVENT_ERRNO__\1/' \
|
2014-09-24 19:40:40 -06:00
|
|
|
--regex-c++='/TASK_PFA_TEST\([^,]*,\s*([^)]*)\)/task_\1/' \
|
|
|
|
--regex-c++='/TASK_PFA_SET\([^,]*,\s*([^)]*)\)/task_set_\1/' \
|
|
|
|
--regex-c++='/TASK_PFA_CLEAR\([^,]*,\s*([^)]*)\)/task_clear_\1/'\
|
2015-09-21 21:08:15 -06:00
|
|
|
--regex-c++='/DEF_MMIO_(IN|OUT)_(X|D)\(([^,]*),\s*[^)]*\)/\3/' \
|
|
|
|
--regex-c++='/DEBUGGER_BOILERPLATE\(([^,]*)\)/\1/' \
|
2013-02-21 17:42:42 -07:00
|
|
|
--regex-c='/PCI_OP_READ\((\w*).*[1-4]\)/pci_bus_read_config_\1/' \
|
|
|
|
--regex-c='/PCI_OP_WRITE\((\w*).*[1-4]\)/pci_bus_write_config_\1/' \
|
|
|
|
--regex-c='/DEFINE_(MUTEX|SEMAPHORE|SPINLOCK)\((\w*)/\2/v/' \
|
|
|
|
--regex-c='/DEFINE_(RAW_SPINLOCK|RWLOCK|SEQLOCK)\((\w*)/\2/v/' \
|
|
|
|
--regex-c='/DECLARE_(RWSEM|COMPLETION)\((\w*)/\2/v/' \
|
|
|
|
--regex-c='/DECLARE_BITMAP\((\w*)/\1/v/' \
|
|
|
|
--regex-c='/(^|\s)(|L|H)LIST_HEAD\((\w*)/\3/v/' \
|
|
|
|
--regex-c='/(^|\s)RADIX_TREE\((\w*)/\2/v/' \
|
|
|
|
--regex-c='/DEFINE_PER_CPU\(([^,]*,\s*)(\w*).*\)/\2/v/' \
|
|
|
|
--regex-c='/DEFINE_PER_CPU_SHARED_ALIGNED\(([^,]*,\s*)(\w*).*\)/\2/v/' \
|
|
|
|
--regex-c='/DECLARE_WAIT_QUEUE_HEAD\((\w*)/\1/v/' \
|
|
|
|
--regex-c='/DECLARE_(TASKLET|WORK|DELAYED_WORK)\((\w*)/\2/v/' \
|
2013-03-23 04:58:20 -06:00
|
|
|
--regex-c='/DEFINE_PCI_DEVICE_TABLE\((\w*)/\1/v/' \
|
|
|
|
--regex-c='/(^\s)OFFSET\((\w*)/\2/v/' \
|
2014-04-16 09:13:34 -06:00
|
|
|
--regex-c='/(^\s)DEFINE\((\w*)/\2/v/' \
|
|
|
|
--regex-c='/DEFINE_HASHTABLE\((\w*)/\1/v/'
|
2008-12-03 14:24:13 -07:00
|
|
|
|
|
|
|
all_kconfigs | xargs $1 -a \
|
|
|
|
--langdef=kconfig --language-force=kconfig \
|
|
|
|
--regex-kconfig='/^[[:blank:]]*(menu|)config[[:blank:]]+([[:alnum:]_]+)/\2/'
|
|
|
|
|
|
|
|
all_kconfigs | xargs $1 -a \
|
|
|
|
--langdef=kconfig --language-force=kconfig \
|
|
|
|
--regex-kconfig='/^[[:blank:]]*(menu|)config[[:blank:]]+([[:alnum:]_]+)/CONFIG_\2/'
|
|
|
|
|
|
|
|
all_defconfigs | xargs -r $1 -a \
|
|
|
|
--langdef=dotconfig --language-force=dotconfig \
|
|
|
|
--regex-dotconfig='/^#?[[:blank:]]*(CONFIG_[[:alnum:]_]+)/\1/'
|
|
|
|
}
|
|
|
|
|
|
|
|
emacs()
|
|
|
|
{
|
2012-12-10 08:11:46 -07:00
|
|
|
all_target_sources | xargs $1 -a \
|
2012-12-28 16:08:22 -07:00
|
|
|
--regex='/^\(ENTRY\|_GLOBAL\)(\([^)]*\)).*/\2/' \
|
2011-05-19 12:43:57 -06:00
|
|
|
--regex='/^SYSCALL_DEFINE[0-9]?(\([^,)]*\).*/sys_\1/' \
|
2014-08-08 15:23:33 -06:00
|
|
|
--regex='/^COMPAT_SYSCALL_DEFINE[0-9]?(\([^,)]*\).*/compat_sys_\1/' \
|
2011-05-19 12:43:57 -06:00
|
|
|
--regex='/^TRACE_EVENT(\([^,)]*\).*/trace_\1/' \
|
2015-06-16 19:00:37 -06:00
|
|
|
--regex='/^TRACE_EVENT(\([^,)]*\).*/trace_\1_rcuidle/' \
|
2011-11-03 11:09:57 -06:00
|
|
|
--regex='/^DEFINE_EVENT([^,)]*, *\([^,)]*\).*/trace_\1/' \
|
2015-06-16 19:00:37 -06:00
|
|
|
--regex='/^DEFINE_EVENT([^,)]*, *\([^,)]*\).*/trace_\1_rcuidle/' \
|
2012-12-28 16:08:22 -07:00
|
|
|
--regex='/PAGEFLAG(\([^,)]*\).*/Page\1/' \
|
|
|
|
--regex='/PAGEFLAG(\([^,)]*\).*/SetPage\1/' \
|
|
|
|
--regex='/PAGEFLAG(\([^,)]*\).*/ClearPage\1/' \
|
|
|
|
--regex='/TESTSETFLAG(\([^,)]*\).*/TestSetPage\1/' \
|
|
|
|
--regex='/TESTPAGEFLAG(\([^,)]*\).*/Page\1/' \
|
|
|
|
--regex='/SETPAGEFLAG(\([^,)]*\).*/SetPage\1/' \
|
|
|
|
--regex='/__SETPAGEFLAG(\([^,)]*\).*/__SetPage\1/' \
|
|
|
|
--regex='/TESTCLEARFLAG(\([^,)]*\).*/TestClearPage\1/' \
|
|
|
|
--regex='/__TESTCLEARFLAG(\([^,)]*\).*/TestClearPage\1/' \
|
|
|
|
--regex='/CLEARPAGEFLAG(\([^,)]*\).*/ClearPage\1/' \
|
|
|
|
--regex='/__CLEARPAGEFLAG(\([^,)]*\).*/__ClearPage\1/' \
|
|
|
|
--regex='/__PAGEFLAG(\([^,)]*\).*/__SetPage\1/' \
|
|
|
|
--regex='/__PAGEFLAG(\([^,)]*\).*/__ClearPage\1/' \
|
|
|
|
--regex='/PAGEFLAG_FALSE(\([^,)]*\).*/Page\1/' \
|
|
|
|
--regex='/TESTSCFLAG(\([^,)]*\).*/TestSetPage\1/' \
|
|
|
|
--regex='/TESTSCFLAG(\([^,)]*\).*/TestClearPage\1/' \
|
|
|
|
--regex='/SETPAGEFLAG_NOOP(\([^,)]*\).*/SetPage\1/' \
|
|
|
|
--regex='/CLEARPAGEFLAG_NOOP(\([^,)]*\).*/ClearPage\1/' \
|
|
|
|
--regex='/__CLEARPAGEFLAG_NOOP(\([^,)]*\).*/__ClearPage\1/' \
|
|
|
|
--regex='/TESTCLEARFLAG_FALSE(\([^,)]*\).*/TestClearPage\1/' \
|
|
|
|
--regex='/__TESTCLEARFLAG_FALSE(\([^,)]*\).*/__TestClearPage\1/' \
|
2014-09-24 19:40:40 -06:00
|
|
|
--regex='/TASK_PFA_TEST\([^,]*,\s*([^)]*)\)/task_\1/' \
|
|
|
|
--regex='/TASK_PFA_SET\([^,]*,\s*([^)]*)\)/task_set_\1/' \
|
|
|
|
--regex='/TASK_PFA_CLEAR\([^,]*,\s*([^)]*)\)/task_clear_\1/' \
|
2012-12-28 16:08:22 -07:00
|
|
|
--regex='/_PE(\([^,)]*\).*/PEVENT_ERRNO__\1/' \
|
|
|
|
--regex='/PCI_OP_READ(\([a-z]*[a-z]\).*[1-4])/pci_bus_read_config_\1/' \
|
2014-04-16 09:13:34 -06:00
|
|
|
--regex='/PCI_OP_WRITE(\([a-z]*[a-z]\).*[1-4])/pci_bus_write_config_\1/'\
|
2014-08-15 23:56:58 -06:00
|
|
|
--regex='/[^#]*DEFINE_HASHTABLE(\([^,)]*\)/\1/'
|
2008-12-03 14:24:13 -07:00
|
|
|
|
|
|
|
all_kconfigs | xargs $1 -a \
|
|
|
|
--regex='/^[ \t]*\(\(menu\)*config\)[ \t]+\([a-zA-Z0-9_]+\)/\3/'
|
|
|
|
|
|
|
|
all_kconfigs | xargs $1 -a \
|
|
|
|
--regex='/^[ \t]*\(\(menu\)*config\)[ \t]+\([a-zA-Z0-9_]+\)/CONFIG_\3/'
|
|
|
|
|
|
|
|
all_defconfigs | xargs -r $1 -a \
|
|
|
|
--regex='/^#?[ \t]?\(CONFIG_[a-zA-Z0-9_]+\)/\1/'
|
|
|
|
}
|
|
|
|
|
|
|
|
xtags()
|
|
|
|
{
|
|
|
|
if $1 --version 2>&1 | grep -iq exuberant; then
|
|
|
|
exuberant $1
|
|
|
|
elif $1 --version 2>&1 | grep -iq emacs; then
|
|
|
|
emacs $1
|
|
|
|
else
|
2012-12-10 08:11:46 -07:00
|
|
|
all_target_sources | xargs $1 -a
|
2014-06-10 04:08:13 -06:00
|
|
|
fi
|
2008-12-03 14:24:13 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
# Support um (which uses SUBARCH)
|
2008-12-10 05:48:38 -07:00
|
|
|
if [ "${ARCH}" = "um" ]; then
|
|
|
|
if [ "$SUBARCH" = "i386" ]; then
|
2008-12-03 14:24:13 -07:00
|
|
|
archinclude=x86
|
2008-12-10 05:48:38 -07:00
|
|
|
elif [ "$SUBARCH" = "x86_64" ]; then
|
2008-12-03 14:24:13 -07:00
|
|
|
archinclude=x86
|
|
|
|
else
|
|
|
|
archinclude=${SUBARCH}
|
|
|
|
fi
|
2012-12-10 08:11:45 -07:00
|
|
|
elif [ "${SRCARCH}" = "arm" -a "${SUBARCH}" != "" ]; then
|
|
|
|
subarchdir=$(find ${tree}arch/$SRCARCH/ -name "mach-*" -type d -o \
|
|
|
|
-name "plat-*" -type d);
|
|
|
|
for i in $subarchdir; do
|
|
|
|
case "$i" in
|
|
|
|
*"mach-"${SUBARCH})
|
|
|
|
;;
|
|
|
|
*"plat-"${SUBARCH})
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
subarchprune="$subarchprune \
|
|
|
|
-wholename $i -prune -o"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
2008-12-03 14:24:13 -07:00
|
|
|
fi
|
|
|
|
|
2012-03-12 02:20:51 -06:00
|
|
|
remove_structs=
|
2008-12-03 14:24:13 -07:00
|
|
|
case "$1" in
|
|
|
|
"cscope")
|
|
|
|
docscope
|
|
|
|
;;
|
|
|
|
|
2011-01-14 05:07:05 -07:00
|
|
|
"gtags")
|
|
|
|
dogtags
|
|
|
|
;;
|
|
|
|
|
2008-12-03 14:24:13 -07:00
|
|
|
"tags")
|
2009-04-21 21:38:23 -06:00
|
|
|
rm -f tags
|
2008-12-03 14:24:13 -07:00
|
|
|
xtags ctags
|
2012-03-12 02:20:51 -06:00
|
|
|
remove_structs=y
|
2008-12-03 14:24:13 -07:00
|
|
|
;;
|
|
|
|
|
|
|
|
"TAGS")
|
2009-04-21 21:38:23 -06:00
|
|
|
rm -f TAGS
|
2008-12-03 14:24:13 -07:00
|
|
|
xtags etags
|
2012-03-12 02:20:51 -06:00
|
|
|
remove_structs=y
|
2008-12-03 14:24:13 -07:00
|
|
|
;;
|
|
|
|
esac
|
2012-03-12 02:20:51 -06:00
|
|
|
|
|
|
|
# Remove structure forward declarations.
|
2012-04-01 00:41:07 -06:00
|
|
|
if [ -n "$remove_structs" ]; then
|
2012-03-12 02:20:51 -06:00
|
|
|
LANG=C sed -i -e '/^\([a-zA-Z_][a-zA-Z0-9_]*\)\t.*\t\/\^struct \1;.*\$\/;"\tx$/d' $1
|
|
|
|
fi
|