DPDK patches and discussions
 help / color / mirror / Atom feed
From: Anatoly Burakov <anatoly.burakov@intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH] test: add malloc stats dump command
Date: Fri, 22 Dec 2017 09:51:00 +0000	[thread overview]
Message-ID: <fd78c0b536cc0424ad3aacb0d888cef6efe8ebf0.1513867028.git.anatoly.burakov@intel.com> (raw)

This can be useful for checking if an autotest leaks memory after
its execution.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 test/test/commands.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/test/test/commands.c b/test/test/commands.c
index 4097a33..f49f7e8 100644
--- a/test/test/commands.c
+++ b/test/test/commands.c
@@ -62,6 +62,7 @@
 #include <rte_atomic.h>
 #include <rte_branch_prediction.h>
 #include <rte_ring.h>
+#include <rte_malloc.h>
 #include <rte_mempool.h>
 #include <rte_mbuf.h>
 #include <rte_devargs.h>
@@ -160,13 +161,20 @@ static void cmd_dump_parsed(void *parsed_result,
 		rte_eal_devargs_dump(stdout);
 	else if (!strcmp(res->dump, "dump_log_types"))
 		rte_log_dump(stdout);
+	else if (!strcmp(res->dump, "dump_malloc_stats"))
+		rte_malloc_dump_stats(stdout, NULL);
 }
 
 cmdline_parse_token_string_t cmd_dump_dump =
 	TOKEN_STRING_INITIALIZER(struct cmd_dump_result, dump,
-				 "dump_physmem#dump_memzone#"
-				 "dump_struct_sizes#dump_ring#dump_mempool#"
-				 "dump_devargs#dump_log_types");
+				 "dump_physmem#"
+				 "dump_memzone#"
+				 "dump_struct_sizes#"
+				 "dump_ring#"
+				 "dump_mempool#"
+				 "dump_malloc_stats#"
+				 "dump_devargs#"
+				 "dump_log_types");
 
 cmdline_parse_inst_t cmd_dump = {
 	.f = cmd_dump_parsed,  /* function to call */
-- 
2.7.4

             reply	other threads:[~2017-12-22  9:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-22  9:51 Anatoly Burakov [this message]
2018-01-17 23:20 ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fd78c0b536cc0424ad3aacb0d888cef6efe8ebf0.1513867028.git.anatoly.burakov@intel.com \
    --to=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).