[ovs-dev] [PATCH] ctags: Include new annotations to ctags ignore list.
Flavio Leitner
fbl at sysclose.org
Wed Jun 10 23:49:08 UTC 2020
Hi,
It would be nice to have this applied to branch-2.13 as well.
fbl
On Wed, Jun 10, 2020 at 04:49:45PM -0300, Flavio Leitner wrote:
> The annotation OVS_NO_THREAD_SAFETY_ANALYSIS and OVS_LOCKABLE are
> not part of the list, so ctags can't find functions using them.
>
> The annotation list comes from a regex and to include more items
> make the regex more difficult to read and maintain. Convert to a
> static list because it isn't supposed to change much and there
> is no standard names.
>
> Also add a comment to remind to keep the list up-to-date.
>
> Signed-off-by: Flavio Leitner <fbl at sysclose.org>
> ---
> Makefile.am | 2 +-
> acinclude.m4 | 6 +++---
> include/openvswitch/compiler.h | 2 ++
> 3 files changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/Makefile.am b/Makefile.am
> index b279303d1..27ef9e4b4 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -46,7 +46,7 @@ AM_CPPFLAGS += -DNDEBUG
> AM_CFLAGS += -fomit-frame-pointer
> endif
>
> -AM_CTAGSFLAGS = $(OVS_CTAGS_IDENTIFIERS_LIST)
> +AM_CTAGSFLAGS = -I "$(OVS_CTAGS_IDENTIFIERS_LIST)"
>
> if WIN32
> psep=";"
> diff --git a/acinclude.m4 b/acinclude.m4
> index 8847b8145..054ec2e3c 100644
> --- a/acinclude.m4
> +++ b/acinclude.m4
> @@ -1332,11 +1332,11 @@ AC_DEFUN([OVS_ENABLE_SPARSE],
>
> dnl OVS_CTAGS_IDENTIFIERS
> dnl
> -dnl ctags ignores symbols with extras identifiers. This builds a list of
> -dnl specially handled identifiers to be ignored.
> +dnl ctags ignores symbols with extras identifiers. This is a list of
> +dnl specially handled identifiers to be ignored. [ctags(1) -I <list>].
> AC_DEFUN([OVS_CTAGS_IDENTIFIERS],
> AC_SUBST([OVS_CTAGS_IDENTIFIERS_LIST],
> - [`printf %s '-I "'; sed -n 's/^#define \(OVS_[A-Z_]\+\)(\.\.\.)$/\1+/p' ${srcdir}/include/openvswitch/compiler.h | tr \\\n ' ' ; printf '"'`] ))
> + ["OVS_LOCKABLE OVS_NO_THREAD_SAFETY_ANALYSIS OVS_REQ_RDLOCK+ OVS_ACQ_RDLOCK+ OVS_REQ_WRLOCK+ OVS_ACQ_WRLOCK+ OVS_REQUIRES+ OVS_ACQUIRES+ OVS_TRY_WRLOCK+ OVS_TRY_RDLOCK+ OVS_TRY_LOCK+ OVS_GUARDED_BY+ OVS_EXCLUDED+ OVS_RELEASES+ OVS_ACQ_BEFORE+ OVS_ACQ_AFTER+"]))
>
> dnl OVS_PTHREAD_SET_NAME
> dnl
> diff --git a/include/openvswitch/compiler.h b/include/openvswitch/compiler.h
> index 5289a70f6..cf009f826 100644
> --- a/include/openvswitch/compiler.h
> +++ b/include/openvswitch/compiler.h
> @@ -113,6 +113,8 @@
> * OVS_REQUIRES OVS_REQ_RDLOCK OVS_REQ_WRLOCK
> * OVS_EXCLUDED OVS_EXCLUDED OVS_EXCLUDED
> */
> +
> +/* Please keep OVS_CTAGS_IDENTIFIERS up-to-date in acinclude.m4. */
> #define OVS_LOCKABLE __attribute__((lockable))
> #define OVS_REQ_RDLOCK(...) __attribute__((shared_locks_required(__VA_ARGS__)))
> #define OVS_ACQ_RDLOCK(...) __attribute__((shared_lock_function(__VA_ARGS__)))
> --
> 2.26.2
>
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
--
fbl
More information about the dev
mailing list