[v1,13/17] rcu: replace library debug flag with global one

Message ID 20200417215739.23180-14-l.wojciechow@partner.samsung.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series introduce global debug flag |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Lukasz Wojciechowski April 17, 2020, 9:57 p.m. UTC
  Use global debug flag RTE_DEBUG instead of RTE_LIBRTE_RCU_DEBUG.
The old define is completely removed from source code and config.
Documentation was also updated.

Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
---
 config/common_base                |  1 -
 doc/guides/prog_guide/rcu_lib.rst |  8 ++++----
 lib/librte_rcu/rte_rcu_qsbr.h     | 16 ++++++++--------
 3 files changed, 12 insertions(+), 13 deletions(-)
  

Patch

diff --git a/config/common_base b/config/common_base
index 5863b4327..c22e9a6fe 100644
--- a/config/common_base
+++ b/config/common_base
@@ -915,7 +915,6 @@  CONFIG_RTE_LIBRTE_TELEMETRY=n
 # Compile librte_rcu
 #
 CONFIG_RTE_LIBRTE_RCU=y
-CONFIG_RTE_LIBRTE_RCU_DEBUG=n
 
 #
 # Compile librte_rib
diff --git a/doc/guides/prog_guide/rcu_lib.rst b/doc/guides/prog_guide/rcu_lib.rst
index 9b0bf138f..ecdea9c9c 100644
--- a/doc/guides/prog_guide/rcu_lib.rst
+++ b/doc/guides/prog_guide/rcu_lib.rst
@@ -186,7 +186,7 @@  they entered a quiescent state. This API checks if a writer has triggered a
 quiescent state query and update the state accordingly.
 
 The ``rte_rcu_qsbr_lock()`` and ``rte_rcu_qsbr_unlock()`` are empty functions.
-However, when ``CONFIG_RTE_LIBRTE_RCU_DEBUG`` is enabled, these APIs aid
-in debugging issues. One can mark the access to shared data structures on the
-reader side using these APIs. The ``rte_rcu_qsbr_quiescent()`` will check if
-all the locks are unlocked.
+However, when ``RTE_DEBUG`` is enabled, these APIs aid in debugging issues.
+One can mark the access to shared data structures on the reader side using
+these APIs. The ``rte_rcu_qsbr_quiescent()`` will check if all the locks
+are unlocked.
diff --git a/lib/librte_rcu/rte_rcu_qsbr.h b/lib/librte_rcu/rte_rcu_qsbr.h
index 0b5585925..bc8ab102c 100644
--- a/lib/librte_rcu/rte_rcu_qsbr.h
+++ b/lib/librte_rcu/rte_rcu_qsbr.h
@@ -45,7 +45,7 @@  extern int rte_rcu_log_type;
 #define __RTE_RCU_DP_LOG(level, fmt, args...)
 #endif
 
-#if defined(RTE_LIBRTE_RCU_DEBUG)
+#ifdef RTE_DEBUG
 #define __RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, level, fmt, args...) do {\
 	if (v->qsbr_cnt[thread_id].lock_cnt) \
 		rte_log(RTE_LOG_ ## level, rte_rcu_log_type, \
@@ -78,7 +78,7 @@  struct rte_rcu_qsbr_cnt {
 	 *   changes to various APIs.
 	 */
 	uint32_t lock_cnt;
-	/**< Lock counter. Used when CONFIG_RTE_LIBRTE_RCU_DEBUG is enabled */
+	/**< Lock counter. Used when RTE_DEBUG is enabled */
 } __rte_cache_aligned;
 
 #define __RTE_QSBR_CNT_THR_OFFLINE 0
@@ -323,11 +323,11 @@  rte_rcu_qsbr_thread_offline(struct rte_rcu_qsbr *v, unsigned int thread_id)
  * This API is provided to aid debugging. This should be called before
  * accessing a shared data structure.
  *
- * When CONFIG_RTE_LIBRTE_RCU_DEBUG is enabled a lock counter is incremented.
+ * When RTE_DEBUG is enabled a lock counter is incremented.
  * Similarly rte_rcu_qsbr_unlock will decrement the counter. When the
  * rte_rcu_qsbr_check API will verify that this counter is 0.
  *
- * When CONFIG_RTE_LIBRTE_RCU_DEBUG is disabled, this API will do nothing.
+ * When RTE_DEBUG is disabled, this API will do nothing.
  *
  * @param v
  *   QS variable
@@ -341,7 +341,7 @@  rte_rcu_qsbr_lock(__rte_unused struct rte_rcu_qsbr *v,
 {
 	RTE_ASSERT(v != NULL && thread_id < v->max_threads);
 
-#if defined(RTE_LIBRTE_RCU_DEBUG)
+#ifdef RTE_DEBUG
 	/* Increment the lock counter */
 	__atomic_fetch_add(&v->qsbr_cnt[thread_id].lock_cnt,
 				1, __ATOMIC_ACQUIRE);
@@ -360,11 +360,11 @@  rte_rcu_qsbr_lock(__rte_unused struct rte_rcu_qsbr *v,
  * This API is provided to aid debugging. This should be called after
  * accessing a shared data structure.
  *
- * When CONFIG_RTE_LIBRTE_RCU_DEBUG is enabled, rte_rcu_qsbr_unlock will
+ * When RTE_DEBUG is enabled, rte_rcu_qsbr_unlock will
  * decrement a lock counter. rte_rcu_qsbr_check API will verify that this
  * counter is 0.
  *
- * When CONFIG_RTE_LIBRTE_RCU_DEBUG is disabled, this API will do nothing.
+ * When RTE_DEBUG is disabled, this API will do nothing.
  *
  * @param v
  *   QS variable
@@ -378,7 +378,7 @@  rte_rcu_qsbr_unlock(__rte_unused struct rte_rcu_qsbr *v,
 {
 	RTE_ASSERT(v != NULL && thread_id < v->max_threads);
 
-#if defined(RTE_LIBRTE_RCU_DEBUG)
+#ifdef RTE_DEBUG
 	/* Decrement the lock counter */
 	__atomic_fetch_sub(&v->qsbr_cnt[thread_id].lock_cnt,
 				1, __ATOMIC_RELEASE);