From patchwork Tue Sep 4 16:00:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 145938 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp3836620ljw; Tue, 4 Sep 2018 09:00:30 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbbLXDG99QuvCdygeQsyLqrp/sH9n45a8ngGEEno6a5tVHR0XnmZIhFqzos++tkD8P/0CtR X-Received: by 2002:a37:c15:: with SMTP id 21-v6mr29059140qkm.95.1536076830266; Tue, 04 Sep 2018 09:00:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536076830; cv=none; d=google.com; s=arc-20160816; b=yz1z4yRK722HvA3zlwI7NAUydxYJECzBGZ+W8uMIuCDs0eD3zo/uusHXd58X0mdegq 4GjwS5KERDQRQ1lF3jJ/34LZqTyRhqVagZfGX1sG8cBdVZVD7zNuRVy2F0wkvL9HiC8h Twp9uT3ZSiBce69qP0A+ZQ4kuI9vqY+0tpQMFXrGvPTlW9GRFpgSveGHY/ZqSADVIx8s ZjxFQzZBiVyEFVpKqy50e65JzXenpjRrv8/Vvit1jaQuIBkjGYZznmX5Rubc2rTmLv2+ j2blOdhDcA6G9Ahhw7FA84Tb0g0XEmY6i+Uiob3xhWAeWO9dp9za7as6ooG1E2Peps81 nHaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=8PQF6aI9GuF9z26PnBZN3IMrbqoBs+eJDIwNxFxa8L4=; b=NOLjo0JOaUkMBiz/CaBLMluIX1v/BX7Hoe2QMZ5VczWrT1lsssKx8aoucNqlEaQ01O URwbkRSlTsWBRJdP1QWJYIDLeJZ2FMVwD7DFQhel/wfhpGnfiKk7NNAjrWPN5G0T5DBX BrxzWH2z9pahGk1blQWoLvLTjSMelWoi3o1OKkJch6QWq5Yu/gVKRpPxFLEcAsqeCXRg DvsI5q3N0DEI1y+9klDLmpd3pG614RLP9Jrk9hwlx9mYwMmzbXr0hHFv0cBjb3huO4hn h5WjyVleOiA878L8mMMj9crieD5blLIXtVWTYtds08OEt9AzPtafmWPzjsSI0prAHs7k NHSQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id 47-v6si5076329qvo.161.2018.09.04.09.00.29; Tue, 04 Sep 2018 09:00:30 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 860EA685BE; Tue, 4 Sep 2018 16:00:29 +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=-3.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_LOW 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 7D39F6180C; Tue, 4 Sep 2018 16:00:24 +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 ED81467B5F; Tue, 4 Sep 2018 16:00:21 +0000 (UTC) Received: from forward103j.mail.yandex.net (forward103j.mail.yandex.net [5.45.198.246]) by lists.linaro.org (Postfix) with ESMTPS id 8C6B66180C for ; Tue, 4 Sep 2018 16:00:19 +0000 (UTC) Received: from mxback1j.mail.yandex.net (mxback1j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10a]) by forward103j.mail.yandex.net (Yandex) with ESMTP id B48C034C2320 for ; Tue, 4 Sep 2018 19:00:14 +0300 (MSK) Received: from smtp1j.mail.yandex.net (smtp1j.mail.yandex.net [2a02:6b8:0:801::ab]) by mxback1j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id mvFf5RQo9x-0EfSP4Au; Tue, 04 Sep 2018 19:00:14 +0300 Received: by smtp1j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id E16oKLG0NW-0DKaEFuw; Tue, 04 Sep 2018 19:00:13 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Tue, 4 Sep 2018 16:00:12 +0000 Message-Id: <1536076812-7642-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1536076812-7642-1-git-send-email-odpbot@yandex.ru> References: <1536076812-7642-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 686 Subject: [lng-odp] [PATCH v2 1/1] linux-gen: odp_shm_print_all: refine output spreadsheet 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" From: Maxim Uvarov Refine output print to make output spreadsheet more readable: Memory allocation status: name flag range user_len unused seq ref fd file 0 odp_thread_globals ..N 0x7f59e1b74000-0x7f59e1b75000 3472 624 1 1 3 (none) 1 _odp_pool_table ..N 0x7f59bf40d000-0x7f59c0514000 17850432 4032 1 1 4 (none) 2 _odp_queue_gbl ..N 0x7f59e1ab0000-0x7f59e1b11000 393344 3968 1 1 5 (none) 3 _odp_queue_rings ..N 0x7f59bd40d000-0x7f59bf40d000 33554432 0 1 1 6 (none) 4 odp_queues_lf ..N 0x7f59e1a9f000-0x7f59e1ab0000 67648 1984 1 1 7 (none) 5 odp_scheduler ..N 0x7f59bcbb9000-0x7f59bd40d000 8730624 2048 1 1 9 (none) 6 odp_pktio_entries S.N 0x7f59c0600000-0x7f59c0651000 327744 4032 1 1 10 (none) 7 crypto_pool ..N 0x7f59e1b6f000-0x7f59e1b74000 19800 680 1 1 11 (none) 8 shm_odp_cos_tbl ..N 0x7f59e1a9a000-0x7f59e1a9f000 20480 0 1 1 12 (none) 9 shm_odp_pmr_tbl ..N 0x7f59e1a7e000-0x7f59e1a9a000 114688 0 1 1 13 (none) 10 shm_odp_cls_queue_grp_tbl ..N 0x7f59e1b6b000-0x7f59e1b6f000 16384 0 1 1 14 (none) 11 pool_ring_0 ..N 0x7f59bc7b8000-0x7f59bcbb9000 4194432 3968 1 1 15 (none) 12 ipsec_status_pool ..N 0x7f59e19be000-0x7f59e1a7e000 786432 0 1 1 16 (none) 13 ipsec_sa_table ..N 0x7f59e19bd000-0x7f59e19be000 2112 1984 1 1 17 (none) 14 test_shmem ..N 0x7f59e19bb000-0x7f59e19bd000 4120 4072 7 1 18 (none) TOTAL: 66113536 27392 (63MB) (0MB) Signed-off-by: Maxim Uvarov --- /** Email created from pull request 686 (muvarov:devel/master_shm_print_all) ** https://github.com/Linaro/odp/pull/686 ** Patch: https://github.com/Linaro/odp/pull/686.patch ** Base sha: 0a5d67beda902557056d5b5146d8cbe86e5001b0 ** Merge commit sha: 2c557397820d67b1fcb7c7283da5506a114da186 **/ platform/linux-generic/odp_ishm.c | 33 ++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/platform/linux-generic/odp_ishm.c b/platform/linux-generic/odp_ishm.c index fc2f948cc..59d1fe534 100644 --- a/platform/linux-generic/odp_ishm.c +++ b/platform/linux-generic/odp_ishm.c @@ -1730,6 +1730,8 @@ int _odp_ishm_status(const char *title) int nb_blocks = 0; int single_va_blocks = 0; int max_name_len = 0; + uint64_t lost_total = 0; /* statistics for total unused memory */ + uint64_t len_total = 0; /* statistics for total allocated memory */ odp_spinlock_lock(&ishm_tbl->lock); procsync(); @@ -1747,10 +1749,10 @@ int _odp_ishm_status(const char *title) max_name_len = str_len; } - ODP_PRINT("ishm blocks allocated at: %s\n", title); - - ODP_PRINT(" %-*s flag len user_len seq ref start fd" - " file\n", max_name_len, "name"); + ODP_PRINT("%s\n", title); + ODP_PRINT(" %-*s flag %-29s %-08s %-08s %-3s %-3s %-3s file\n", + max_name_len, "name", "range", "user_len", "unused", + "seq", "ref", "fd"); /* display block table: 1 line per entry +1 extra line if mapped here */ for (i = 0; i < ISHM_MAX_NB_BLOCKS; i++) { @@ -1780,23 +1782,36 @@ int _odp_ishm_status(const char *title) huge = '?'; } proc_index = procfind_block(i); - ODP_PRINT("%2i %-*s %s%c 0x%-08lx %-8lu %-3lu %-3lu", + lost_total += ishm_tbl->block[i].len - + ishm_tbl->block[i].user_len; + len_total += ishm_tbl->block[i].len; + ODP_PRINT("%2i %-*s %s%c 0x%-08lx-0x%08lx %-08ld %-08ld %-3lu %-3lu", i, max_name_len, ishm_tbl->block[i].name, flags, huge, - ishm_tbl->block[i].len, + ishm_proctable->entry[proc_index].start, + (uintptr_t)ishm_proctable->entry[proc_index].start + + ishm_tbl->block[i].len, ishm_tbl->block[i].user_len, + ishm_tbl->block[i].len - ishm_tbl->block[i].user_len, ishm_tbl->block[i].seq, ishm_tbl->block[i].refcnt); if (proc_index < 0) continue; - ODP_PRINT("%-08lx %-3d", - ishm_proctable->entry[proc_index].start, + ODP_PRINT(" %-3d", ishm_proctable->entry[proc_index].fd); - ODP_PRINT("%s\n", ishm_tbl->block[i].filename); + ODP_PRINT("%s\n", ishm_tbl->block[i].filename[0] ? + ishm_tbl->block[i].filename : "(none)"); } + ODP_PRINT("TOTAL: %58s%-08ld %2s%-08ld\n", + "", len_total, + "", lost_total); + ODP_PRINT("%65s(%dMB) %4s(%dMB)\n", + "", len_total / 1024 / 1024, + "", lost_total / 1024 / 1024); + /* display the virtual space allocations... : */ ODP_PRINT("\nishm virtual space:\n");