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 9206642490; Thu, 26 Jan 2023 10:05:57 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3D6C540697; Thu, 26 Jan 2023 10:05:57 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id CFF6A400D7 for ; Thu, 26 Jan 2023 10:05:54 +0100 (CET) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 30Q8olKB011102; Thu, 26 Jan 2023 01:05:50 -0800 Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2168.outbound.protection.outlook.com [104.47.58.168]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3nbpc9014f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 26 Jan 2023 01:05:50 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=T1jA4sWSWF3nTVo0u+KEAZL0D4/eDJZaBDOttJZIG91HYCfdBFofmCuCVoRn25d7nq7w3vH7gvzGc+/QjLVZmq4vvgnZf//pXx668dqMJlUDvMagBSxR/eHs/OOv0N76poFCEdpOuWjjPZ/Xr1QYDF3IXtS6VahW8bSdeFD22nCuwghwY9Sc4M9Zb4MgIk5vMqFIXCFIVOSRZ+Bjg/JjaKrmsHX9GpSXqaKPlYEmeTa8qWGPJP/4HgSb60ZxxYmqjWByjn3ngkl+eGrCu3fPCRNjoEAJd9VT/1gkYUzwdhhDrIFsOVs01qIS3TMxLtTAyLMFV7GhN72nGlxw8lGyOg== 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=+9CAtAxDR1BWwuGGTN4Ilcyw7Ca23jMULTsNW/hm+1w=; b=gfpCM4ii93PA0ewLiLnFlJ6TLImND1usRIhm4YNoSPq7VbwlW9IkdAhhLtKCOP1opzm6Jm+0Vh4Z0DQbZe/872snfne2Va425EBrdXUCtOLGP4afnV1I3W87Ba0xrPZJATxx3iz+YfBOtPrDMo0uCfrghO6Dni0ptqgj2keSOrYhNFQtPvpMosDDvFluTKwS/SjEHrBObz0qf3bTXY8SivgVAzVASntUT2ykpSWk6S3AZOYosVAPT5SCDKRPQwj+8zD/oDhLgC5IgiZ9ExXE4K7octr6TKuoTKLkMfy452vHTSJBr+cqaU4XtVMvXosjM2RaLXF9kcgTsMsdm361gg== 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=+9CAtAxDR1BWwuGGTN4Ilcyw7Ca23jMULTsNW/hm+1w=; b=Uu/7urFko77a4gF22Z9uOF+HqU5Lu2ad6o+SSEkHZBUSVCUdEyCJPDnfBKCV/XW8drlEeQG1n5ynqvtfBbrlAmZtp5+mC1F/wTxurWD/YNOnkDToCoRF4rhODh84Go/SHdfP+/Y61Nrehrwr3OpU7JskSoQivLl81pbzdU5QNBs= Received: from DM4PR18MB4368.namprd18.prod.outlook.com (2603:10b6:5:39d::6) by CO6PR18MB3875.namprd18.prod.outlook.com (2603:10b6:5:351::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.22; Thu, 26 Jan 2023 09:05:47 +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.6043.021; Thu, 26 Jan 2023 09:05:47 +0000 From: Tomasz Duszynski To: Tyler Retzlaff CC: "dev@dpdk.org" , Thomas Monjalon , Jerin Jacob Kollanukkaran , "mb@smartsharesystems.com" , "Ruifeng.Wang@arm.com" , "mattias.ronnblom@ericsson.com" , "zhoumin@loongson.cn" , "bruce.richardson@intel.com" Subject: RE: [EXT] Re: [PATCH v6 1/4] lib: add generic support for reading PMU events Thread-Topic: [EXT] Re: [PATCH v6 1/4] lib: add generic support for reading PMU events Thread-Index: AQHZLF9HxL6yMLPInESeqtNvHMF+j66noYeAgAjIOiA= Date: Thu, 26 Jan 2023 09:05:47 +0000 Message-ID: References: <20230110234642.1188550-1-tduszynski@marvell.com> <20230119233916.4029128-1-tduszynski@marvell.com> <20230119233916.4029128-2-tduszynski@marvell.com> <20230120182931.GA5224@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> In-Reply-To: <20230120182931.GA5224@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> 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_|CO6PR18MB3875:EE_ x-ms-office365-filtering-correlation-id: 6fe253a5-09aa-4a54-88bb-08daff7c83a8 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 9/aFp6dKLHi66O5LW4AsLGgkJx389U/mLYz2YPv5Xp/n8iruYHyB/U5Eat2SgEu8cDHlYjlrJlXypM2ukc8JLFOrPQTQtGOeR6GOoKlI+3/zY74lOLPBMFv1XT9k6UwLLxSvrIh5IU6VcpUGadD9HqaDMYAqQUUjikZvK3Bu5meWYhRrwk2Szt0GV4O1Q3jEcZNLKxS3s5fS4ZsQtm/s+jmWJ8WCcFppkVzGAq0MtIhGGO2HJXf8H2+KBM5AtJLWLUh4NJRSv8sI7jkmp79obbppJUlXifxE9I9U4+tbLhKj3NB1XwkGdBkYTttiFwDochCXDuK5ph8O/zuiq9K3Khq2l9DqXoguoOfdXaKVBRFDKfuXKEJfs3mMeNXEjePsc6t3FMAUHoJRBORmngzhDr2bTOM86MgHsMNudo1bNUi0C99oNxCshE7fPUVzQ6YGSYVR/LKj7wnWnzi7ZMp5a0aZKWJ1vtul6/lWbTnbthyKuGWtOMQgVdVw2WdJO0fqv/zv3MpV7mCb/JjhLL6GWWAMB8JGAh6XWeSKX0DGQUtC8VFhLDJkPNxLrQV3iTYkGQXqdVhh7OD5RrHpAhTeWCxCnDhpMZf4nwnYAK9MVtxF/qk3Sbnmso/lae9PLp8CLeKJXdjmlRIEx539BLU2wU+yOnr7YMNyIXgv4I4EaQINqC6hjXC7QBZMWZRTDjLyE84XHBcfPazLluNuZ70DWSkY9MnRS6XyolCDt9v/D9s= 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:(13230025)(4636009)(366004)(396003)(346002)(376002)(136003)(39860400002)(451199018)(64756008)(66446008)(52536014)(66556008)(66476007)(6916009)(8936002)(41300700001)(5660300002)(2906002)(55016003)(71200400001)(66946007)(8676002)(478600001)(54906003)(4326008)(7696005)(33656002)(38100700002)(122000001)(38070700005)(86362001)(76116006)(83380400001)(316002)(186003)(26005)(9686003)(6506007)(41533002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?KsFIQCndAyq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6i?= =?us-ascii?Q?lb820cea5H6asSS8ygVWO3vzDr/Bzx6CBT7mf3icVCgxRkoaBp7+r+JuxdUV?= =?us-ascii?Q?yaO5sEJKDPb9G51oYtY/cVVre+0x4HAAEFS219LVdyNY0r55ITl3HVKpPqEf?= =?us-ascii?Q?WW7YVPkLW/zuMsn/IKLZafBSHM6SgHp0mmaRAZuM+wc9CGbmTux/goLdhr5e?= =?us-ascii?Q?0qS0+Phgi+JlrWCjMIpIgN4uoT6g0IBB/jvyLIRGlWJgj2TB6hY9rR8srDYi?= =?us-ascii?Q?eFxYPU5Shsd9dB6KI2+bweKvR9L44WrxlucfB/Wd8jDXbj+0AJfc9S8s+TEx?= =?us-ascii?Q?npXTn4fLr4Or4stLMKiZ0P3EHkkLiT0r5RpndZd1jJxcktImI7L0ttQSTLJt?= =?us-ascii?Q?tkGXsJ+iRH8s2Fh/GYTtaWPtlz07AwW5LDKqZ9zRnV8LRsvGuh4W5SnVyCb5?= =?us-ascii?Q?faGthArez6ouCP3C7Xnr8KF+QYhpLcvApBUn8ybcJz0nBVcRBmn4/Ju2UmGB?= =?us-ascii?Q?xT0mZPjfVLSv6RENshR0p8vYnDdq4NsyEfwmFOYWVj4UXNgWRp7tlrdLpXNc?= =?us-ascii?Q?jC0SkWHKGx+5xDWF7nnXbAncM1VbYxN91GOmWhxix2qLa9aZdWdtvD+iycQg?= =?us-ascii?Q?rmqlt7vt3OO0akMYhbRrNCyeNuwMVFnBNxGT5wH5MkDQxFLaPVCaUA6Gur2R?= =?us-ascii?Q?owNHcyxzgMLOJbZitpioadOYJ7c5pjAcOOoBjKSx?= Content-Type: text/plain; charset="us-ascii" 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: 6fe253a5-09aa-4a54-88bb-08daff7c83a8 X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Jan 2023 09:05:47.5609 (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: yLlUcjcP4P9gHmOeMF5tBNyHeOGmFHfpNDuUiyeHq6QxM2d5zD+qnv3DtiXkVO+Yo4ecjHphAnR7jt5Que293g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR18MB3875 X-Proofpoint-GUID: IXui_ws1JRzEquIGyLnRStOHVwqLWpcj X-Proofpoint-ORIG-GUID: IXui_ws1JRzEquIGyLnRStOHVwqLWpcj X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-01-26_02,2023-01-25_01,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: Tyler Retzlaff >Sent: Friday, January 20, 2023 7:30 PM >To: Tomasz Duszynski >Cc: dev@dpdk.org; Thomas Monjalon ; Jerin Jacob Kolla= nukkaran >; mb@smartsharesystems.com; Ruifeng.Wang@arm.com; >mattias.ronnblom@ericsson.com; zhoumin@loongson.cn; bruce.richardson@intel= .com >Subject: [EXT] Re: [PATCH v6 1/4] lib: add generic support for reading PMU= events > >External Email > >---------------------------------------------------------------------- >On Fri, Jan 20, 2023 at 12:39:12AM +0100, Tomasz Duszynski wrote: >> Add support for programming PMU counters and reading their values in >> runtime bypassing kernel completely. >> >> This is especially useful in cases where CPU cores are isolated >> (nohz_full) i.e run dedicated tasks. In such cases one cannot use >> standard perf utility without sacrificing latency and performance. >> >> Signed-off-by: Tomasz Duszynski >> --- >> MAINTAINERS | 5 + >> app/test/meson.build | 4 + >> app/test/test_pmu.c | 42 +++ >> doc/api/doxy-api-index.md | 3 +- >> doc/api/doxy-api.conf.in | 1 + >> doc/guides/prog_guide/profile_app.rst | 8 + >> doc/guides/rel_notes/release_23_03.rst | 7 + >> lib/meson.build | 1 + >> lib/pmu/meson.build | 13 + >> lib/pmu/pmu_private.h | 29 ++ >> lib/pmu/rte_pmu.c | 436 +++++++++++++++++++++++++ >> lib/pmu/rte_pmu.h | 206 ++++++++++++ >> lib/pmu/version.map | 19 ++ >> 13 files changed, 773 insertions(+), 1 deletion(-) create mode >> 100644 app/test/test_pmu.c create mode 100644 lib/pmu/meson.build >> create mode 100644 lib/pmu/pmu_private.h create mode 100644 >> lib/pmu/rte_pmu.c create mode 100644 lib/pmu/rte_pmu.h create mode >> 100644 lib/pmu/version.map >> >> diff --git a/MAINTAINERS b/MAINTAINERS index 9a0f416d2e..9f13eafd95 >> 100644 >> --- a/MAINTAINERS >> +++ b/MAINTAINERS >> @@ -1697,6 +1697,11 @@ M: Nithin Dabilpuram >> M: Pavan Nikhilesh >> F: lib/node/ >> >> +PMU - EXPERIMENTAL >> +M: Tomasz Duszynski >> +F: lib/pmu/ >> +F: app/test/test_pmu* >> + >> >> Test Applications >> ----------------- >> diff --git a/app/test/meson.build b/app/test/meson.build index >> f34d19e3c3..b2c2a618b1 100644 >> --- a/app/test/meson.build >> +++ b/app/test/meson.build >> @@ -360,6 +360,10 @@ if dpdk_conf.has('RTE_LIB_METRICS') >> test_sources +=3D ['test_metrics.c'] >> fast_tests +=3D [['metrics_autotest', true, true]] endif >> +if is_linux >> + test_sources +=3D ['test_pmu.c'] >> + fast_tests +=3D [['pmu_autotest', true, true]] endif > >traditionally we don't conditionally include tests at the meson.build leve= l, instead we run all >tests and have them skip when executed for unsupported exec environments. > >you can take a look at test_eventdev.c as an example for a test that is sk= ipped on windows, i'm >sure it could be adapted to skip on freebsd if you aren't supporting it. Right, this looks better. Thanks for pointing this out.=20