diff mbox series

[v3,2/9] app/procinfo: add compare for new options

Message ID 20181105175128.33297-2-vipin.varghese@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers show
Series [v3,1/9] app/procinfo: add usage for new debug | expand

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Varghese, Vipin Nov. 5, 2018, 5:51 p.m. UTC
Add code for new debug options to compare usage strings and set
enable flag.

Signed-off-by: Vipin Varghese <vipin.varghese@intel.com>
---

V3:
 - variables from debug to show - Vipin Varghese

V2:
 - compare string from dbg to show - Stephen Hemminger
---
 app/proc-info/main.c | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)
diff mbox series

Patch

diff --git a/app/proc-info/main.c b/app/proc-info/main.c
index 5779f07e7..76266d5cb 100644
--- a/app/proc-info/main.c
+++ b/app/proc-info/main.c
@@ -63,6 +63,18 @@  static uint32_t mem_info;
 /**< Enable displaying xstat name. */
 static uint32_t enable_xstats_name;
 static char *xstats_name;
+/**< Enable show port. */
+static uint32_t enable_shw_port;
+/**< Enable show tm. */
+static uint32_t enable_shw_tm;
+/**< Enable show crypto. */
+static uint32_t enable_shw_crypto;
+/**< Enable show ring. */
+static uint32_t enable_shw_ring;
+static char *ring_name;
+/**< Enable show mempool. */
+static uint32_t enable_shw_mempool;
+static char *mempool_name;
 
 /**< Enable xstats by ids. */
 #define MAX_NB_XSTATS_IDS 1024
@@ -247,6 +259,24 @@  proc_info_parse_args(int argc, char **argv)
 			else if (!strncmp(long_option[option_index].name, "xstats-reset",
 					MAX_LONG_OPT_SZ))
 				reset_xstats = 1;
+			else if (!strncmp(long_option[option_index].name,
+					"show-port", MAX_LONG_OPT_SZ))
+				enable_shw_port = 1;
+			else if (!strncmp(long_option[option_index].name,
+					"show-tm", MAX_LONG_OPT_SZ))
+				enable_shw_tm = 1;
+			else if (!strncmp(long_option[option_index].name,
+					"show-crypto", MAX_LONG_OPT_SZ))
+				enable_shw_crypto = 1;
+			else if (!strncmp(long_option[option_index].name,
+					"show-ring", MAX_LONG_OPT_SZ)) {
+				enable_shw_ring = 1;
+				ring_name = optarg;
+			} else if (!strncmp(long_option[option_index].name,
+					"show-mempool", MAX_LONG_OPT_SZ)) {
+				enable_shw_mempool = 1;
+				mempool_name = optarg;
+			}
 			break;
 		case 1:
 			/* Print xstat single value given by name*/