From patchwork Tue Nov 6 12:49:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Varghese, Vipin" X-Patchwork-Id: 47890 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 286E8493D; Tue, 6 Nov 2018 13:53:00 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 16426493D for ; Tue, 6 Nov 2018 13:52:57 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Nov 2018 04:52:57 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,471,1534834800"; d="scan'208";a="105696481" Received: from unknown (HELO saesrv02-S2600CWR.intel.com) ([10.224.122.203]) by fmsmga001.fm.intel.com with ESMTP; 06 Nov 2018 04:52:54 -0800 From: Vipin Varghese To: dev@dpdk.org, thomas@monjalon.net, reshma.pattan@intel.com, stephen@networkplumber.org, john.mcnamara@intel.com Cc: stephen1.byrne@intel.com, michael.j.glynn@intel.com, amol.patel@intel.com, Vipin Varghese Date: Tue, 6 Nov 2018 18:19:05 +0530 Message-Id: <20181106124912.40700-2-vipin.varghese@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181106124912.40700-1-vipin.varghese@intel.com> References: <20181106124912.40700-1-vipin.varghese@intel.com> Subject: [dpdk-dev] [PATCH v4 2/9] app/procinfo: add compare for new options X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Add code for new debug options to compare usage strings and set enable flag. Signed-off-by: Vipin Varghese --- 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 --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*/