[v1,1/3] linux-gen: odp_tm_stats_print should not depend on debug

Message ID 1507827605-6030-2-git-send-email-odpbot@yandex.ru
State New
Headers show
Series
  • make odp_tm_stats_print and fix tm example exit
Related show

Commit Message

Github ODP bot Oct. 12, 2017, 5 p.m.
From: Maxim Uvarov <maxim.uvarov@linaro.org>


odp_tm_stats_print() is odp api call it should not depend
on compilation debug options. Which is very confusing people
to not see any valid output.
https://bugs.linaro.org/show_bug.cgi?id=3024

Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>

---
/** Email created from pull request 229 (muvarov:master_bug3024)
 ** https://github.com/Linaro/odp/pull/229
 ** Patch: https://github.com/Linaro/odp/pull/229.patch
 ** Base sha: b529f843814f70068de2090e02df632113afa800
 ** Merge commit sha: b5f6031413a826cccfaa4468b62e2f3e90a12fff
 **/
 platform/linux-generic/odp_pkt_queue.c    | 22 ++++++++--------
 platform/linux-generic/odp_sorted_list.c  | 12 ++++-----
 platform/linux-generic/odp_timer_wheel.c  | 44 ++++++++++++++++---------------
 platform/linux-generic/odp_traffic_mngr.c | 42 ++++++++++++++---------------
 4 files changed, 61 insertions(+), 59 deletions(-)

Patch

diff --git a/platform/linux-generic/odp_pkt_queue.c b/platform/linux-generic/odp_pkt_queue.c
index 613e39dd0..4f6a1eb61 100644
--- a/platform/linux-generic/odp_pkt_queue.c
+++ b/platform/linux-generic/odp_pkt_queue.c
@@ -392,17 +392,17 @@  void _odp_pkt_queue_stats_print(_odp_int_queue_pool_t queue_pool)
 	queue_pool_t *pool;
 
 	pool = (queue_pool_t *)(uintptr_t)queue_pool;
-	ODP_DBG("pkt_queue_stats - queue_pool=0x%" PRIX64 "\n", queue_pool);
-	ODP_DBG("  max_queue_num=%u max_queued_pkts=%u next_queue_num=%u\n",
-		pool->max_queue_num, pool->max_queued_pkts,
-		pool->next_queue_num);
-	ODP_DBG("  total pkt appends=%" PRIu64 " total pkt removes=%" PRIu64
-		" bad removes=%" PRIu64 "\n",
-		pool->total_pkt_appends, pool->total_pkt_removes,
-		pool->total_bad_removes);
-	ODP_DBG("  free_list size=%u min size=%u peak size=%u\n",
-		pool->free_list_size, pool->min_free_list_size,
-		pool->peak_free_list_size);
+	ODP_PRINT("pkt_queue_stats - queue_pool=0x%" PRIX64 "\n", queue_pool);
+	ODP_PRINT("  max_queue_num=%u max_queued_pkts=%u next_queue_num=%u\n",
+		  pool->max_queue_num, pool->max_queued_pkts,
+		  pool->next_queue_num);
+	ODP_PRINT("  total pkt appends=%" PRIu64 " total pkt removes=%" PRIu64
+		  " bad removes=%" PRIu64 "\n",
+		  pool->total_pkt_appends, pool->total_pkt_removes,
+		  pool->total_bad_removes);
+	ODP_PRINT("  free_list size=%u min size=%u peak size=%u\n",
+		  pool->free_list_size, pool->min_free_list_size,
+		  pool->peak_free_list_size);
 }
 
 void _odp_queue_pool_destroy(_odp_int_queue_pool_t queue_pool)
diff --git a/platform/linux-generic/odp_sorted_list.c b/platform/linux-generic/odp_sorted_list.c
index df6042425..511fd090e 100644
--- a/platform/linux-generic/odp_sorted_list.c
+++ b/platform/linux-generic/odp_sorted_list.c
@@ -261,12 +261,12 @@  void _odp_sorted_list_stats_print(_odp_int_sorted_pool_t sorted_pool)
 	sorted_pool_t *pool;
 
 	pool = (sorted_pool_t *)(uintptr_t)sorted_pool;
