> -----Original Message----- > From: David Marchand <[email protected]> > Sent: Tuesday, February 7, 2023 6:45 PM > To: [email protected] > Cc: [email protected]; [email protected]; Xia, Chenbo > <[email protected]>; Hu, Jiayu <[email protected]>; Wang, YuanX > <[email protected]>; Ding, Xuan <[email protected]>; > [email protected]; Burakov, Anatoly <[email protected]>; > mattias.ronnblom <[email protected]>; David Christensen > <[email protected]>; Richardson, Bruce <[email protected]>; > Konstantin Ananyev <[email protected]> > Subject: [PATCH v6 1/9] eal: annotate spinlock, rwlock and seqlock > > clang offers some thread safety checks, statically verifying that locks > are taken and released in the code. > To use those checks, the full code leading to taking or releasing locks > must be annotated with some attributes. > > Wrap those attributes into our own set of macros. > > rwlock, seqlock and the "normal" spinlock are instrumented. > > Those checks might be of interest out of DPDK, but it requires that the > including application locks are annotated. > On the other hand, applications out there might have been using > those same checks. > To be on the safe side, keep this instrumentation under a > RTE_ANNOTATE_LOCKS internal build flag. > > A component may en/disable this check by setting > annotate_locks = true/false in its meson.build. > > Note: > Doxygen preprocessor does not understand trailing function attributes > (this can be observed with the rte_seqlock.h header). > One would think that expanding the annotation macros to a noop in > rte_lock_annotations.h would be enough (since RTE_ANNOTATE_LOCKS is not > set during doxygen processing)). Unfortunately, the use of > EXPAND_ONLY_PREDEF defeats this. > > Removing EXPAND_ONLY_PREDEF entirely is not an option as it would expand > all other DPDK macros. > > The chosen solution is to expand the annotation macros explicitly to a > noop in PREDEFINED. > > Signed-off-by: David Marchand <[email protected]> > Acked-by: Morten Brørup <[email protected]> > Reviewed-by: Maxime Coquelin <[email protected]> > --- > -- > 2.39.1
Acked-by: Chenbo Xia <[email protected]>

