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 ED50A45DFE; Mon, 2 Dec 2024 05:20:42 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E3CFD402A7; Mon, 2 Dec 2024 05:20:40 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 39FF840285 for ; Mon, 2 Dec 2024 05:20:39 +0100 (CET) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4B22uHa1010681; Sun, 1 Dec 2024 20:20:35 -0800 Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2044.outbound.protection.outlook.com [104.47.58.44]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 4394hs03m7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 01 Dec 2024 20:20:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=RvVEdWKGI7EyPhO/lSlYk2gjilyqx9u1FO5P7pPXsYN7Too+KXMXrU3nteqGzQuvNnb6rg2PAGfVff/YOBze4d4rxMI8e9VEhKO9MhjrPzrTAP1xVcBqSnSU5Sz2J2iqX8Ykcl9Jb6Pji1vGJXTpXYVqNYooW7/U07beHpjHl5npB8csDoCtolxP8d8XV3YF29gxKmQ79ZACSJV7jhA7jRBm8Gmf2GPROI3v4/n+ajjcLtbX/JCq5YicKNqyaRIOtxZBQDjWjsqLfShNYxnNdJY6c6R7PoEUbbCuN9sxv1z/8PiicEki85n1a4oC+XjJVi/df++Gr6cfgAKRJqgNwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=xSV3alJYrnnqSHcBNt8LRvfraCaEI/qHDbclMhw1iuI=; b=AbzTnHhk5v62/J91nT4zOnS9IhH4IEq4ozZyspPxFtneltsQvYfyImvuWLgVprXV2zkDiB0w9x9Gx2EcSYCDnsfxFU6HaHoew0y6EQEItu4jXQV77Q+F2+X/PeRJYBgN1FcQ8DtP8GwohkqTs28JH5Ig+QMc4YJKufLvUhasypm7cado4x0gXSmpsH4eNmVz1FLDzCk7LSOY7TA5E2ohKdJ0V1qi6DNVdr1TIZC3UNc/zDpBZPg9mWxBpai0e4P9R+UDrbApeaUApONI7tsQ8nl9Tl7FqLIN+fa56Meu9cqTWS4xP80Z9wK52RNEza/zLCQVNxIpYDIr5EtKERIdzw== 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.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xSV3alJYrnnqSHcBNt8LRvfraCaEI/qHDbclMhw1iuI=; b=n42da2qeXjCST2qkb01pTQdJNAK0Ftf/7cSaadQ8h3nUvve6dL1AcPP8lgs81SxxiUorZZOGSdYmovQQ6PDhWLE33kRFd6RHfdX7rasZXn1DobFcnz3dH5KtVB2rPpPXSbxYmhy7M8HYqygQN508FHQqoeeMaOpXz6RksodyccE= Received: from DM4PR18MB4368.namprd18.prod.outlook.com (2603:10b6:5:39d::6) by MW3PR18MB3562.namprd18.prod.outlook.com (2603:10b6:303:5c::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8207.19; Mon, 2 Dec 2024 04:20:31 +0000 Received: from DM4PR18MB4368.namprd18.prod.outlook.com ([fe80::1679:98:2091:7e98]) by DM4PR18MB4368.namprd18.prod.outlook.com ([fe80::1679:98:2091:7e98%6]) with mapi id 15.20.8207.017; Mon, 2 Dec 2024 04:20:31 +0000 From: Tomasz Duszynski To: Tomasz Duszynski CC: "Ruifeng.Wang@arm.com" , "bruce.richardson@intel.com" , "david.marchand@redhat.com" , "dev@dpdk.org" , Jerin Jacob , "konstantin.v.ananyev@yandex.ru" , "mattias.ronnblom@ericsson.com" , "mb@smartsharesystems.com" , "roretzla@linux.microsoft.com" , "stephen@networkplumber.org" , "thomas@monjalon.net" , "zhoumin@loongson.cn" Subject: RE: [PATCH v16 0/4] add support for self monitoring Thread-Topic: [PATCH v16 0/4] add support for self monitoring Thread-Index: AQHbOYywfbeqJsHyC0OYLcm0BY0E+rLSb2og Date: Mon, 2 Dec 2024 04:20:31 +0000 Message-ID: References: <20241025085414.3412068-1-tduszynski@marvell.com> <20241118073706.3129423-1-tduszynski@marvell.com> In-Reply-To: <20241118073706.3129423-1-tduszynski@marvell.com> 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_|MW3PR18MB3562:EE_ x-ms-office365-filtering-correlation-id: f7fd04d4-ab84-4af7-9cbb-08dd1288a8ab x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|1800799024|366016|376014|7416014|7053199007|38070700018; x-microsoft-antispam-message-info: =?us-ascii?Q?bnEUBTM6MUCHa8uucR+eq5Clk9yug3MJnLi7a+aimN4AkYhHBYLeEplG+TNq?= =?us-ascii?Q?LMT1u/+BIJ2RTl+3AE2cyvmC/njjO1Na2SLLVUVqr7Joqfhga89UX3S9iEx4?= =?us-ascii?Q?A0xg3siA/+ZARYvvm/snWuxUPh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JVB?= =?us-ascii?Q?+DCm4pDYZ6ukBgYqatwcdJzMhflUhVA1Sgurwjxi9BjBlb5oxlnXhN4M85J5?= =?us-ascii?Q?uuUBjr2YDqb9vnOeLOxHy6cuAnZ9aPfTVkTk/DELy7hoHGgWt2UtmsXR7v5k?= =?us-ascii?Q?pCZAC549N+deqCkL3pnEMILidi8VZroqOMa4lvam6iLqJIP/lYsOr6TJDVMm?= =?us-ascii?Q?UqvwBs4dY39qywB1Z92JzWCeQSeaIWRi3Q1qr0YWfqQPnIHnedxCzKqlH/Qz?= =?us-ascii?Q?quCt2/RqTZGgJ4pQlf+xDVxnPyzKBP7gSneLxAo4T5S1u77zO+Oevrwra5Rb?= =?us-ascii?Q?8p776ivzBbaxx6iKxjfbWhR/KVbRNWN/iDmflo0KBo7NUggpW00bL20LakcQ?= =?us-ascii?Q?F3lxyrtKEHUF+7wbi3a/rWRmVC0x3DQm8ZzmLeZcuMZWkK83fw=3D=3D?= 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:(13230040)(1800799024)(366016)(376014)(7416014)(7053199007)(38070700018); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?BJj9OdN6HTTwKGOUF2pZopqko+6qirmpVNtuNavomK+T15MxF4SfYmtUBT1J?= =?us-ascii?Q?yYU1Kww6yfbeeTFZgfCDfa8nBjaVCYUruObU9PR5eCmWIN8HFKXzzIGtTL5/?= =?us-ascii?Q?3ngc3NvYyNrRSOTb/uOAMv53BydFCe3yUV1oNPeDoHi9rDVne65r873CEKlM?= =?us-ascii?Q?Kn3d69UvSGg3hXhmxZ1Ev5krzQFsGMzNnok0zk93q8ME5+Mrow7mb1wDO+D5?= =?us-ascii?Q?Pd++uBWIoqK7Goa+ObPUPzajfdaYggnm7m4bVN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ry5IGaA1NfAULYCoRK0dRNu4TTfL40Juj7FMY12rczpAyB56rkCW?= =?us-ascii?Q?iu++LalfwdGlAOAIGFgVvsSAde0h26LqLOrP42hBisqTrNNKViXr7Vl+KPgq?= =?us-ascii?Q?FVXeLNKTHPOlCO5ZS0Gf1Epb9DPyKOax3l/1F2VdPR+pmqaGmQpKU9yoHKmL?= =?us-ascii?Q?z/GYiZRahzekbx/7zCkPUBPznv/yzI0yEGCRBdLKhjHcxB/FZwN9BBgYzG60?= =?us-ascii?Q?RLOXhH4OhHAhHn031UY0+il6PkpuRLEvXpuoudzt6rgJaTEDAZek+d4Um5JL?= =?us-ascii?Q?YnbeRdJxCBdrq4xxWmZMyIfrpfiJafxxfjE9unDAKXv2EbISv/U7tQePO1S9?= =?us-ascii?Q?CJyco2KEDu5oxzKFjeqLb5y1/8z3E3UIJEbzb3rnYcBrCxni+pH/jojQJDZK?= =?us-ascii?Q?zsJxt0+OXYmHbcKmNAckzT66ftKllCBEdJF7aKJ6?= 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: f7fd04d4-ab84-4af7-9cbb-08dd1288a8ab X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Dec 2024 04:20:31.0951 (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: 9QV/aRFqSHaziWQiNLAfbpFmIwdH5j/OqalrJYRI/MwGBYjmtvZLnsc7CXw4G62uJ1cOVNuDL8G3LAJcuhFaUA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR18MB3562 X-Proofpoint-ORIG-GUID: 9lZim8IoIT9ezg2wVJAti6TlQCzupisF X-Proofpoint-GUID: 9lZim8IoIT9ezg2wVJAti6TlQCzupisF X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-06_09,2024-09-06_01,2024-09-02_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: Tomasz Duszynski >Sent: Monday, November 18, 2024 8:37 AM >To: Tomasz Duszynski >Cc: Ruifeng.Wang@arm.com; bruce.richardson@intel.com; david.marchand@redha= t.com; dev@dpdk.org; >Jerin Jacob ; konstantin.v.ananyev@yandex.ru; mattias.= ronnblom@ericsson.com; >mb@smartsharesystems.com; roretzla@linux.microsoft.com; stephen@networkplu= mber.org; >thomas@monjalon.net; zhoumin@loongson.cn >Subject: [PATCH v16 0/4] add support for self monitoring > >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 certai= n advantages when >application runs on isolated cores running dedicated tasks. > >Events can be read directly using rte_pmu_read() or using dedicated tracep= oint >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 a= ttached 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 even= ts are not supported. > >v16: >- fix build issue related to ALLOW_EXPERIMENTAL_API not always defined >- rename tracepoints upfront to make it easier to decouple for tracing >- minor doc improvements >- make sure non EAL threads can't read PMU >v15: >- add some basic logs related to API failures >- get rid of thread-local-storage >- do not support MT-safety (which was buggy anyway) in management APIs (rt= e_pmu_init(), > rte_pmu_fini(), rte_pmu_add_{event,events_by_pattern}() as it impacts rt= e_pmu_read() > performance because more logic needs to be incorporated to handle all co= rner cases >- improve documentation slightly >- various other improvements here and there >v14: >- replace __atomic_xxx with rte_atomic_xxx >- rebase to dpdk/main since that's a new feature >v13: >- allow init/fini calling from multiple contexts >- get rid of conditional compilation and return erors in case APIs are > used on unsupported OS >v12: >- rebase old series >- slightly refresh existing documentation >- make sure compiler won't optimize accesses to certain variables during > event readout >- drop previous Acked-by to respin a fresh review cycle >v11: >- skip fast test in case init fails >v10: >- check permissions before using counters >- do not use internal symbols in exported functions >- address review comments >v9: >- fix 'maybe-uninitialized' warning reported by CI >v8: >- just rebase series >v7: >- use per-lcore event group instead of global table index by lcore-id >- don't add pmu_autotest to fast tests because due to lack of suported > on every arch >v6: >- move codebase to the separate library >- address review comments >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): > lib: add generic support for reading PMU events > pmu: support reading ARM PMU events in runtime > pmu: support reading Intel x86_64 PMU events in runtime > eal: add PMU support to tracing library > > MAINTAINERS | 5 + > app/test/meson.build | 1 + > app/test/test_pmu.c | 55 +++ > app/test/test_trace_perf.c | 10 + > doc/api/doxy-api-index.md | 3 +- > doc/api/doxy-api.conf.in | 1 + > doc/guides/prog_guide/profile_app.rst | 31 ++ > doc/guides/prog_guide/trace_lib.rst | 32 ++ > doc/guides/rel_notes/release_24_11.rst | 7 + > lib/eal/common/eal_common_trace.c | 5 +- > lib/eal/common/eal_common_trace_pmu.c | 38 ++ > lib/eal/common/eal_common_trace_points.c | 5 + > lib/eal/common/eal_trace.h | 4 + > lib/eal/common/meson.build | 1 + > lib/eal/include/rte_eal_trace.h | 11 + > lib/eal/meson.build | 3 + > lib/eal/version.map | 1 + > lib/meson.build | 1 + > lib/pmu/meson.build | 22 + > lib/pmu/pmu_arm64.c | 94 ++++ > lib/pmu/pmu_private.h | 32 ++ > lib/pmu/rte_pmu.c | 536 +++++++++++++++++++++++ > lib/pmu/rte_pmu.h | 250 +++++++++++ > lib/pmu/rte_pmu_pmc_arm64.h | 30 ++ > lib/pmu/rte_pmu_pmc_x86_64.h | 24 + > lib/pmu/version.map | 15 + > 26 files changed, 1215 insertions(+), 2 deletions(-) create mode 100644 = app/test/test_pmu.c >create mode 100644 lib/eal/common/eal_common_trace_pmu.c > create mode 100644 lib/pmu/meson.build > create mode 100644 lib/pmu/pmu_arm64.c > 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/rte_pmu_pmc_arm64.h create = mode 100644 >lib/pmu/rte_pmu_pmc_x86_64.h create mode 100644 lib/pmu/version.map > >-- >2.34.1 Hi,=20 Any more comments on this?