From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id DF9FEA0032; Fri, 16 Sep 2022 10:19:08 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 78ACB4021D; Fri, 16 Sep 2022 10:19:08 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 6158240156 for ; Fri, 16 Sep 2022 10:19:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663316346; x=1694852346; h=from:to:subject:date:message-id:references:in-reply-to: content-transfer-encoding:mime-version; bh=6mTDyGX5J/z0zPrLNS+LGcUreLwVM+7Cb5sojxf1dKE=; b=M5q0Clff83dpWkzAY51JEj64DIbqRQebQZwNqcJwW/WHQYZYRmCOIc/n 6JmkxWZBXSdAd+a2/1XAXbWUAe/K4xEuVKfekNGpSzZhL4uP8nilw/p0U hg2dboiNiTQsws5kr2L5on1vHi+8N/EUfmfqT73heKrEqaxDyLeNFoLtn fNyruQIqHkgtw4DsLA5jGizjFSl5WSMroNS16hiEeYnzE+yR29weXBW17 op88mYOTGcOTfBqh0o4MEpY1avoTKv2E/M+IJ2SHJ/fMFf6X/y6Po1rv4 Wzln9T+btfcZuaD6jkyw41jJK5WFRII3DU0TdCQDcXhQbV02AEz/P3YHT Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10471"; a="296530507" X-IronPort-AV: E=Sophos;i="5.93,320,1654585200"; d="scan'208";a="296530507" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Sep 2022 01:19:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,320,1654585200"; d="scan'208";a="617591857" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orsmga002.jf.intel.com with ESMTP; 16 Sep 2022 01:19:05 -0700 Received: from orsmsx607.amr.corp.intel.com (10.22.229.20) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 16 Sep 2022 01:19:04 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx607.amr.corp.intel.com (10.22.229.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31 via Frontend Transport; Fri, 16 Sep 2022 01:19:04 -0700 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (104.47.74.43) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.31; Fri, 16 Sep 2022 01:19:04 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Dxpu9rV0ZkRXh9kq3qK5/S7x+nWq1e+WnGd+ZIx0ZKaXEOsj3r7j1ZoeM2J8To0Mj+dbjKcytYTdLyAjbvpRUFS0u1mHvJO23gw6ylLBT78cw5nluZ1ST/BGAXSdptIiifS5q7j+nAGyGiGSotpaFAwlCMcQcuqNooQvGd7t7t8RioqCNe9SWEZQ4Vvp4leSd/4fGyopfdCBOFp44jqt/qkpJAvinGi/Iq9UafI3hyWWyVyHV3XYub11T97Yz00WMps0NPY7sCP8aSc2ziLFOO0u6Qi/7RmiTf1UmLq9hevECf6swYe3P5gs5PLbAy4HHjPnXG6En4QIAgQREm89OQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=88gkRzy5fXYAVtE+ISGzlINdDM92qx0JVBHuyxRiaGY=; b=C3WGzd0T6W0DERUtpvxJu5+I77M5VEpW0wnFFHhuLiXImRhPbQp8vrA2mXZHkm6o+dM4QEWYAWCeeqm3coH3WBKrbdTdof/Q20YogiG9GZw0daZ1qLV1sefB+nNy8F/v/Yl8ao+GpjSQWwGIkyrbYxbBoEA7ZuuqIAQd/n0ZKwKRB+s99auOSKrfabJfPxp6D4d8CT0WbKkGGQ+iV43nkP5rWcHr5GirDMqXdO/ljzqoTczP9lTJNm04aOqLdzA3vLWOUmbjRDuvz+Z0jBHWK9KZCpbnYEXrmhJsfCLlJNYe7+Mus7ItNCcNTMzfoYj5qikV5GtkvACi6MyMD4eBHg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from DM6PR11MB3737.namprd11.prod.outlook.com (2603:10b6:5:144::28) by DM4PR11MB6309.namprd11.prod.outlook.com (2603:10b6:8:a8::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.22; Fri, 16 Sep 2022 08:19:02 +0000 Received: from DM6PR11MB3737.namprd11.prod.outlook.com ([fe80::2d92:7e15:6dd9:69f]) by DM6PR11MB3737.namprd11.prod.outlook.com ([fe80::2d92:7e15:6dd9:69f%6]) with mapi id 15.20.5632.016; Fri, 16 Sep 2022 08:19:02 +0000 From: "Kaur, Arshdeep" To: Stephen Hemminger , "dev@dpdk.org" Subject: RE: [RFT] dumpcap: add file-prefix option Thread-Topic: [RFT] dumpcap: add file-prefix option Thread-Index: AQHYxtplRdC30afRDUi3/7aVSZuaU63hu5eg Date: Fri, 16 Sep 2022 08:19:02 +0000 Message-ID: References: <20220912124309.233363-1-arshdeep.kaur@intel.com> <20220912190330.73159-1-stephen@networkplumber.org> In-Reply-To: <20220912190330.73159-1-stephen@networkplumber.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.6.500.17 dlp-reaction: no-action authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DM6PR11MB3737:EE_|DM4PR11MB6309:EE_ x-ms-office365-filtering-correlation-id: 29e5df85-5553-45ee-79e0-08da97bc1d43 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: m8jNH7EyULJPfTLY1rs5LhHWItMnNAU6aVMejAlCvU0H9hdSzOF9co8gY6lKSPRxrNFlACW/rhVPXLtazHt8qweoEQK0XFg+mxY5M4ZjHJBng+0XrHRhIs/HjLQ47EkK0QcNZRjUlJvDwXV0SnFo1ZhvfKRaSQb5VUo2CsFNoIHk2YbJ09Jyoj5IVfvmGD9PZnP6j3mhWM+sTpQ6CV+HXUwpA8wgQPTCmnBjt0AmfPlJ0brNdy3PPVt5ed9y9RNCXjnmEQz/FUuGcHc2jBBUtv6lQ0MhAN2xl6uWEDaMZU1X9v4cBMd2OfI+rV4DSG9bi9amQLbeN4ocdDQTKGzSPdhUTIs+UpEuDAUaov3E+KOk3qWuj7dsnvX3QXe4tyRRtdZ6t4C8shirc+fImK7dAxxfHpm1belRHCnm2o2rWSMJ4lZVR6HJE595ih0vGyxM9dJIjxXRGTLpbHoimtdsHCotYzwrNhxYj7pOZs4GQTd+4eb5/pNs28xlUt4Z9sXMHmaaQ+0F00iiiN3rdZnEAen1l3DvKGSXXq7PT6QSANxr28EZvsNps2dXkzX8ieetMebswdaWkUnp5TalDbuJEHAlHVfklpjlavzoG8Rm9WpMffflyYQYKUw3RgXMwIic4ET4kA6SYyCafXprXSn22NQN7uSHhz5iZN7J5NTFo7X41T6TVuPX0aDGkJKjzVbRGuIg5KJgoAmeQ95tsO2adR9f9RAirnUDWxxdaOu+a28goxTIbC9ClGDesoIgP05L6rRKzrgEFGl7qaGy2PDarg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR11MB3737.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(346002)(396003)(366004)(39860400002)(376002)(136003)(451199015)(6506007)(316002)(41300700001)(55016003)(66476007)(53546011)(71200400001)(76116006)(66446008)(9686003)(38070700005)(8936002)(7696005)(186003)(55236004)(66556008)(478600001)(66946007)(2906002)(110136005)(52536014)(5660300002)(122000001)(33656002)(86362001)(26005)(83380400001)(82960400001)(8676002)(64756008)(38100700002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?UfjloGzNJYpBCBENKzalHLrXDpQxihyZvrtmJ8ceNy8/fGSnCDpst9FvlpQL?= =?us-ascii?Q?ES4izXZTmAzk82ykPKYcmuUBuHDb2jOaDYgfbzMg38cZhb65hbMPu7/X2igB?= =?us-ascii?Q?+DFDBRzTl5cq7MWdYs7IFxJIN421jdvIM4TxFdkaXavwMs6IlDVeXWBttao7?= =?us-ascii?Q?w9gc3GZZolGidWETpi254kM8s2QsmAWzywS+uTlamNLPIoRlntksu1ctUfOW?= =?us-ascii?Q?NUSJSTxkaaPOU8NuhcNZlehZifqy0FoaYfug5PlMDSnQMIFuHj5e+2lpuejc?= =?us-ascii?Q?Pm/3/qA+mbkqBIZSNlw7y5/j3H1BoZ47mBYiEbNbhldk35y2+RKyzvppsKnu?= =?us-ascii?Q?+jFsobzqa3OdRG1QH/SV3B2+yRkkK20TxmmrEapn07mcFUki9xldD0KqCrTT?= =?us-ascii?Q?vuDNDJpV3bxfQI3wHBQUIIFi2nRpJs7KH0deRyt/l9gqJTseN/CniFgb7Oxx?= =?us-ascii?Q?lDrq6m+RAb1mMFsZ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hw4P5StUClJy?= =?us-ascii?Q?mJbGwe4O3WB9rtzjwqDrle9GN6WNl3fxR0VeUcJ2R0xguXBT29AyKgneO0Xp?= =?us-ascii?Q?SnmV43ijr8gxXji1Z/w1tTl5VpKpvgs3ZdaPYWOfozAKmmskurWIagfvvQDR?= =?us-ascii?Q?btvNOj2tbQquBs4L+m2RfJuY/M+ZTRe2OUHFiI26EaBjXVG9UURbuDOu/omx?= =?us-ascii?Q?KXnzcMTEup9WZH3zxLF2DxtuyCe00jIFmudyMNVN?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB3737.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 29e5df85-5553-45ee-79e0-08da97bc1d43 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Sep 2022 08:19:02.6641 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: hQ5vuwXI3pF9qHi6kfqWiqnfIUsRDjqYeyKj4WBMCBZNBuZfhezGh8MlxH9clcVfGQI6QkQ2ernAQPMQb1abFg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR11MB6309 X-OriginatorOrg: intel.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org > -----Original Message----- > From: Stephen Hemminger > Sent: Tuesday, September 13, 2022 12:34 AM > To: dev@dpdk.org > Cc: Stephen Hemminger ; Kaur, Arshdeep > > Subject: [RFT] dumpcap: add file-prefix option >=20 > When using dumpcap in container environment or with multiple DPDK > processes, it is useful to be able to specify file prefix. >=20 > This version only accepts the long format option used by other commands. > If no prefix is specified then the default is used. >=20 > Suggested-by: Arshdeep Kaur > Signed-off-by: Stephen Hemminger > --- > Did basic command line test, but still needs testing with a prefix being = used > (ie multiple apps). >=20 > app/dumpcap/main.c | 24 ++++++++++++++++++------ > 1 file changed, 18 insertions(+), 6 deletions(-) >=20 > diff --git a/app/dumpcap/main.c b/app/dumpcap/main.c index > a6041d4ff495..bdeef96d9c0b 100644 > --- a/app/dumpcap/main.c > +++ b/app/dumpcap/main.c > @@ -61,6 +61,7 @@ static char *output_name; static const char > *filter_str; static unsigned int ring_size =3D 2048; static const char > *capture_comment; > +static const char *file_prefix; > static uint32_t snaplen =3D RTE_MBUF_DEFAULT_BUF_SIZE; static bool > dump_bpf; static struct { @@ -122,6 +123,7 @@ static void usage(void) > " add a capture comment to the output = file\n" > "\n" > "Miscellaneous:\n" > + " --file-prefix=3D prefix to use for multi-process\n" > " -q don't report packet capture counts\n= " > " -v, --version print version information and exit\n= " > " -h, --help display this help and exit\n" > @@ -310,6 +312,7 @@ static void parse_opts(int argc, char **argv) > static const struct option long_options[] =3D { > { "autostop", required_argument, NULL, 'a' }, > { "capture-comment", required_argument, NULL, 0 }, > + { "file-prefix", required_argument, NULL, 0 }, > { "help", no_argument, NULL, 'h' }, > { "interface", required_argument, NULL, 'i' }, > { "list-interfaces", no_argument, NULL, 'D' }, > @@ -330,11 +333,13 @@ static void parse_opts(int argc, char **argv) >=20 > switch (c) { > case 0: > - switch (option_index) { > - case 0: > + if (!strcmp(long_options[option_index].name, > + "capture-comment")) { > capture_comment =3D optarg; > - break; > - default: > + } else if (!strcmp(long_options[option_index].name, > + "file-prefix")) { > + file_prefix =3D optarg; > + } else { > usage(); > exit(1); > } parse_opts() is called after dpdk_init(). So whatever file-prefix we provid= e, for eal init, it remains NULL. Please let me know your thoughts about it. > @@ -512,12 +517,14 @@ static void dpdk_init(void) > static const char * const args[] =3D { > "dumpcap", "--proc-type", "secondary", > "--log-level", "notice" > - > }; > - const int eal_argc =3D RTE_DIM(args); > + int eal_argc =3D RTE_DIM(args); > char **eal_argv; > unsigned int i; >=20 > + if (file_prefix !=3D NULL) > + eal_argc +=3D 2; > + > /* DPDK API requires mutable versions of command line arguments. > */ > eal_argv =3D calloc(eal_argc + 1, sizeof(char *)); > if (eal_argv =3D=3D NULL) > @@ -527,6 +534,11 @@ static void dpdk_init(void) > for (i =3D 1; i < RTE_DIM(args); i++) > eal_argv[i] =3D strdup(args[i]); >=20 > + if (file_prefix !=3D NULL) { > + eal_argv[i++] =3D strdup("--file-prefix"); > + eal_argv[i++] =3D strdup(file_prefix); > + } > + > if (rte_eal_init(eal_argc, eal_argv) < 0) > rte_exit(EXIT_FAILURE, "EAL init failed: is primary process > running?\n"); >=20 > -- > 2.35.1