From patchwork Thu Jun 9 11:38:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Elo, Matias \(Nokia - FI/Espoo\)" X-Patchwork-Id: 69701 Delivered-To: patch@linaro.org Received: by 10.140.106.246 with SMTP id e109csp279223qgf; Thu, 9 Jun 2016 04:40:10 -0700 (PDT) X-Received: by 10.200.53.39 with SMTP id y36mr9228454qtb.92.1465472410116; Thu, 09 Jun 2016 04:40:10 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id c63si3191934qhc.27.2016.06.09.04.40.08; Thu, 09 Jun 2016 04:40:10 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE dis=NONE) header.from=nokia.com Received: by lists.linaro.org (Postfix, from userid 109) id 50F2061DF3; Thu, 9 Jun 2016 11:40:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAD_ENC_HEADER,BAYES_00, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 16B8761579; Thu, 9 Jun 2016 11:39:56 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id D4EC4615C8; Thu, 9 Jun 2016 11:39:52 +0000 (UTC) Received: from emea01-am1-obe.outbound.protection.outlook.com (mail-am1on0107.outbound.protection.outlook.com [157.56.112.107]) by lists.linaro.org (Postfix) with ESMTPS id 88909611F3 for ; Thu, 9 Jun 2016 11:39:13 +0000 (UTC) Received: from VI1PR07CA0049.eurprd07.prod.outlook.com (10.164.94.145) by HE1PR07MB1513.eurprd07.prod.outlook.com (10.169.122.147) with Microsoft SMTP Server (TLS) id 15.1.511.8; Thu, 9 Jun 2016 11:39:11 +0000 Received: from AM1FFO11FD025.protection.gbl (2a01:111:f400:7e00::181) by VI1PR07CA0049.outlook.office365.com (2a01:111:e400:5967::17) with Microsoft SMTP Server (TLS) id 15.1.517.8 via Frontend Transport; Thu, 9 Jun 2016 11:39:11 +0000 Received-SPF: Pass (protection.outlook.com: domain of nokia.com designates 131.228.2.240 as permitted sender) receiver=protection.outlook.com; client-ip=131.228.2.240; helo=mailrelay.int.nokia.com; Received: from mailrelay.int.nokia.com (131.228.2.240) by AM1FFO11FD025.mail.protection.outlook.com (10.174.64.214) with Microsoft SMTP Server (TLS) id 15.1.497.8 via Frontend Transport; Thu, 9 Jun 2016 11:39:11 +0000 Received: from fihe3nok0734.emea.nsn-net.net (localhost [127.0.0.1]) by fihe3nok0734.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id u59BcZ2U027208 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Thu, 9 Jun 2016 14:38:35 +0300 Received: from 10.144.19.15 ([10.144.104.109]) by fihe3nok0734.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id u59BcZQv027205 (version=TLSv1/SSLv3 cipher=AES256-SHA256 bits=256 verify=NO) for ; Thu, 9 Jun 2016 14:38:35 +0300 X-HPESVCS-Source-Ip: 10.144.104.109 From: Matias Elo To: Date: Thu, 9 Jun 2016 14:38:34 +0300 Message-ID: <1465472315-20090-1-git-send-email-matias.elo@nokia.com> X-Mailer: git-send-email 1.9.1 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:131.228.2.240; IPV:NLI; CTRY:FI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(438002)(189002)(199003)(189998001)(2906002)(36756003)(11100500001)(107886002)(50986999)(50466002)(97736004)(48376002)(5008740100001)(47776003)(110136002)(33646002)(22756006)(19580405001)(19580395003)(16796002)(450100001)(77096005)(68736007)(87936001)(586003)(8936002)(92566002)(6806005)(5003940100001)(8676002)(81156014)(81166006)(50226002)(106466001)(229853001)(2351001)(42882005)(473944003); DIR:OUT; SFP:1102; SCL:1; SRVR:HE1PR07MB1513; H:mailrelay.int.nokia.com; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; AM1FFO11FD025; 1:F7pmljTEvrXBLrDqUnHemtxM56FfYqGucW6gE5ABPs4A/Iy8E7cM/dkK5BUS58vRdFrPZuZB+WLAW9PGDxnEfSBQm2FudHBzmWmkHEKRfZXGMyNOZ33cayjdAMqcDWhMfH9gGS7JmMZXNci9mG9QHrp7hliDtMQD29hDBWvzYl/EyqC5ZM8SBstdoz6vYoOIdS4L4hKh8S6btXJ8a+TnVJpyuraewHgM8G5tnDcBl8r4109qZnnfPrrvJxcRb0BMYSgeo2uaA/qVQ1QiRzi4OYPeYwFB/UOs600UAqpXE4GZG+HWXN+zwnYfvZP766MZ+mWSvN3Ck4M3lCQktRFq5SRmJhQ4hW1c5nfpBtAqjmqVSZJDkjPaMj9iocRxNdwuh7DcfxrHos7Acv3BjBO7GjsEpFKtY0XN7aL8baW7nFNw4AIDpRfpy4izvYzKcK8Z7AnD9HcWdZaahln6p1cCRQ== MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 824eff5d-b940-4b81-9b03-08d3905aad1a X-Microsoft-Exchange-Diagnostics: 1; HE1PR07MB1513; 2:xrQUTmajQwoX99GHoLMDogwZrIbpVMdDqkjhnRv2EMlcLwZY2CZW2ZJuueTQ8P9cVqm/f794an3CD34JMgrXJXirBKsBibsZq9BLY8ST31QiRa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SKVwPxOYOPHYURkZzquSaFhUXWMwvOi60oNd0sStCsr4BzwRAZfl5KMQYABdWjXFm5Tc8eRhYDvJ17GKt2VvuGoitkSSNjkYtQOOke7ApsBoMUWhJiOucmwi4IDwCnZJM/B4QvT4tztCdAQimCfR9NcLT5jME54hUiqri X-Microsoft-Exchange-Diagnostics: 1; HE1PR07MB1513; 20:VpYkUNUVSYfhmogoZG3V7izVrlvFNOjkHAVjuLn3AaXw0RNu0eWsXY+bCzKVgHG3VlP30/sWl9o+5A/3pg+rmdVRg084W1QjwW3KubLJnfv2azbYtT5uY9a1Rhq87gcWJQ7RoFMFz5lxhOLC3S+CRgBeQJJzr/1swHGwCjBK8Cg8StHOU9bl4fPsQUzTY7z88Dmobn3SgKXiZhUPXrR+gNCgkeHAi0n6VLLbFtcOG7UhRK7aPgW3M7vkAyLYMBNTWzKmbZkInrCF1lJS8hOxWXWRGE+MTglY/8YGy0ZZE4hcYiZqxsozr5KY4PC+3Vlv/HX0mftOhgnyDdKI/A1Hn7v9a4aZVPz3qNETPxtfJdfUm5A0Jw8mltOTr8klnq5CaWArrZn7vBA/4fT2bftRfra8/FSQvS1bBlh5qMHJqtd4PnLRaUmVMloHW0VOCJTjZ+ry/GsUfnjHlplTSJktf6H8GD8yUL1WRHuYSla3URSKjvaYxc0hMJbSqJ3ZpUogrIU5CZrmXs1gk6AsWzQTDD4PYlEI0051DvE95uWNZ1LR8b8N3tCRKmX74X87+GVnni67kMVqxWPevCnsz9I5vU99hvxILpUvse9EhgjAsKE= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(82608151540597)(22766785571888)(17755550239193); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13018025)(13016025)(5005006)(8121501046)(10201501046)(3002001); SRVR:HE1PR07MB1513; BCL:0; PCL:0; RULEID:; SRVR:HE1PR07MB1513; X-Microsoft-Exchange-Diagnostics: 1; HE1PR07MB1513; 4:D09z/kgClOm188Hr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pLqKvyG8grXQWCuPIlnfYDMeNL+C2tktGZvhlroTFrY/E=; 7:GFdNZWn1Sz/rwjhKAsxOtKCdpRnMqxrE3gaxK47nMCzePURRm3BsXZrGtjLlaYbY+SLbmqJUNGHtMw8iiJngWnM1vG8/pIQJ/Tob08Str8RaM/b9mqACqSUK7iDJ7vCRpCjvWU90B+04QXJfyHK8RTBXBBkBK90FkaXVhNqaXwkPsiv83px5aycLftZDHZGj/JMDZIGyl3bHr41/UJoGF2sWyt5OeC/3zOp8/DHzfEo= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nokia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2016 11:39:11.3626 (UTC) X-MS-Exchange-CrossTenant-Id: 5d471751-9675-428d-917b-70f44f9630b0 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5d471751-9675-428d-917b-70f44f9630b0; Ip=[131.228.2.240]; Helo=[mailrelay.int.nokia.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR07MB1513 X-Topics: patch Subject: [lng-odp] [PATCH 1/2] linux-gen: fix debug info print functions X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" ODP_DBG() macro should not be used inside *_print() functions. Since debug messages are disabled by default, the print functions won't output anything with ODP_DBG. The patch also removes the extra space previously added to the beginning of ODP_PRINT messages. Signed-off-by: Matias Elo --- V2: - Don't modify secondary_hash_dump() - Remove unused tm debug print functions .../linux-generic/include/odp_debug_internal.h | 2 +- platform/linux-generic/odp_pkt_queue.c | 34 +++-- platform/linux-generic/odp_pool.c | 139 ++++++++++++++------- platform/linux-generic/odp_sorted_list.c | 21 +++- platform/linux-generic/odp_timer_wheel.c | 44 +++---- platform/linux-generic/odp_traffic_mngr.c | 41 +++--- 6 files changed, 174 insertions(+), 107 deletions(-) diff --git a/platform/linux-generic/include/odp_debug_internal.h b/platform/linux-generic/include/odp_debug_internal.h index 02ae87a..4c44beb 100644 --- a/platform/linux-generic/include/odp_debug_internal.h +++ b/platform/linux-generic/include/odp_debug_internal.h @@ -81,7 +81,7 @@ extern "C" { * specifically for dumping internal data. */ #define ODP_PRINT(fmt, ...) \ - odp_global_data.log_fn(ODP_LOG_PRINT, " " fmt, ##__VA_ARGS__) + odp_global_data.log_fn(ODP_LOG_PRINT, fmt, ##__VA_ARGS__) #ifdef __cplusplus } diff --git a/platform/linux-generic/odp_pkt_queue.c b/platform/linux-generic/odp_pkt_queue.c index 949cf74..f43ceeb 100644 --- a/platform/linux-generic/odp_pkt_queue.c +++ b/platform/linux-generic/odp_pkt_queue.c @@ -346,19 +346,31 @@ int _odp_pkt_queue_remove(_odp_int_queue_pool_t queue_pool, void _odp_pkt_queue_stats_print(_odp_int_queue_pool_t queue_pool) { queue_pool_t *pool; + int max_len = 512; + char str[max_len]; + int len = 0; + int n = max_len - 1; 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); + + len += snprintf(&str[len], n - len, + "pkt_queue_stats - queue_pool=0x%" PRIX64 "\n", + queue_pool); + len += snprintf(&str[len], n - len, + " 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); + len += snprintf(&str[len], n - len, + " total pkt appends=%" PRIu64 " total pkt removes=" + "%" PRIu64 " bad removes=%" PRIu64 "\n", + pool->total_pkt_appends, pool->total_pkt_removes, + pool->total_bad_removes); + len += snprintf(&str[len], n - len, + " 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); + str[len] = '\0'; + ODP_PRINT("\n%s\n", str); } void _odp_queue_pool_destroy(_odp_int_queue_pool_t queue_pool) diff --git a/platform/linux-generic/odp_pool.c b/platform/linux-generic/odp_pool.c index 5ed7080..c1ffaaa 100644 --- a/platform/linux-generic/odp_pool.c +++ b/platform/linux-generic/odp_pool.c @@ -735,6 +735,10 @@ void odp_pool_print(odp_pool_t pool_hdl) { pool_entry_t *pool; uint32_t pool_id; + int max_len = 1536; + char str[max_len]; + int len = 0; + int n = max_len - 1; pool_id = pool_handle_to_index(pool_hdl); pool = get_pool_entry(pool_id); @@ -756,64 +760,105 @@ void odp_pool_print(odp_pool_t pool_hdl) uint64_t blklowmct = odp_atomic_load_u64(&pool->s.poolstats.blk_low_wm_count); - ODP_DBG("Pool info\n"); - ODP_DBG("---------\n"); - ODP_DBG(" pool %" PRIu64 "\n", + len += snprintf(&str[len], n - len, "Pool info\n"); + len += snprintf(&str[len], n - len, "---------\n"); + len += snprintf(&str[len], n - len, " pool %" PRIu64 "\n", odp_pool_to_u64(pool->s.pool_hdl)); - ODP_DBG(" name %s\n", + len += snprintf(&str[len], n - len, " name %s\n", pool->s.flags.has_name ? pool->s.name : "Unnamed Pool"); - ODP_DBG(" pool type %s\n", + len += snprintf(&str[len], n - len, " pool type %s\n", pool->s.params.type == ODP_POOL_BUFFER ? "buffer" : (pool->s.params.type == ODP_POOL_PACKET ? "packet" : (pool->s.params.type == ODP_POOL_TIMEOUT ? "timeout" : "unknown"))); - ODP_DBG(" pool storage ODP managed shm handle %" PRIu64 "\n", - odp_shm_to_u64(pool->s.pool_shm)); - ODP_DBG(" pool status %s\n", - pool->s.quiesced ? "quiesced" : "active"); - ODP_DBG(" pool opts %s, %s, %s\n", - pool->s.flags.unsegmented ? "unsegmented" : "segmented", - pool->s.flags.zeroized ? "zeroized" : "non-zeroized", - pool->s.flags.predefined ? "predefined" : "created"); - ODP_DBG(" pool base %p\n", pool->s.pool_base_addr); - ODP_DBG(" pool size %zu (%zu pages)\n", + len += snprintf(&str[len], n - len, + " pool storage ODP managed shm handle %" PRIu64 "\n", + odp_shm_to_u64(pool->s.pool_shm)); + len += snprintf(&str[len], n - len, " pool status %s\n", + pool->s.quiesced ? "quiesced" : "active"); + len += snprintf(&str[len], n - len, " pool opts %s, %s, %s\n", + pool->s.flags.unsegmented ? "unsegmented" : "segmented", + pool->s.flags.zeroized ? "zeroized" : "non-zeroized", + pool->s.flags.predefined ? "predefined" : "created"); + len += snprintf(&str[len], n - len, " pool base %p\n", + pool->s.pool_base_addr); + len += snprintf(&str[len], n - len, + " pool size %zu (%zu pages)\n", pool->s.pool_size, pool->s.pool_size / ODP_PAGE_SIZE); - ODP_DBG(" pool mdata base %p\n", pool->s.pool_mdata_addr); - ODP_DBG(" udata size %zu\n", pool->s.udata_size); - ODP_DBG(" headroom %u\n", pool->s.headroom); - ODP_DBG(" tailroom %u\n", pool->s.tailroom); + len += snprintf(&str[len], n - len, " pool mdata base %p\n", + pool->s.pool_mdata_addr); + len += snprintf(&str[len], n - len, " udata size %" PRIu32 "\n", + pool->s.udata_size); + len += snprintf(&str[len], n - len, " headroom %" PRIu32 "\n", + pool->s.headroom); + len += snprintf(&str[len], n - len, " tailroom %" PRIu32 "\n", + pool->s.tailroom); if (pool->s.params.type == ODP_POOL_BUFFER) { - ODP_DBG(" buf size %zu\n", pool->s.params.buf.size); - ODP_DBG(" buf align %u requested, %u used\n", - pool->s.params.buf.align, pool->s.buf_align); + len += snprintf(&str[len], n - len, + " buf size %" PRIu32 "\n", + pool->s.params.buf.size); + len += snprintf(&str[len], n - len, + " buf align %" PRIu32 " requested, " + "%" PRIu32 " used\n", pool->s.params.buf.align, + pool->s.buf_align); } else if (pool->s.params.type == ODP_POOL_PACKET) { - ODP_DBG(" seg length %u requested, %u used\n", - pool->s.params.pkt.seg_len, pool->s.seg_size); - ODP_DBG(" pkt length %u requested, %u used\n", - pool->s.params.pkt.len, pool->s.blk_size); + len += snprintf(&str[len], n - len, + " seg length %" PRIu32 " requested, " + "%" PRIu32 " used\n", + pool->s.params.pkt.seg_len, pool->s.seg_size); + len += snprintf(&str[len], n - len, + " pkt length %" PRIu32 " requested, " + "%" PRIu32 " used\n", pool->s.params.pkt.len, + pool->s.blk_size); } - ODP_DBG(" num bufs %u\n", pool->s.buf_num); - ODP_DBG(" bufs available %u %s\n", bufcount, - pool->s.buf_low_wm_assert ? " **buf low wm asserted**" : ""); - ODP_DBG(" bufs in use %u\n", pool->s.buf_num - bufcount); - ODP_DBG(" buf allocs %lu\n", bufallocs); - ODP_DBG(" buf frees %lu\n", buffrees); - ODP_DBG(" buf empty %lu\n", bufempty); - ODP_DBG(" blk size %zu\n", + len += snprintf(&str[len], n - len, + " num bufs %" PRIu32 "\n", pool->s.buf_num); + len += snprintf(&str[len], n - len, " bufs available %" PRIu32 " %s\n", + bufcount, pool->s.buf_low_wm_assert ? + " **buf low wm asserted**" : ""); + len += snprintf(&str[len], n - len, + " bufs in use %" PRIu32 "\n", + pool->s.buf_num - bufcount); + len += snprintf(&str[len], n - len, + " buf allocs %" PRIu64 "\n", bufallocs); + len += snprintf(&str[len], n - len, + " buf frees %" PRIu64 "\n", buffrees); + len += snprintf(&str[len], n - len, + " buf empty %" PRIu64 "\n", bufempty); + len += snprintf(&str[len], n - len, + " blk size %" PRIu32 "\n", pool->s.seg_size > ODP_MAX_INLINE_BUF ? pool->s.seg_size : 0); - ODP_DBG(" blks available %u %s\n", blkcount, - pool->s.blk_low_wm_assert ? " **blk low wm asserted**" : ""); - ODP_DBG(" blk allocs %lu\n", blkallocs); - ODP_DBG(" blk frees %lu\n", blkfrees); - ODP_DBG(" blk empty %lu\n", blkempty); - ODP_DBG(" buf high wm value %lu\n", pool->s.buf_high_wm); - ODP_DBG(" buf high wm count %lu\n", bufhiwmct); - ODP_DBG(" buf low wm value %lu\n", pool->s.buf_low_wm); - ODP_DBG(" buf low wm count %lu\n", buflowmct); - ODP_DBG(" blk high wm value %lu\n", pool->s.blk_high_wm); - ODP_DBG(" blk high wm count %lu\n", blkhiwmct); - ODP_DBG(" blk low wm value %lu\n", pool->s.blk_low_wm); - ODP_DBG(" blk low wm count %lu\n", blklowmct); + len += snprintf(&str[len], n - len, " blks available %" PRIu32 " %s\n", + blkcount, pool->s.blk_low_wm_assert ? + " **blk low wm asserted**" : ""); + len += snprintf(&str[len], n - len, + " blk allocs %" PRIu64 "\n", blkallocs); + len += snprintf(&str[len], n - len, + " blk frees %" PRIu64 "\n", blkfrees); + len += snprintf(&str[len], n - len, + " blk empty %" PRIu64 "\n", blkempty); + len += snprintf(&str[len], n - len, + " buf high wm value %" PRIu32 "\n", + pool->s.buf_high_wm); + len += snprintf(&str[len], n - len, + " buf high wm count %" PRIu64 "\n", bufhiwmct); + len += snprintf(&str[len], n - len, + " buf low wm value %" PRIu32 "\n", + pool->s.buf_low_wm); + len += snprintf(&str[len], n - len, + " buf low wm count %" PRIu64 "\n", buflowmct); + len += snprintf(&str[len], n - len, + " blk high wm value %" PRIu32 "\n", + pool->s.blk_high_wm); + len += snprintf(&str[len], n - len, + " blk high wm count %" PRIu64 "\n", blkhiwmct); + len += snprintf(&str[len], n - len, + " blk low wm value %" PRIu32 "\n", + pool->s.blk_low_wm); + len += snprintf(&str[len], n - len, + " blk low wm count %" PRIu64 "\n", blklowmct); + str[len] = '\0'; + ODP_PRINT("\n%s\n", str); } diff --git a/platform/linux-generic/odp_sorted_list.c b/platform/linux-generic/odp_sorted_list.c index 554494b..0dc08a8 100644 --- a/platform/linux-generic/odp_sorted_list.c +++ b/platform/linux-generic/odp_sorted_list.c @@ -256,14 +256,23 @@ int _odp_sorted_list_destroy(_odp_int_sorted_pool_t sorted_pool, void _odp_sorted_list_stats_print(_odp_int_sorted_pool_t sorted_pool) { sorted_pool_t *pool; + int max_len = 512; + char str[max_len]; + int len = 0; + int n = max_len - 1; 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); + len += snprintf(&str[len], n - len, + "sorted_pool=0x%" PRIX64 "\n", sorted_pool); + len += snprintf(&str[len], n - len, + " max_sorted_lists=%u next_list_idx=%u\n", + pool->max_sorted_lists, pool->next_list_idx); + len += snprintf(&str[len], n - len, + " total_inserts=%" PRIu64 " total_deletes=%" PRIu64 + " total_removes=%" PRIu64 "\n", pool->total_inserts, + pool->total_deletes, pool->total_removes); + str[len] = '\0'; + ODP_PRINT("\n%s\n", str); } 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 865dd7e..4b1986f 100644 --- a/platform/linux-generic/odp_timer_wheel.c +++ b/platform/linux-generic/odp_timer_wheel.c @@ -934,10 +934,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) @@ -949,28 +949,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 1fa2d27..3dad3ad 100644 --- a/platform/linux-generic/odp_traffic_mngr.c +++ b/platform/linux-generic/odp_traffic_mngr.c @@ -4406,19 +4406,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); @@ -4428,14 +4428,13 @@ 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]; 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); } }