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 A5E4F423AE; Wed, 11 Jan 2023 15:24:40 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9C0DF42D22; Wed, 11 Jan 2023 15:24:40 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 179DC40A7D for ; Wed, 11 Jan 2023 15:24:37 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 30B9aFc4016470; Wed, 11 Jan 2023 06:24:34 -0800 Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2173.outbound.protection.outlook.com [104.47.55.173]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3n1k56tgtk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 11 Jan 2023 06:24:34 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i9yGeqRsAFy7G2SfRJQeyoPqfBYiMd/P3kOvMVXz+0mwoQI0yE3tGj2jccgWasjG1kYybv0awGhs4ehb03Igxk2fSROg4j6QTevio7zovFvSS+onD3seQXrdAQg2sNRJB4kNaJt7TWIlw3BKbRfv4BOOja2nYmIfYo3eb0c5Br1eJZmwU6IjDCFnDIv2IbCHJ7hkxy36iaQOpeEsmv20a15zzQJFqke++uhhmeprX6HaiRcVZtmF1OzmvbjNRfavqm6oySySGKuxRf/2OHzxqHtiuAy9S6W68jNq0hMcaGa1ouSAJJjzD8NZuPDLVLvBEJ3nsv+9qL6Y6xxTvEjezA== 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=7g4IIN8VqFWxHjspK2kT0VpHUdvvUyKKH/hZCWg43pg=; b=Xde/8wlgzl56m8V6knJkUOF5qdlDuTzwJ//02TErAYLpIiYo2yA+krfoxmZAQtwN8PzgxfDlOeBzGXPlqIngam1M75a/jKq8mQFmVxmanotmRAyHAsCNy9z3J1catz44fWRZ0WmxQT80O38Pycj/WdSx6kvLS/yh8IrzpaNhAzp4uG1x0Ij91aMfnui6zNspRQXMN7E6VI17IFBC0f7sjS+KdFsnj/xKAeWhBbJUkSIW/RFCq3CkbVIxcUucE4aNYG7LUhH0uj2jTnWwtOtVpqHKiOIY3MeMHyhadd13m/hQMVCA24KkUbt8wQ4/WExKgJ4p8xxJTBvKkyH9GWSHQA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector1-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7g4IIN8VqFWxHjspK2kT0VpHUdvvUyKKH/hZCWg43pg=; b=QTtns2gLkcfhZEmHCWbQBi2Q7G/jlhrZsGlgq8hGWmB/GW5flnDA70yiPcepPtHRRHe/ZCpV5nUpXG6pJObevkn0Zi6GUptRPkPjLDr9E2zAC8KjnBe+7yJyVunT9cUlxb/tZ6ypHtFD9q9lVJoqi+z1xxvnxbnU5WZpvDBufk4= Received: from DM4PR18MB4368.namprd18.prod.outlook.com (2603:10b6:5:39d::6) by MN2PR18MB3590.namprd18.prod.outlook.com (2603:10b6:208:26a::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18; Wed, 11 Jan 2023 14:24:28 +0000 Received: from DM4PR18MB4368.namprd18.prod.outlook.com ([fe80::3117:f51c:37c2:fa05]) by DM4PR18MB4368.namprd18.prod.outlook.com ([fe80::3117:f51c:37c2:fa05%9]) with mapi id 15.20.6002.013; Wed, 11 Jan 2023 14:24:28 +0000 From: Tomasz Duszynski To: =?iso-8859-1?Q?Morten_Br=F8rup?= , Tyler Retzlaff , "bruce.richardson@intel.com" CC: "dev@dpdk.org" , "thomas@monjalon.net" , Jerin Jacob Kollanukkaran , "Ruifeng.Wang@arm.com" , "mattias.ronnblom@ericsson.com" , "zhoumin@loongson.cn" Subject: RE: [PATCH v5 0/4] add support for self monitoring Thread-Topic: [PATCH v5 0/4] add support for self monitoring Thread-Index: AQHZJZ9zalLCQ0cR8Eymiq8ETSiMAq6ZPO7Q Date: Wed, 11 Jan 2023 14:24:28 +0000 Message-ID: References: <20221213104350.3218167-1-tduszynski@marvell.com> <20230110234642.1188550-1-tduszynski@marvell.com> <20230111003222.GA24460@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> <98CBD80474FA8B44BF855DF32C47DC35D8764E@smartserver.smartshare.dk> In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35D8764E@smartserver.smartshare.dk> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DM4PR18MB4368:EE_|MN2PR18MB3590:EE_ x-ms-office365-filtering-correlation-id: 296f0280-d7c1-4454-e0f6-08daf3df8c40 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: WIdc9GbYvTfwAOHvbLQVO1MA2BCKRbNif7kGJ9qW0bUVbwWOjbiWzdI3YQHSQTnlk9gXpGyoezfq+aI4oXFo4+FT03YYly1z9oeKc6IZkwK9OpUoJp/sUDLsKxcBJUjjOum9s2BajbVQ6bUcbt9XKfHIXX502frRrgGPmU0/SfHKTwjd/lHWwpeFKpmTV1BFfMyZhnVrQjJHU1pyR91mX2tbFlngh2K8AKTaSyochlJPPXFmHMKIjON8BZX1FiHGOnHfrjWndIzzp8xffSC8qKwQv1wTvelCqimocq+mj+qIYwyGtKPtAQMzeXDjNBTzRAkgEk9LyJwcHU/WSrUUeUu/w8Q66jdKhwlh3pKEd2hVRwkDA9gJLOb+/UhsP+7itjzfhRR78ygQYrlnRvJ3APpvqotoCcB5grvm6l+eLdnOsJa47QP07xeX3RqrYD1UCiCkI/JuIdPvghqty0yYK+mycZBL2O+r+Ksr6rhpufezbphSgeUg3zRLC2ZB/0vXzU4v1JLB70T0e2+6H2+l8nQnJMEi1z6VhaEWTCHgrThCdgGJejXz4sccoxGnTkb+8cPhdR84LL6mYtmNNTtHmINNeLxMValjLRtKVwT+4ymK5c/ZNfA53mepjaA3UjepVAPsz1g1vlP7gWk4+xs2ySg40tc4AhbgLnZ3GRVvpGU50VRq5Da1ufriEcbor/nRWyxv4zFuzVzXZaSzEi1Wms4U3WZeVUZle3wtZFrXAYw= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR18MB4368.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(4636009)(346002)(396003)(366004)(376002)(136003)(39860400002)(451199015)(6506007)(478600001)(122000001)(38100700002)(2906002)(966005)(33656002)(9686003)(26005)(71200400001)(186003)(5660300002)(316002)(7696005)(8936002)(55016003)(86362001)(83380400001)(38070700005)(52536014)(66574015)(45080400002)(66476007)(64756008)(8676002)(41300700001)(76116006)(66446008)(4326008)(66946007)(110136005)(54906003)(66556008); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?wcXTgk1WsvU3lWIpYnSHTp9ZIObK3++ftIr2YEpjk5whrVjREWABy5G1uq?= =?iso-8859-1?Q?7KxgMIa3KxKQB/vjRDZxw/4Ltl1mgL0Iejh5xZfh7ItgETyDt21uREa7qf?= =?iso-8859-1?Q?v1LdFQC48+i1zheg7zf2wKlo6dy+9kfNofE72JE7bb6+lPdtNaaHJ6c4p2?= =?iso-8859-1?Q?WlhvU5PeQDDqIF5oQ24oD2ImJNRlL0CpYew2KNfco1g2vwuG32vZNQoArY?= =?iso-8859-1?Q?yJ2jnSGRo9GeO3nYmB+B7Gq9CDM46eEwosdnZYBNiAw8Bm9iCyMIrp9nD1?= =?iso-8859-1?Q?bU5BToIVfBatGyOphot+KyGMZ4XELZZ4z68YqEcICvjt4/u/ThuDTvOPxB?= =?iso-8859-1?Q?W97ay5WHJXA4QTpVIgc+ktXG7ssVCoToq9xMMeSAZyaABIAq7pZI+sBQFM?= =?iso-8859-1?Q?jIRHnCqfQkMeFL2QFb+He6UQnrQY8FtjrbOz3954iHhqenlN2uZhHsUfdy?= =?iso-8859-1?Q?U5usJZ78e6gElqp6osgaqqrLiJA/4cMCrBvL7/kUdWxq7seG794D+QHCXQ?= =?iso-8859-1?Q?8yEUB3HqyepcO7c0hV4CaBQzNqr8KvjEbP3gb08AU/ckEiLX46MYlg5f8f?= =?iso-8859-1?Q?7Of88GcfLyHZQmKwCtLN9KdKbCe8834FekUDaeZyI5nVqhfxfqvX+rvoP0?= =?iso-8859-1?Q?DATdCvHlW6bjZTg5+ZpTHbGHLV513CvSsrWiLr40sc7PyGxMtL/bEB0i2T?= =?iso-8859-1?Q?9GEthpifwXEsa7t104kaOI5TQ4xcKGN1N21UfqUzmJs9FC8wMjLZjENjqd?= =?iso-8859-1?Q?eSLtnlOaFf2ieajXBnLZZevw+tllbDvbshb5EbEUczTOkUSkye08R14RRD?= =?iso-8859-1?Q?KGrR3IKOXpDnd50VzjEbQv3y73knRJnODa2555IMimiTkGXx0W0Wq9415j?= =?iso-8859-1?Q?zdTXNe+a8DQgHbaHJTJFTz8GmAKitxwCHEY3V8I2UpeaDc1+R5eotSS/98?= =?iso-8859-1?Q?yJWOsDK2gi5lxMiuBAhGkf3C2NwvjuPTrAtx3vdQsHdF+YvUxpLI18hnIo?= =?iso-8859-1?Q?8xb7ZO8PSySJqUlJug/lmiH9egpCR3HpmTFGSPr56SrXMNg2NlEdyUFt8t?= =?iso-8859-1?Q?PuF45Vb0BaP14l/XiOsB/XLxw5J0MXGr8OPC/joQTv5nNZuIbZmOWeRUJ0?= =?iso-8859-1?Q?qssIo9dhJf8HCHEsh/q3cCf9/7eu3Z+SSnA2W0OoRnprdbph07Wf1rd7IK?= =?iso-8859-1?Q?D9AwIGOwD3rOaulIGTY3Zcwd6roxIcsJ+4ecKnNE09Ci/DT7v2nCsZabvF?= =?iso-8859-1?Q?uilAAnw3qL0YhANZIfZWVfz6+DfddzB3K5ds5Ifof/Z/AGYrHbrBMcE5eM?= =?iso-8859-1?Q?21OHEQ4D81tRkfki+eCl4xhnEQuHfrLFNCPPFPfLCChcIIf/At/lSP5NaE?= =?iso-8859-1?Q?Za1YjJA9UJZ+7PXWOmIRZLQ52JppPZTuhVUEQBE2K16C3pXSHcXY3fTggl?= =?iso-8859-1?Q?zyxiSSE+84WTP88I6Dge1zbiHJt9d23BlWs9aqHEc2giuCsGLOPzCRQh02?= =?iso-8859-1?Q?pH/Z+kmpkxHjWCWlqzTivDVxRM54XaCS9RcmMgi8rWbFWyt+yGhQIbEEUJ?= =?iso-8859-1?Q?HRep0sOMsQMy9hTupasPZBvtwf2jl2xLDwYKHZ+gN3tkR444QXvP1PwrRG?= =?iso-8859-1?Q?bRLg6Ldwwr3/2U8bB3gIH426QQk97d869X?= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: marvell.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM4PR18MB4368.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 296f0280-d7c1-4454-e0f6-08daf3df8c40 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Jan 2023 14:24:28.2040 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: W9CooZ/ULfyV/+yAj2h1B6HCdC7bYX3JVE186tz3DSM4Uxwsw1uOtQKuEpCPRs/tM0YCiU5iGw6t+MvO7VRjJA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR18MB3590 X-Proofpoint-ORIG-GUID: Xgdf2zqe9RH54fvQZL_hpfblTsXQLw1u X-Proofpoint-GUID: Xgdf2zqe9RH54fvQZL_hpfblTsXQLw1u X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2023-01-11_07,2023-01-11_02,2022-06-22_01 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: Morten Br=F8rup >Sent: Wednesday, January 11, 2023 10:31 AM >To: Tyler Retzlaff ; Tomasz Duszynski ; >bruce.richardson@intel.com >Cc: dev@dpdk.org; thomas@monjalon.net; Jerin Jacob Kollanukkaran ; >Ruifeng.Wang@arm.com; mattias.ronnblom@ericsson.com; zhoumin@loongson.cn >Subject: [EXT] RE: [PATCH v5 0/4] add support for self monitoring > >External Email > >---------------------------------------------------------------------- >> From: Tyler Retzlaff [mailto:roretzla@linux.microsoft.com] >> Sent: Wednesday, 11 January 2023 01.32 >> >> On Wed, Jan 11, 2023 at 12:46:38AM +0100, Tomasz Duszynski wrote: >> > This series adds self monitoring support i.e allows to configure and >> > read performance measurement unit (PMU) counters in runtime without >> > using perf utility. This has certain adventages when application >> > runs >> on >> > isolated cores with nohz_full kernel parameter. >> > >> > Events can be read directly using rte_pmu_read() or using dedicated >> > tracepoint rte_eal_trace_pmu_read(). The latter will cause events to >> be >> > stored inside CTF file. >> > >> > By design, all enabled events are grouped together and the same >> > group is attached to lcores that use self monitoring funtionality. >> > >> > Events are enabled by names, which need to be read from standard >> > location under sysfs i.e >> > >> > /sys/bus/event_source/devices/PMU/events >> > >> > where PMU is a core pmu i.e one measuring cpu events. As of today >> > raw events are not supported. >> > >> > v5: >> > - address review comments >> > - fix sign extension while reading pmu on x86 >> > - fix regex mentioned in doc >> > - various minor changes/improvements here and there >> > v4: >> > - fix freeing mem detected by debug_autotest >> > v3: >> > - fix shared build >> > v2: >> > - fix problems reported by test build infra >> > >> > Tomasz Duszynski (4): >> > eal: add generic support for reading PMU events >> > eal/arm: support reading ARM PMU events in runtime >> > eal/x86: support reading Intel PMU events in runtime >> > eal: add PMU support to tracing library >> > >> > app/test/meson.build | 1 + >> > app/test/test_pmu.c | 47 +++ >> > app/test/test_trace_perf.c | 4 + >> > doc/guides/prog_guide/profile_app.rst | 13 + >> > doc/guides/prog_guide/trace_lib.rst | 32 ++ >> > lib/eal/arm/include/meson.build | 1 + >> > lib/eal/arm/include/rte_pmu_pmc.h | 39 ++ >> > lib/eal/arm/meson.build | 4 + >> > lib/eal/arm/rte_pmu.c | 104 +++++ >> > lib/eal/common/eal_common_trace_points.c | 3 + >> > lib/eal/common/meson.build | 3 + >> > lib/eal/common/pmu_private.h | 41 ++ >> > lib/eal/common/rte_pmu.c | 504 >> +++++++++++++++++++++++ >> > lib/eal/include/meson.build | 1 + >> > lib/eal/include/rte_eal_trace.h | 10 + >> > lib/eal/include/rte_pmu.h | 202 +++++++++ >> > lib/eal/linux/eal.c | 4 + >> > lib/eal/version.map | 7 + >> > lib/eal/x86/include/meson.build | 1 + >> > lib/eal/x86/include/rte_pmu_pmc.h | 33 ++ >> > 20 files changed, 1054 insertions(+) create mode 100644 >> > app/test/test_pmu.c create mode 100644 >> > lib/eal/arm/include/rte_pmu_pmc.h create mode 100644 >> > lib/eal/arm/rte_pmu.c create mode 100644 >> > lib/eal/common/pmu_private.h create mode 100644 >> > lib/eal/common/rte_pmu.c create mode 100644 >> > lib/eal/include/rte_pmu.h create mode 100644 >> > lib/eal/x86/include/rte_pmu_pmc.h >> > >> > -- >> > 2.34.1 > >[Moved Tyler's post down here.] > >> >> hi, >> >> don't interpret this as an objection to the functionality but this >> looks like a clear example of something that doesn't belong in the >> EAL. has there been a discussion as to whether or not this should be >> in a separate library? > >IIRC, there has been no such discussion. > >Although I agree that this doesn't belong in EAL, I would point to the tra= ce library as a reference >for allowing it into the EAL. > >For the records, I also oppose to the trace library being part of the EAL. > >On the other hand, it would be interesting to determine if it is *impossib= le* adding this >functionality as any other normal DPDK library, i.e. outside of the EAL, o= r if there is an >unavoidable tie-in to the EAL. > >@Tomasz, if this is impossible, please describe the unavoidable tie-in to = the EAL. No need for a >long report, just a few words. You (and this functionality) shouldn't suff= er from our long term >ambition to move stuff out of the EAL. > You can read about rationale here https://lore.kernel.org/dpdk-dev/DM4PR18M= B436872EBC5922084C5DAFC1DD2FC9@DM4PR18MB4368.namprd18.prod.outlook.com/#t As for the NO-NO there isn't any in fact. There are some tradeoffs though.= =20 For example, seems eal cannot depend on other libs so if someone needs to finetune some part of EAL for whatever reason, then relevant part needs to= =20 modified each and every time. I.e specific includes and trcepoints need to = be added each time. On the other hand, if this is coupled with eal then adding tracepoints to s= ome parts will be easier. Or they can just be added to specific points and live there= .=20 No strong opinions besides that. I'd like to know what others think.=20 >> >> a basic test is whether or not an implementation exists or can be >> reasonably provided for all platforms and that isn't strictly evident >> here. red flag is to see yet more code being added conditionally >> compiled for a single platform. > >Another basic test: Can DPDK applications run without it? If they can, an = Environment Abstraction >Layer does not need to have it, and thus it does not need to be part of th= e EAL. > >> >> Morten, Bruce comments? >> >> thanks