devargs: add dump command in test application
authorOlivier Matz <olivier.matz@6wind.com>
Fri, 28 Feb 2014 17:25:43 +0000 (18:25 +0100)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Thu, 10 Apr 2014 13:50:34 +0000 (15:50 +0200)
This is useful for debug purposes. Example:

echo 100 > /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages
echo 100 > /sys/devices/system/node/node1/hugepages/hugepages-2048kB/nr_hugepages
./app/test -c 0x15 -n 3 -m 64 \
  --use-dev="eth_ring0" --use-device="eth_ring1" --use-device="02:00.0"
RTE>>dump_devargs
User device white list:
  VIRTUAL eth_ring0
  VIRTUAL eth_ring1
  PCI whitelist 0000:02:00.0

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
app/test/commands.c

index 7595b4c..b145036 100644 (file)
@@ -65,6 +65,7 @@
 #include <rte_ring.h>
 #include <rte_mempool.h>
 #include <rte_mbuf.h>
+#include <rte_devargs.h>
 
 #include <cmdline_rdline.h>
 #include <cmdline_parse.h>
@@ -285,12 +286,15 @@ static void cmd_dump_parsed(void *parsed_result,
                rte_ring_list_dump();
        else if (!strcmp(res->dump, "dump_mempool"))
                rte_mempool_list_dump();
+       else if (!strcmp(res->dump, "dump_devargs"))
+               rte_eal_devargs_dump();
 }
 
 cmdline_parse_token_string_t cmd_dump_dump =
        TOKEN_STRING_INITIALIZER(struct cmd_dump_result, dump,
                                 "dump_physmem#dump_memzone#dump_log_history#"
-                                "dump_struct_sizes#dump_ring#dump_mempool");
+                                "dump_struct_sizes#dump_ring#dump_mempool#"
+                                "dump_devargs");
 
 cmdline_parse_inst_t cmd_dump = {
        .f = cmd_dump_parsed,  /* function to call */