From 1a003fce7e4f8460ef3256fb5d958fb5c6cc631e Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Wed, 2 Sep 2020 21:49:59 +0900 Subject: [PATCH] scripts/tags.sh: remove m, v, x tag kinds from exuberant tags Exuberant Ctags supports the following kinds of tags: $ ctags --list-kinds=c c classes d macro definitions e enumerators (values inside an enumeration) f function definitions g enumeration names l local variables [off] m class, struct, and union members n namespaces p function prototypes [off] s structure names t typedefs u union names v variable definitions x external and forward variable declarations [off] This commit excludes 'm', 'v', and 'x'. Peter Zijlstra states: "The problem with that is that, for example, the tag 'mutex' appears a mere 505 times, 492 of those are structure members. However it is _far_ more likely that someone wants the struct definition when looking for the mutex tag than any of those members." (https://lkml.org/lkml/2020/8/6/512") So, 'm' is rather annoying than useful. For the same reason, it seems better to turn off 'v'. You may argue about the criteria, but we need to draw a line somewhere to make it reasonable for the majority of people. We flipped 'p' and 'x' in the past: [1] commit f6333eb4e788 ("kbuild: Add ctags support for function prototypes and external variable declarations") added 'p' and 'x', but did not explain when they are actually useful. [2] commit 7db86dc97fb0 ("ctags: usability fix") removed 'p' and 'x', stating both of them make no real sense. [3] commit 0a18a9386c05 ("tags: put function prototypes back!") re-added 'p' and 'x', but the commit log only mentioned 'p'. OK, [3] clearly explained why 'p' is useful, but turned --c-kinds=+px into --c-kinds=-px. So, 'x' was also (accidentally?) disabled. I think it should have been --c-kinds=+p-x, or more simply --c-kinds=+p since 'x' is off by default. It seems a bug of [3], so I disabled 'x' to get back the pre-[3] behavior. 'make tags' and 'make TAGS' will run faster, create much smaller tags if Ctags is exuberant. Reviewed-by: Peter Zijlstra (Intel) Signed-off-by: Masahiro Yamada --- scripts/tags.sh | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/scripts/tags.sh b/scripts/tags.sh index 32d3f53af10b..440f4ecad43b 100755 --- a/scripts/tags.sh +++ b/scripts/tags.sh @@ -179,19 +179,6 @@ regex_c=( '/^DEF_PCI_AC_\(\|NO\)RET(\([[:alnum:]_]*\).*/\2/' '/^PCI_OP_READ(\(\w*\).*[1-4])/pci_bus_read_config_\1/' '/^PCI_OP_WRITE(\(\w*\).*[1-4])/pci_bus_write_config_\1/' - '/\