-	ODP_DBG("sorted_pool=0x%" PRIX64 "\n", sorted_pool);
-	ODP_DBG("  max_sorted_lists=%u next_list_idx=%u\n",
-		pool->max_sorted_lists, pool->next_list_idx);
-	ODP_DBG("  total_inserts=%" PRIu64 " total_deletes=%" PRIu64
-		" total_removes=%" PRIu64 "\n", pool->total_inserts,
-		pool->total_deletes, pool->total_removes);
+	ODP_PRINT("sorted_pool=0x%" PRIX64 "\n", sorted_pool);
+	ODP_PRINT("  max_sorted_lists=%u next_list_idx=%u\n",
+		  pool->max_sorted_lists, pool->next_list_idx);
+	ODP_PRINT("  total_inserts=%" PRIu64 " total_deletes=%" PRIu64
+		  " total_removes=%" PRIu64 "\n", pool->total_inserts,
+		  pool->total_deletes, pool->total_removes);
 }
 
 void _odp_sorted_pool_destroy(_odp_int_sorted_pool_t sorted_pool)
diff --git a/platform/linux-generic/odp_timer_wheel.c b/platform/linux-generic/odp_timer_wheel.c
index 1d0640c55..b37d269bd 100644
--- a/platform/linux-generic/odp_timer_wheel.c
+++ b/platform/linux-generic/odp_timer_wheel.c
@@ -937,10 +937,10 @@  uint32_t _odp_timer_wheel_count(_odp_timer_wheel_t timer_wheel)
 static void _odp_int_timer_wheel_desc_print(wheel_desc_t *wheel_desc,
 					    uint32_t      wheel_idx)
 {
-	ODP_DBG("  wheel=%u num_slots=%u ticks_shift=%u ticks_per_slot=%u"
-		" ticks_per_rev=%" PRIu64 "\n",
-		wheel_idx, wheel_desc->num_slots, wheel_desc->ticks_shift,
-		wheel_desc->ticks_per_slot, wheel_desc->ticks_per_rev);
+	ODP_PRINT("  wheel=%u num_slots=%u ticks_shift=%u ticks_per_slot=%u"
+		  " ticks_per_rev=%" PRIu64 "\n",
+		  wheel_idx, wheel_desc->num_slots, wheel_desc->ticks_shift,
+		  wheel_desc->ticks_per_slot, wheel_desc->ticks_per_rev);
 }
 
 void _odp_timer_wheel_stats_print(_odp_timer_wheel_t timer_wheel)
@@ -952,28 +952,30 @@  void _odp_timer_wheel_stats_print(_odp_timer_wheel_t timer_wheel)
 	timer_wheels = (timer_wheels_t *)(uintptr_t)timer_wheel;
 	expired_ring = timer_wheels->expired_timers_ring;
 
-	ODP_DBG("_odp_int_timer_wheel_stats current_ticks=%" PRIu64 "\n",
-		timer_wheels->current_ticks);
+	ODP_PRINT("_odp_int_timer_wheel_stats current_ticks=%" PRIu64 "\n",
+		  timer_wheels->current_ticks);
 	for (wheel_idx = 0; wheel_idx < 4; wheel_idx++)
 		_odp_int_timer_wheel_desc_print(
 			&timer_wheels->wheel_descs[wheel_idx],
 			wheel_idx);
 
-	ODP_DBG("  total timer_inserts=%" PRIu64 " timer_removes=%" PRIu64
-		" insert_fails=%" PRIu64 "\n",
-		timer_wheels->total_timer_inserts,
-		timer_wheels->total_timer_removes,
-		timer_wheels->insert_fail_cnt);
-	ODP_DBG("  total_promote_cnt=%" PRIu64 " promote_fail_cnt=%"
-		PRIu64 "\n", timer_wheels->total_promote_cnt,
-		timer_wheels->promote_fail_cnt);
-	ODP_DBG("  free_list_size=%u min_size=%u peak_size=%u\n",
-		timer_wheels->free_list_size, timer_wheels->min_free_list_size,
-		timer_wheels->peak_free_list_size);
-	ODP_DBG("  expired_timers_ring size=%u count=%u "
-		"peak_count=%u full_cnt=%u\n",
-		expired_ring->max_idx + 1, expired_ring->count,
-		expired_ring->peak_count,  expired_ring->expired_ring_full_cnt);
+	ODP_PRINT("  total timer_inserts=%" PRIu64 " timer_removes=%" PRIu64
+		  " insert_fails=%" PRIu64 "\n",
+		  timer_wheels->total_timer_inserts,
+		  timer_wheels->total_timer_removes,
+		  timer_wheels->insert_fail_cnt);
+	ODP_PRINT("  total_promote_cnt=%" PRIu64 " promote_fail_cnt=%"
+		  PRIu64 "\n", timer_wheels->total_promote_cnt,
+		  timer_wheels->promote_fail_cnt);
+	ODP_PRINT("  free_list_size=%u min_size=%u peak_size=%u\n",
+		  timer_wheels->free_list_size,
+		  timer_wheels->min_free_list_size,
+		  timer_wheels->peak_free_list_size);
+	ODP_PRINT("  expired_timers_ring size=%u count=%u "
+		  "peak_count=%u full_cnt=%u\n",
+		  expired_ring->max_idx + 1, expired_ring->count,
+		  expired_ring->peak_count,
+		  expired_ring->expired_ring_full_cnt);
 }
 
 void _odp_timer_wheel_destroy(_odp_timer_wheel_t timer_wheel)
