diff mbox series

[v5,4/4] lib/rcu: add additional debug logs

Message ID 20200422033006.1124-5-honnappa.nagarahalli@arm.com
State New
Headers show
Series Add RCU reclamation APIs | expand

Commit Message

Honnappa Nagarahalli April 22, 2020, 3:30 a.m. UTC
Added additional debug logs. These helped in debugging RCU
defer APIs.

Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>

Reviewed-by: Gavin Hu <gavin.hu@arm.com>

Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>

---
 lib/librte_rcu/rte_rcu_qsbr.h | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

-- 
2.17.1

Comments

Ananyev, Konstantin April 22, 2020, 8:25 a.m. UTC | #1
> Added additional debug logs. These helped in debugging RCU

> defer APIs.

> 

> Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>

> Reviewed-by: Gavin Hu <gavin.hu@arm.com>

> Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>

> ---

>  lib/librte_rcu/rte_rcu_qsbr.h | 9 ++++++++-

>  1 file changed, 8 insertions(+), 1 deletion(-)

> 

> diff --git a/lib/librte_rcu/rte_rcu_qsbr.h b/lib/librte_rcu/rte_rcu_qsbr.h

> index e2fc7f83e..9524915fa 100644

> --- a/lib/librte_rcu/rte_rcu_qsbr.h

> +++ b/lib/librte_rcu/rte_rcu_qsbr.h

> @@ -718,8 +718,15 @@ rte_rcu_qsbr_check(struct rte_rcu_qsbr *v, uint64_t t, bool wait)

>  	RTE_ASSERT(v != NULL);

> 

>  	/* Check if all the readers have already acknowledged this token */

> -	if (likely(t <= v->acked_token))

> +	if (likely(t <= v->acked_token)) {

> +		__RTE_RCU_DP_LOG(DEBUG,

> +			"%s: check: token = %"PRIu64", wait = %d",

> +			__func__, t, wait);

> +		__RTE_RCU_DP_LOG(DEBUG,

> +			"%s: status: least acked token = %"PRIu64"",

> +			__func__, v->acked_token);

>  		return 1;

> +	}

> 

>  	if (likely(v->num_threads == v->max_threads))

>  		return __rte_rcu_qsbr_check_all(v, t, wait);

> --


Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>


> 2.17.1
diff mbox series

Patch

diff --git a/lib/librte_rcu/rte_rcu_qsbr.h b/lib/librte_rcu/rte_rcu_qsbr.h
index e2fc7f83e..9524915fa 100644
--- a/lib/librte_rcu/rte_rcu_qsbr.h
+++ b/lib/librte_rcu/rte_rcu_qsbr.h
@@ -718,8 +718,15 @@  rte_rcu_qsbr_check(struct rte_rcu_qsbr *v, uint64_t t, bool wait)
 	RTE_ASSERT(v != NULL);
 
 	/* Check if all the readers have already acknowledged this token */
-	if (likely(t <= v->acked_token))
+	if (likely(t <= v->acked_token)) {
+		__RTE_RCU_DP_LOG(DEBUG,
+			"%s: check: token = %"PRIu64", wait = %d",
+			__func__, t, wait);
+		__RTE_RCU_DP_LOG(DEBUG,
+			"%s: status: least acked token = %"PRIu64"",
+			__func__, v->acked_token);
 		return 1;
+	}
 
 	if (likely(v->num_threads == v->max_threads))
 		return __rte_rcu_qsbr_check_all(v, t, wait);