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 F3932A0544; Fri, 23 Sep 2022 13:46:34 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D9A7F4003F; Fri, 23 Sep 2022 13:46:34 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id 5F0794003C for ; Fri, 23 Sep 2022 13:46:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663933592; x=1695469592; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=VzVn8fjbPYjnyhIr8goTQuMjg7Sepkh8+dXgexDkciI=; b=jqcr8+iOiEliM4gFiYAdPccfXi3smPruKZ6JJZtTR9O7wpO2pKUsiK5g dIUoWT9ocHKmgOQTumLcdMVcddLPj61ODR78Vi+XCjm7eOLnbFRRVVHun /xGuZzn7C1srwJ88N52+2wZYuUPkeBLn8SdBU+Tn8H+9IqjDnEj5s5ywZ A9uhJFnl0MANMJhPp4fZeBtzNeh5drqbacr6gs99xpSuocvac+GzyQQ3i k/QhrskES3qb9el5agSn1+BfbT7ncGPtdso0rEvcN/dNyk8FZSm9UEiZk p8qi/cdsBUJkKvnySIt0D4/ZvvsrDBEzpuFiMfc0H4D1EyfPrIhDRQnHw g==; X-IronPort-AV: E=McAfee;i="6500,9779,10478"; a="300558077" X-IronPort-AV: E=Sophos;i="5.93,339,1654585200"; d="scan'208";a="300558077" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Sep 2022 04:46:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,339,1654585200"; d="scan'208";a="571350168" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by orsmga003.jf.intel.com with ESMTP; 23 Sep 2022 04:46:18 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 23 Sep 2022 04:46:18 -0700 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 23 Sep 2022 04:46:17 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx603.amr.corp.intel.com (10.18.126.83) 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, 23 Sep 2022 04:46:17 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.171) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.31; Fri, 23 Sep 2022 04:46:17 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nZyyWLVB4CbKHZmBwgZ3vr/96NhVCr3KMQPQo9bnm1C7XWKyJJ2QiYpcb1+5KZrw3kErFv9g6fSlr6ydyLCIvwXhmGCbrfTlVYposVU8h0zORkd41Mj11XrWu2AiIP1sEddyEbMd6IrQhLBExXpYe3hxiPLToMfVg+aSEYnR7YWvjetd13xN01OnKLJ3HWqS7nuasjiLpW7yRi7XmZ6lTOqYnno8uy1yHvd+GZaUlSswy31ty4RoeR7Li/L6BObUM3CgP5xy1wr6iHcCGp5gV7ij44wGLQAkABG9fQF2qwT+8P2FrP05WWXPZJok8yvnz/PpBH00z0d0PKIpXiW+2A== 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=Wh272uztpt08pE6IgNWtiyxqOrAlirpN4GIfPq7GXn0=; b=ZbnOYNGEESaC/q8hY/Az/pY8J4tt68uU/m87ywF32FWaxQW83cOuP2vGGn/xB3FbMkGsOtVUftiDeBaZYh8MJ2Ru1psnMJkNea3wgCnb8s4jQll2rM5Gqmss/nysAwMP2DjfeKnHZnF9SvIEdlj2SRIMqsJIdFheXuISggyd5zc30EabYoK9WwasMjbRC9YRdBcmVY36TL/EwyJb40Bq//GpVxfUawaSPKZdw9Q9o+HYdpV1magkBUH6nYxv/qvKVgIwtCFiT1yCtW4dxacP3NdAP6zZenAFDRfrRSTGW7a6Wntb+HNJ1vPEf32MQnZmhiwoKsX8my9LH+a9sTFewg== 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 DM4PR11MB5344.namprd11.prod.outlook.com (2603:10b6:5:393::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.20; Fri, 23 Sep 2022 11:46:15 +0000 Received: from DM6PR11MB3737.namprd11.prod.outlook.com ([fe80::c842:61dd:4c73:d3b]) by DM6PR11MB3737.namprd11.prod.outlook.com ([fe80::c842:61dd:4c73:d3b%4]) with mapi id 15.20.5654.020; Fri, 23 Sep 2022 11:46:15 +0000 From: "Kaur, Arshdeep" To: "Kaur, Arshdeep" , Stephen Hemminger , "dev@dpdk.org" CC: "Chintalapalle, Balaji" , "Beadle, Michael" Subject: RE: [RFT] dumpcap: add file-prefix option Thread-Topic: [RFT] dumpcap: add file-prefix option Thread-Index: AQHYxtplRdC30afRDUi3/7aVSZuaU63hu5eggAs6vxA= Date: Fri, 23 Sep 2022 11:46:15 +0000 Message-ID: References: <20220912124309.233363-1-arshdeep.kaur@intel.com> <20220912190330.73159-1-stephen@networkplumber.org> In-Reply-To: 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_|DM4PR11MB5344:EE_ x-ms-office365-filtering-correlation-id: ee40f59c-35ff-4edb-aad1-08da9d593886 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: /oVytD6UncoCGHNhoHLu7AkBOybj1bBMG8oo7jPlI9BDvnaECvfeTRdz9r2g7Q06oIP93P8B99GiN27sjJAwYEsdb/KjFAzXd0JYBu3zTVLB3rtmO8sgyQzXR+hzsA1/3GCXuzm760pKFM5NN7sD60LwF5DwhZ9v+dBGBQsQLjpClPrgfjoZdNd7HmgBDa3rAM7Ku+kBg6UGCp24cZenEzafV6dZOkdCDdpnH6Rcvh9H/RJ5yzrHOVMeaRBC5AHkycGiseMI1Mfa0n6tn6d+x3zdNuIkZRYWpqvLZ7Y+RpgMNuEOfWeSGCrfOGgk0K5N1ZC2grt5zD22EQ71xt5/t0ibDWAnCxo3VOSu2wkhVFNEaRdWQamjLUZk/0XDmkDte9rspyKtLCXaxYsDOCEVYaR1THbrtg69YplWCgJXeBKwtJrnbj2Ouk7iTSNJr4m0rNwFIqBOPJhK+au7h6bLQeENZAWg3NJpoPOeExUMBGuFdRjzqH/Yq5IPkRAqpViiNhf0y1a3QBJtCPh1Ylxqo0EftNxzlVTRoM/EQ84WJGdgzxzId+THj5L3C4IFui//MyvcYhYwxPCSCPBqThC9WOvs3wsxwL6zM/vaUiPAoYw7iY5O/D4xKOYVPeLjC5mFoJSN/tFvniWq+w2L//EgWMTqgsYpckZk0uho1RfM4uvlAuGYcYTeeZsy3ZAIXcm3cvjQuBdT4o5dAuDQnZS7fMjJhB4PGA+CsofBp+PXOJAzdR++QBeZ4WBAoyLv2U7CMVzHdgEI1U0MNlDbYxcUag== 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)(39860400002)(396003)(136003)(366004)(376002)(451199015)(71200400001)(8936002)(82960400001)(83380400001)(186003)(86362001)(9686003)(26005)(2906002)(55236004)(53546011)(41300700001)(6506007)(38100700002)(122000001)(107886003)(7696005)(478600001)(52536014)(33656002)(5660300002)(8676002)(54906003)(110136005)(38070700005)(66946007)(64756008)(76116006)(66446008)(66476007)(4326008)(66556008)(55016003)(316002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?pgkOxA3a7UosY1B/nprc4DyEiLrutzmy217/gUtpNmVLkQHt1AvDdnTuP+v4?= =?us-ascii?Q?g3zer76BteyCv1mXY2m4lu4ShKVP7sOsrg2u/QGFQJVZbvcbNctDAVt2Qmys?= =?us-ascii?Q?9s3Qg/LYqawQgXhnVMsd/lZ3UZawh1XEIdhZ4hRSlz2ojYPYBtIlc9eDw445?= =?us-ascii?Q?07PkFcuy0JHr3sNpL9hSFvmn0JuyiOzao5+hfnizLm+59TBaARPiVNmR8hsF?= =?us-ascii?Q?RGteLkc3vwdJKGqejjRP6GKNlWMZrv/oBPlqOhvry/DTD50tc6+BpvD8e4wz?= =?us-ascii?Q?SZgOQjtacjl8p31L9VfRPhmQmL8qZbVO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Q?3SHbco28eXy148vqkVEo3NQPeoKsDRRPWoZcomOfDxJf2gVS54javuQeB87C?= =?us-ascii?Q?d8myffpvRE/ZWLHn0ng5pb2W/V5CqLt7566Rd+dAoJSgMiDXCL3oEEw7XQwj?= =?us-ascii?Q?YRN7+r3KVS/dker03rlqCacB2pRfcGqBJ3nKRZaQXhcRA2B9ifokRzmOwi24?= =?us-ascii?Q?pa8aFaFRS6cdr9fXFZfilPY2sUt4XiUSFYfndTKPz9Ojb9cXmBzdgWyCAe4o?= =?us-ascii?Q?yqp/vCaFcu7ReEvyUeAHEOq63Sc9HNt0fmDY2NAO0cCMb3ZnVJRbml+mdMzW?= =?us-ascii?Q?nLStwRNS2Upq4ux13gVJNFR5jWsUJNDP4lxskY+En7ihlB7fh2Ypakgq1c0u?= =?us-ascii?Q?OwXCql9vC841O1osW10/gJD3sEWvlgte4RWLhXMp?= 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: ee40f59c-35ff-4edb-aad1-08da9d593886 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Sep 2022 11:46:15.1721 (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: tpYPwKCHhho1G1DHfEo4si+ZHjrRvefKDHKb33odehgFs7MxQGByFf4/TMSrNnqcyJGOeup2ICeoBdd7vB6ljA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR11MB5344 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 ++ Balaji and Mike. > -----Original Message----- > From: Kaur, Arshdeep > Sent: Friday, September 16, 2022 1:49 PM > To: Stephen Hemminger ; dev@dpdk.org > Subject: RE: [RFT] dumpcap: add file-prefix option >=20 >=20 >=20 > > -----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 > > > > When using dumpcap in container environment or with multiple DPDK > > processes, it is useful to be able to specify file prefix. > > > > This version only accepts the long format option used by other > commands. > > If no prefix is specified then the default is used. > > > > 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). > > > > app/dumpcap/main.c | 24 ++++++++++++++++++------ > > 1 file changed, 18 insertions(+), 6 deletions(-) > > > > 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 cha= r > > *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 outpu= t 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) > > > > 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); > > } >=20 > parse_opts() is called after dpdk_init(). So whatever file-prefix we prov= ide, > for eal init, it remains NULL. > Please let me know your thoughts about it. >=20 > > @@ -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; > > > > + 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]); > > > > + 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"); > > > > -- > > 2.35.1