diff --git a/platform/linux-generic/odp_traffic_mngr.c b/platform/linux-generic/odp_traffic_mngr.c
index 6d9573263..ab06b3c0d 100644
--- a/platform/linux-generic/odp_traffic_mngr.c
+++ b/platform/linux-generic/odp_traffic_mngr.c
@@ -4643,19 +4643,19 @@  void odp_tm_stats_print(odp_tm_t odp_tm)
 	tm_system = GET_TM_SYSTEM(odp_tm);
 	input_work_queue = tm_system->input_work_queue;
 
-	ODP_DBG("odp_tm_stats_print - tm_system=0x%" PRIX64 " tm_idx=%u\n",
-		odp_tm, tm_system->tm_idx);
-	ODP_DBG("  input_work_queue size=%u current cnt=%u peak cnt=%u\n",
-		INPUT_WORK_RING_SIZE, input_work_queue->queue_cnt,
-		input_work_queue->peak_cnt);
-	ODP_DBG("  input_work_queue enqueues=%" PRIu64 " dequeues=% " PRIu64
-		" fail_cnt=%" PRIu64 "\n", input_work_queue->total_enqueues,
-		input_work_queue->total_dequeues,
-		input_work_queue->enqueue_fail_cnt);
-	ODP_DBG("  green_cnt=%" PRIu64 " yellow_cnt=%" PRIu64 " red_cnt=%"
-		PRIu64 "\n", tm_system->shaper_green_cnt,
-		tm_system->shaper_yellow_cnt,
-		tm_system->shaper_red_cnt);
+	ODP_PRINT("odp_tm_stats_print - tm_system=0x%" PRIX64 " tm_idx=%u\n",
+		  odp_tm, tm_system->tm_idx);
+	ODP_PRINT("  input_work_queue size=%u current cnt=%u peak cnt=%u\n",
+		  INPUT_WORK_RING_SIZE, input_work_queue->queue_cnt,
+		  input_work_queue->peak_cnt);
+	ODP_PRINT("  input_work_queue enqueues=%" PRIu64 " dequeues=% " PRIu64
+		  " fail_cnt=%" PRIu64 "\n", input_work_queue->total_enqueues,
+		  input_work_queue->total_dequeues,
+		  input_work_queue->enqueue_fail_cnt);
+	ODP_PRINT("  green_cnt=%" PRIu64 " yellow_cnt=%" PRIu64 " red_cnt=%"
+		  PRIu64 "\n", tm_system->shaper_green_cnt,
+		  tm_system->shaper_yellow_cnt,
+		  tm_system->shaper_red_cnt);
 
 	_odp_pkt_queue_stats_print(tm_system->_odp_int_queue_pool);
 	_odp_timer_wheel_stats_print(tm_system->_odp_int_timer_wheel);
@@ -4665,14 +4665,14 @@  void odp_tm_stats_print(odp_tm_t odp_tm)
 	for (queue_num = 1; queue_num < max_queue_num; queue_num++) {
 		tm_queue_obj = tm_system->queue_num_tbl[queue_num - 1];
 		if (tm_queue_obj && tm_queue_obj->pkts_rcvd_cnt != 0)
-			ODP_DBG("queue_num=%u priority=%u rcvd=%u enqueued=%u "
-				"dequeued=%u consumed=%u\n",
-				queue_num,
-				tm_queue_obj->priority,
-				tm_queue_obj->pkts_rcvd_cnt,
-				tm_queue_obj->pkts_enqueued_cnt,
-				tm_queue_obj->pkts_dequeued_cnt,
-				tm_queue_obj->pkts_consumed_cnt);
+			ODP_PRINT("queue_num=%u priority=%u rcvd=%u enqueued=%u "
+				  "dequeued=%u consumed=%u\n",
+				  queue_num,
+				  tm_queue_obj->priority,
+				  tm_queue_obj->pkts_rcvd_cnt,
+				  tm_queue_obj->pkts_enqueued_cnt,
+				  tm_queue_obj->pkts_dequeued_cnt,
+				  tm_queue_obj->pkts_consumed_cnt);
 	}
 }