From patchwork Thu Jun 9 11:57:02 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: 69703 Delivered-To: patch@linaro.org Received: by 10.140.106.246 with SMTP id e109csp285910qgf; Thu, 9 Jun 2016 04:58:42 -0700 (PDT) X-Received: by 10.200.50.237 with SMTP id a42mr1716389qtb.80.1465473522009; Thu, 09 Jun 2016 04:58:42 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 43si3211228qgh.119.2016.06.09.04.58.41; Thu, 09 Jun 2016 04:58:41 -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 A7C4061DE4; Thu, 9 Jun 2016 11:58:41 +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_H3, RCVD_IN_MSPIKE_WL, 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 F35E961715; Thu, 9 Jun 2016 11:58:28 +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 0491A61719; Thu, 9 Jun 2016 11:58:26 +0000 (UTC) Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0111.outbound.protection.outlook.com [104.47.2.111]) by lists.linaro.org (Postfix) with ESMTPS id 9472F61711 for ; Thu, 9 Jun 2016 11:57:42 +0000 (UTC) Received: from DB5PR07CA0010.eurprd07.prod.outlook.com (10.167.223.20) by DB3PR07MB172.eurprd07.prod.outlook.com (10.242.132.151) with Microsoft SMTP Server (TLS) id 15.1.506.9; Thu, 9 Jun 2016 11:57:40 +0000 Received: from AM1FFO11OLC004.protection.gbl (2a01:111:f400:7e00::184) by DB5PR07CA0010.outlook.office365.com (2603:10a6:0:2d::20) with Microsoft SMTP Server (TLS) id 15.1.517.8 via Frontend Transport; Thu, 9 Jun 2016 11:57:40 +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 AM1FFO11OLC004.mail.protection.outlook.com (10.174.65.79) with Microsoft SMTP Server (TLS) id 15.1.497.8 via Frontend Transport; Thu, 9 Jun 2016 11:57:40 +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 u59Bv3S8004428 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Thu, 9 Jun 2016 14:57:04 +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 u59Bv3mg004410 (version=TLSv1/SSLv3 cipher=AES256-SHA256 bits=256 verify=NO) for ; Thu, 9 Jun 2016 14:57:03 +0300 X-HPESVCS-Source-Ip: 10.144.104.109 From: Matias Elo To: Date: Thu, 9 Jun 2016 14:57:02 +0300 Message-ID: <1465473423-20583-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)(199003)(189002)(107886002)(586003)(47776003)(6806005)(189998001)(22756006)(92566002)(110136002)(48376002)(81156014)(50466002)(97736004)(450100001)(19580405001)(19580395003)(87936001)(16796002)(106466001)(77096005)(5008740100001)(229853001)(33646002)(2351001)(50986999)(68736007)(2906002)(36756003)(5003940100001)(8676002)(81166006)(50226002)(8936002)(11100500001)(42882005)(473944003); DIR:OUT; SFP:1102; SCL:1; SRVR:DB3PR07MB172; H:mailrelay.int.nokia.com; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; AM1FFO11OLC004; 1:A03RpyaDZmxzrWrjeaabo7lONxHL4wWW39whwv5BoDDxhvPb3+Jn1z8T22ZSp3tNlA8l6kmnuvEPWGE3WHQ5bE4LXK/FM9SVi8Gq5a+LFhx+YWkUsT80tIgZtyaVE2+E16GvkYxoUMULWeplfbhSVF8xp5/sDUlUh137WyyHVh5yL2nKd1bNnCvztgcBsnX+VQe2d6dVqshHtvHcb8/kIokyCYwqQAMfko0+QNOZZsSBZdwpAIPybLRBsb0CF+rslrdxvLu1JqbnYR2J6psqJyHtQwZB6V5sydJzJRl7IIKWRWLRfQwx00PZEex4AW8sFSBOup4F9l51k3MoryabOF4kNkXyIKZyNIbGRZGKLQFBmN+PoxZSLdcZyNAU1MRgH1Pp3THA6lyl4dv6owMOxRmWl6zuH9/Pq5adBjbpritU2pChghDvU6zTc51rZHC3GkT1XMhW9w2rgW1vlqCdOg== MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 6ca741d5-29a8-4e31-4670-08d3905d422a X-Microsoft-Exchange-Diagnostics: 1; DB3PR07MB172; 2:PmnGVRT7RDVp0/M/hfP0N0h4IDV3gVDdvaDSxwptdXvBD+NwdzyemcP1t9za3QjkUIwHKWyh7ipvzQnmOaSuYBTREuw1nPFKCwwfqbB+hJpTG5r2sJbyaVmstKcN3DfYcKi7nJiaaUMTHErAfAy93fakClQMcE0CrwQNZfWsrz4Sr6fL+QxdGU/UTvZIdFVm; 3:4Yltg14819k5AdmnZnPNnqNzJKJb3Z7EGKPHOratNvn6m0pzNNaz7ONTDEaQxq8La7Ceyrqu4MaZltjb/3TKj14EyJH68ULSpjQ6TJeoyp/LadnTrsuvqgC/TGhBeLm1937FyWwxsqZoaJ5BezFt0BXp0vkjDtPkxh2kBpwtphipqMg/cPQ5JZZZ7zOAZcZxEePsPEJKroINoDo+thdc+8xJ0vkfk5jOKbIt4zzkRJLeKI3z/+if4jeev8xFKSJ8yvWA993r5egv5hv1GW2nJw==; 25:sUKUz5P2VFLf/G6tBMPrmWVuy/jBzVGjh9mJb9P/1OYIEiNehvOAzdMrzck5izrEi30xUjzw/YQcTM3Svdo32pXmxIreb5FoMYhk2KMoW/H8v85wz4Q8DNgmKAqvkccphTA9sEoSlc2UUYTiYQTtMfdt/9D9ZeU5tVJCOnN4Y9U4uN2SkE0yY4DjSM6cKv+McqlXJkl12s7JqDmmHntuuBFkeVPMEXGsi4TKSSYw4QchWDFytr2pqxgXJ+hAUfa6YfTJfVVAF++ndbSQt2PcCCjiT/lvLSpIBflus6+Tvk8ap1ngfClDahyISKsGyBZjnGHDv6V3pwM4DZtTQe/2rG1dTg4XBTpHlP/Sd66RfB+OAxadvm9I9PdyxeEDNCwp5c3owYorlDuk0R/C0l3CLLIMLgC3QsMzWeeUdx+KJsI= X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(8251501002); SRVR:DB3PR07MB172; X-Microsoft-Exchange-Diagnostics: 1; DB3PR07MB172; 20:BYih5ReTT+wn/tgg/rzA2JIjk+CRdSC1zvUet68MrLcYJGBQ1v75a0Y4Pt1qJ2aSPaSYyWbzC74YA8NvU7EjBx95Q4NbDMlCPPMVNoOmWbDD+e9v2JnnJvAJz0sDG1sqI8xCSNERhDvsM/ctH/1kedP3m8HEFFnpHJ+F7Cp08HiofyvCRF5YlaU5KI5kua43yIb7i7zTFZkr9dDxkV5p7YaTyuCXo+AQKbQI+VVpPu3AyVL3NEFU6Z8MKsDWsYP6tIGsMpb7iveOAt8vm3Hg3wGB9TcEWjDRiBLm20Mm+LRUbKJrpKdZQuHwml8Y9Aa52N8TkJ8bsNERsT34PvrbZ3obBYEa6QbRsuuLJMkXysBry8Sas8fSR/deVVLgVeXf5tYE9nkGO3YTY2Solf5lJcukmAbKX9e55zZg9Rc+hD6u3/W3zeKuSWsrPcYSlSLsbtjFO6RAOW4yec1McoW00F4CRTgpQp8HB/mQSV6d6PCpZij2MOxb8r5Btz2mzdbqDBJ3aXAmsj3vAA4qORTG/b4gXD21SU8uMFKemebsx5LZehqaIYGp7O5qkCFTXHyeVdI7V3nwANfZFAlSbXGP4oYTit71CePY0VEoy/DQMxE= 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)(8121501046)(5005006)(3002001)(10201501046); SRVR:DB3PR07MB172; BCL:0; PCL:0; RULEID:; SRVR:DB3PR07MB172; X-Microsoft-Exchange-Diagnostics: 1; DB3PR07MB172; 4:YjUu95o8hamZSU86Ui+Nbs4EFghPLV0FFMwY+WjSAyy85DYpjUrSJObp0/t2vUtLZRe9YetITqpOFzlhjrAIC9Zmg4qz0n3MRbLs34Yyg4KbOg7y3dHXNwWFKObLyrV1eDjEIDdLcFAtbfP8oN0uC2at7uoBincw3KZPe8AFLQ/cywDy07uVPnwYs/iiMzaMjTIxwLSAYYRJjeswGKuKioFGOSe1gCpsphxcoCCNFoslVHO6nqW0Z4hkXRTu8K91ftRaO9SEQihbfFeoEZcjSJRzmMHiRpizuS9s0O/vbm+xFsCgJD4vTvWUZ6hszkQyuNLYXYo/8ebqOYjXJn2zHvJf+9a3dJk2jYYF4JDy0amK72Ck1ymNomPUgc4frQ8WRHUzJ0PaXyUXOdhUwrOy9rBzJWjKz6HJ7aNIQxuGLz+PshPx6FYKk1nwq75z1JudI0I7vflhKQFcQPVo7Ucxs1kGvoVnFgzNyW2XFxHniPKZ2JR8s0FNvzgdUmvebIh+L7n4skfoIB4/dr34aUWgBQ== X-Forefront-PRVS: 0968D37274 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DB3PR07MB172; 23:MtJUKoDnIG/QSWVQ+8gv/MrPzSJQ3yt47QLYJohROh?= =?us-ascii?Q?i6XlPY+UxlJc7frG5c+I4bt7IwEyH2L6+ZyygFEEjunnIVkvz3liW+0LbbOs?= =?us-ascii?Q?puqD7xqFtXuH4Qn29nhbpI9cTR4ObB3BGu/4/ZQ7wSDoIG7khSC/JTqYwIdC?= =?us-ascii?Q?gbz5b61YVovr2S5xu32UEVbxlRcSwhRVSYKVGTJJKlxFjzw9w2PN67gt+5tP?= =?us-ascii?Q?at0r8qmnoiNcrYveg0thReL++bMIgon+INf4I4XsTlcMhuxGXw5wlBrbkyJn?= =?us-ascii?Q?PDWLazv/FdadXRh+7yLrSpD7ZG8oB+vZQzz61MTh46MpCX4A9FUcS1CpXhy5?= =?us-ascii?Q?hOUQjvTHsgxUxO64dJ74HFjXUIagoIU1+jntjAduxPUpvCuDVVw/TjqTn27i?= =?us-ascii?Q?RY7JJNsG7F/UBtWMwEmAxc6Cutg1Uk6vjpmu/SF0y1lJfkImk7vVSPL1fFfm?= =?us-ascii?Q?ocKn4ZlfLjJLyihZpTrV5M2fVQyoUAElrGKyoibGe2wDj/5PBqNSVEuPE7jc?= =?us-ascii?Q?Xrgxsh/7Z6PCw9o4RdNPyR/YjR3/uG5gzAZVdDVtfUb920T87devZu5Qmc66?= =?us-ascii?Q?+WN3mVgofuLaz/EX09dKlMUnjs4DDB4shgDZvzGuEEmlfVg1cVjvuovyqA6y?= =?us-ascii?Q?rii9126yYu/SNPdZ40nhwGjuBj4W9stLLKfB4ujCY6Ehcu8cvVRWbHgQgo9t?= =?us-ascii?Q?//qcuoe+WYgBU6jaowKIZ0x0LYgPY9O98PO6EqxEn8HIUF49ou5iYwn08kM/?= =?us-ascii?Q?Sl0a5seZ9IpeciA2k3QFZrXhw/HxfBr4w8MSY5VmofZ0YHrDOhb5Vy2AGKHs?= =?us-ascii?Q?QjuFUMZycA7iPmnWCB9naM83fhlzbl9dtO3Gxj1+7liznsBL9sejZuv5l0p4?= =?us-ascii?Q?DNbhuVeQwPHFPE0yjq1U6noNjXMzIvrTBE79Wkhu4T2gf9xaHxux24aLoW1k?= =?us-ascii?Q?nxUdttVUiJAYN1EHXnU0DDNXgZoEMwf+TrTH4zd3wuswEBs7+1B/V2oRZg92?= =?us-ascii?Q?lWVGHB/1XGTRFKlB9Nprwk4uuaBYmakm6f3ysOp9mlPA=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; DB3PR07MB172; 5:t2vV7QcDyB+6irPef6g/sz1PonRAVSObQsvzPZTPs56Q1GdTmpWKm3dDjUFARIpfg1lXZ4L5JiIi+jvMgZmT3YmVbbVP2scn49nWTlNMX0HWPU2aHFyMlIxLARQ/lzBnyBF0RX+vnO/o7no2JFcypA==; 24:r9A5RyzeChGEJNJQD5Pgy2kOpFvp8mpeOBAsco+bhpYjFD1Nk3cAM/Kbnw0muDT6SvfmegNwx8b1d704p2wR1F6xuHlVI9dFmNPPHjIcsvg=; 7:393f9l8LXJq2OqBeI9149hSLljWa2lYtW2Hd8EkezyOWOmCDpctT+dMB9fTp0LJ7irMfL8oL1Z0HADAgb7XelMOjEwrcTj4sOtLkio9/x/Hl0rSjgXJVCQIl2yNm6AIMtLSlAtItS3ndfD2ogPDKcG9cVk9qGg//JtTQx4sxPpb8WJsUaX/l2bI2WPlThMMaG8aWNrt5qFtZofr98/SyJ2akzC64DA8+JohXakxsEr0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nokia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2016 11:57:40.4237 (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: DB3PR07MB172 X-Topics: patch Subject: [lng-odp] [PATCH v2 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); } }