devargs: add dump command in test application

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>
This commit is contained in:
Olivier Matz 2014-02-28 18:25:43 +01:00 committed by Thomas Monjalon
parent 8e245de6ca
commit 0ae134b335

View 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 */