[lttng-dev] Typo in urcu_qsbr.h ?

Mathieu Desnoyers mathieu.desnoyers at efficios.com
Tue Oct 8 09:26:33 EDT 2013


----- Original Message -----
> From: "Dmitri Shubin" <sbn at tbricks.com>
> To: lttng-dev at lists.lttng.org
> Sent: Tuesday, October 8, 2013 4:09:37 AM
> Subject: [lttng-dev] Typo in urcu_qsbr.h ?
> 
> Hi,
> 
> In urcu_qsbr.h I can see the following
> 
>      85  /*
>      86   * QSBR read lock/unlock are guaranteed to be no-ops.
> Therefore, we expose them
>      87   * in the LGPL header for any code to use. However, the debug
> version is not
>      88   * nops and may contain sanity checks. To activate it,
> applications must be
>      89   * recompiled with -DRCU_DEBUG (even non-LGPL/GPL
> applications). This is the
>      90   * best trade-off between license/performance/code triviality and
>      91   * library debugging & tracing features we could come up with.
>      92   */
>      93
>      94  #if (!defined(BUILD_QSBR_LIB) && defined(RCU_DEBUG))
>      95
>      96  static inline void rcu_read_lock(void)
>      97  {
>      98  }
>      99
>     100  static inline void rcu_read_unlock(void)
>     101  {
>     102  }
>     103
>     104  #else /* !RCU_DEBUG */
>     105
>     106  extern void rcu_read_lock(void);
>     107  extern void rcu_read_unlock(void);
>     108
>     109  #endif /* !RCU_DEBUG */
> 
> Shouldn't the condition in line 94 actually be
> 
>      94  #if (!defined(BUILD_QSBR_LIB) && !defined(RCU_DEBUG))
> 
> So when RCU_DEBUG is _not_ defined we get static inlines for
> rcu_read_{,un}lock() ?

Indeed! Commit pushed:

commit d47b05cb05b91bb9679d127c51bc4beac12b899d
Author: Mathieu Desnoyers <mathieu.desnoyers at efficios.com>
Date:   Tue Oct 8 09:23:10 2013 -0400

    Fix: urcu-qsbr: reversed logic on RCU_DEBUG
    
    * Dmitri Shubin <sbn at tbricks.com> wrote:
    > Shouldn't the condition in line 94 actually be
    >
    >      94  #if (!defined(BUILD_QSBR_LIB) && !defined(RCU_DEBUG))
    >
    > So when RCU_DEBUG is _not_ defined we get static inlines for
    > rcu_read_{,un}lock() ?
    
    Indeed!
    
    Reported-by: Dmitri Shubin <sbn at tbricks.com>
    Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers at efficios.com>

Thanks for reporting!

Mathieu


> 
> Thanks!
> 
> 
> _______________________________________________
> lttng-dev mailing list
> lttng-dev at lists.lttng.org
> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
> 

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com



More information about the lttng-dev mailing list