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 07C6C423AC; Wed, 11 Jan 2023 10:39:55 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7BCE042D2A; Wed, 11 Jan 2023 10:39:43 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 91DB842D25 for ; Wed, 11 Jan 2023 10:39:42 +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 30B9aUlX017539; Wed, 11 Jan 2023 01:39:39 -0800 Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2109.outbound.protection.outlook.com [104.47.58.109]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3n1k56spfm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 11 Jan 2023 01:39:38 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HgYCKc4arDo9L1I+tLPqLXGXwY0tu9eoqHzw7CD8w6IC9xTebA+fMEEWw+2EgkRUgAT2r4QOj2apcRyMP5qoo24Q9rxEbeqkwlfkj0r3JoqR5KiYhJR/j9XURw0/zQK+WpYqQkRLJoxapja2+hKiGTp/LC2kJYgCyw/gU0PLoMW80mVGrouBNWU5SNlZPYBZdOYhTQYb0Yrg9cm6+1/x0P9iH+6EjYJNNfgwXsukvEW83p0fQvlSxY5P2Oibaz/DXsRafLhqvTOiBQCatX5/akfQ6VGJRDb2bgWIeDTc6rHFQG5/WXBGhENz9BUO8QZPGk4ON4KsKH6AVSp2MH/NaA== 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=ZxkwYS7IpgdWH1CkoG8Br8r1CHO7/TmX9Px0P0z1fxs=; b=dQknoBURGgG1M/fnABSHLfDcAfScSKXInQsGf8GACqraYmMuwfaqrgowFXObL6QUdKHoaCXJiybt/FwnSwLjA2EtRp4fG0+5+SMAaSOALbJIMIrjNqlBzG9Bb74QnxPOXnLeFJhpESjqq9AN0NQSCH/ikTI7q416qhy60EQ7moVyuIcfsx8yQefOFmrzeEuZSkuWRdtsjXTFLqBoyPRu84TBmyZA4TQpL7Cy/ZstfQJ2AFtpZwIP1OSiHWFWlow2oXK32QBmnfLuwFkUnfbzkjEDJFhGJSUsCStpkf+Kyporj8rj0v71EAeJSeD02GH+82N/bIbpoJUGWPCfGcJ9FA== 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=ZxkwYS7IpgdWH1CkoG8Br8r1CHO7/TmX9Px0P0z1fxs=; b=rRFdOr9WfdX8w6PTC18FzR1X6yxwUWXIPwLd+oaltZk98LS7DdS2njwWkQ6C7TwhFCUKdGZiffzmEln8XzmisCU/CYmLorlE/KHNNrPvhWIUntFuZlhdx2UoV1NJLIBLbFDwj899/ArLGXkGuzohFb/6PlFmx0Od14J9QfNaHFA= Received: from DM4PR18MB4368.namprd18.prod.outlook.com (2603:10b6:5:39d::6) by SJ0PR18MB4396.namprd18.prod.outlook.com (2603:10b6:a03:2e5::13) 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 09:39:35 +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 09:39:35 +0000 From: Tomasz Duszynski To: Tyler Retzlaff , "bruce.richardson@intel.com" , "mb@smartsharesystems.com" CC: "dev@dpdk.org" , "thomas@monjalon.net" , Jerin Jacob Kollanukkaran , "mb@smartsharesystems.com" , "Ruifeng.Wang@arm.com" , "mattias.ronnblom@ericsson.com" , "zhoumin@loongson.cn" Subject: RE: [EXT] Re: [PATCH v5 0/4] add support for self monitoring Thread-Topic: [EXT] Re: [PATCH v5 0/4] add support for self monitoring Thread-Index: AQHZJU3PoaXFeNya/UGj1gI3nUnCHa6YXbsAgACP+SA= Date: Wed, 11 Jan 2023 09:39:35 +0000 Message-ID: References: <20221213104350.3218167-1-tduszynski@marvell.com> <20230110234642.1188550-1-tduszynski@marvell.com> <20230111003222.GA24460@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> In-Reply-To: <20230111003222.GA24460@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_|SJ0PR18MB4396:EE_ x-ms-office365-filtering-correlation-id: 4d4b8f61-4073-48ab-ceb4-08daf3b7c003 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: YfhAUHyG8FrplHZyGwDewwFoqeUuPQ/EUbOtBD2Iuq5Be88p8r7XR+ALW/b7abGkoTAM7VFKgMi1A8gIPZS1rxRPrqM0k2p/Ey3q/OUUJJ41PonH8DR+1u70X8ZkoCBG6JN7QStabPCEqedYf5hRlpH+gAQt4mswRBqw2mzKpTICQlsQtHgTCt7//k8VZItLWGO9wDTW3fvaf2Qt+62MKIaLSbravruJ8fMfy/UoCp/s3tn7ULjsK3VqZ6S1oN3fLY4/0vN4XxpoTvBW+T/Xi/8qahBqNDXoDqMKqsIe5wfuLE8Ai7KJDJa7ph4qAJBDDZG6Gyn042AXIz1WeZsKoTwf2FEz0I1O6F0MsQUE/7uhaBwvsUGH4T7ko2PA9fnA6bqD1asITuBU1P3Z7obzntvbY1zM0ssbagT7Pgihy9yD9dsFfc8sx7F5WN/yjyWYX9kqlhXKfa6oHrfHSAppC/wUVVDsKSqPqcAQuTEXeuVfeP/Fzs8hBsfnYvLp7YmRRXkCgsHPXmI+satTlZe42Eo4nEy8/AjHtZPJFG7z8c1xRfNyUM8f0g4wS7yArOG6+AbmoI2tf4ImCwyCCopu08/bpk68t5TLXLTnMwO9XxxiaPp5NUGhONq0J3bNm7cNI7J6Nk0GcZv2D6Nvd89eLS6cI4mSAMCKyn+Qli0JINI2ACMhkyTV/Zb8znitnFKH8VaYJpSVY6t+1Q6mSZhOsA== 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)(39860400002)(376002)(346002)(396003)(136003)(366004)(451199015)(6506007)(38100700002)(122000001)(2906002)(478600001)(33656002)(26005)(7696005)(186003)(5660300002)(71200400001)(9686003)(316002)(38070700005)(8936002)(83380400001)(52536014)(55016003)(86362001)(41300700001)(64756008)(110136005)(8676002)(76116006)(54906003)(66556008)(4326008)(66946007)(66476007)(66446008); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?pqNUvrGbSIuYd1FXrFsxJFU+p6KY+u+x+EwKKG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?k02iw4/61CX3pXv4j0jc+9Un3Pw7CDJXJ6+z14GQZSQeIxng+4qvq3gQbnh1?= =?us-ascii?Q?hG4rOh9zGbyo9JYa8UD9DLpjgmPwsUp4JXpeOZVTe/sVei8rllQglEjJiDWQ?= =?us-ascii?Q?10aWBHGqpaHF8HqjtqqtpumJ6h3zGnBnoYvMn3W/x4aXQv509Z5pEFrSgol5?= =?us-ascii?Q?yE/ZS4ysqMqLe5c8JrfoIXGKo5hh0GvjJAQoFdXFDsUAKCAK35LP/ZswQIL8?= =?us-ascii?Q?kDSRPzcIIvPl0zrsM2E5gD17JHyVZNXLBKfKMSf9qAMFkIN57p6fAhmS55J3?= =?us-ascii?Q?0c9pfwQw2U1vLw/5gAiQuKjfV+0iexGhKfZWeGHz+vR7YotYmUyrD7UpG+W0?= =?us-ascii?Q?CXwxWYm8FS1Eq1aakq1owN6UAPkmOWA/HJPCssz7oz8UHTcX/Zx/y2cMT1Hx?= =?us-ascii?Q?J6bYL7LCS+R1QTBdabmqc/1GjDi+3p95tz7OIp9lrQCL1gc35tglTvpl9cw4?= =?us-ascii?Q?G/qGAzchjvotJyAFrgz272wJK/D0uV0WOpg/GySQLTG6EFPtVgS226B53su1?= =?us-ascii?Q?W8/fghSAAwbzfByXOyk3feKvNWnYllWN0RhFF8MksE4/YAsrSPQROnVwVF8L?= =?us-ascii?Q?wfOaxlI/3QzU56sSVGaL7DBUVCgHqphEXC0D1YtcPm2z9piqod4+hGV0EwWd?= =?us-ascii?Q?/C1WCwtqhgLNatGQW7e0YCcsv+fO+jw/Z2/bb1Tf?= 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: 4d4b8f61-4073-48ab-ceb4-08daf3b7c003 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Jan 2023 09:39:35.1760 (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: MGDR8HsnlFdNgGPY2B0ARLfPOJrF6GY30LnKhhNtN/s0jWjQIWgbrzTGEtTkcDgi2AnO3WNx6IvGejY9CxCBfQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR18MB4396 X-Proofpoint-ORIG-GUID: rHwV2SZG6Zu7zYM9Vq3rnNe6J5dae7wX X-Proofpoint-GUID: rHwV2SZG6Zu7zYM9Vq3rnNe6J5dae7wX 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_04,2023-01-10_03,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 Hi Tyler, >-----Original Message----- >From: Tyler Retzlaff >Sent: Wednesday, January 11, 2023 1:32 AM >To: Tomasz Duszynski ; bruce.richardson@intel.com;= mb@smartsharesystems.com >Cc: dev@dpdk.org; thomas@monjalon.net; Jerin Jacob Kollanukkaran ; >mb@smartsharesystems.com; 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 > >---------------------------------------------------------------------- >hi, > >don't interpret this as an objection to the functionality but this looks l= ike a clear example of >something that doesn't belong in the EAL. has there been a discussion as t= o whether or not this >should be in a separate library? No, I don't recall anybody having any concerns about the code placement. Ra= tionale behind=20 making this part of eal was based on the fact that tracing itself is a part= of eal and since this was meant to be extension to tracing, code placement decision ca= me out naturally.=20 During development phase idea evolved a bit and what initially was supposed= to be solely yet another tracepoint become generic API to read pmu and tracepoint based on t= hat. Which means both can be used independently.=20 That said, since this code has both platform agnostic and platform specific= parts this can either be split into:=20 1. library + eal platform code 2. all under eal=20 Either approach seems legit. Thoughts? > >a basic test is whether or not an implementation exists or can be reasonab= ly provided for all >platforms and that isn't strictly evident here. red flag is to see yet mor= e code being added >conditionally compiled for a single platform. Even libs are not entirely pristine and have platform specific ifdefs lurki= ng so not sure where this red flag is coming from.=20 > >Morten, Bruce comments? > >thanks > >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