Message ID | 20241011094944.3586051-1-tduszynski@marvell.com (mailing list archive) |
---|---|
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 38CF945A6D; Fri, 11 Oct 2024 11:50:00 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 21CD9402E3; Fri, 11 Oct 2024 11:50:00 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 94AC14029A for <dev@dpdk.org>; Fri, 11 Oct 2024 11:49:58 +0200 (CEST) Received: from pps.filterd (m0431383.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 49B9MJOU014210; Fri, 11 Oct 2024 02:49:54 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfpt0220; bh=p 08MhSzb4pcCGvrUVaGwInnr20sRnPcK1V2PUP0uE+Q=; b=FyG1Ot9arOoHqGWbH U1ifcuYV89MS2Q90FjFMC2huOssQM7FOwTQHiDZnI1X3BAXk0aDs+wsi/6bOLByK YUKtc6wA/bEo8IQylF8Pfj42WWSoO3OqbOfvGRH02leThMPIIjHbCUd3WrNxkgRr gMJ1b3gUur3+n+A443UCoPmYQH72HWuzbSe3UhQS9dm/HZkZGwenu9W5SRDDPO+W LmiWdAxYD7Y+nYq8DUl6KtKVolwCC0Q8DlaChDoZDdEJulYhn4nwfcgHY2al+qON NVUgG6Fc9fCKgVMJL+crTvWEhPxrShrcqZd1wpMRSR4Gn+EB4QWXQFLLN4fJ4q7J hoCOg== Received: from dc5-exch05.marvell.com ([199.233.59.128]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 4271b201m6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 11 Oct 2024 02:49:54 -0700 (PDT) Received: from DC5-EXCH05.marvell.com (10.69.176.209) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Fri, 11 Oct 2024 02:49:52 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Fri, 11 Oct 2024 02:49:52 -0700 Received: from cavium-optiplex-3070-BM15.. (unknown [10.28.34.39]) by maili.marvell.com (Postfix) with ESMTP id EA97E3F704E; Fri, 11 Oct 2024 02:49:48 -0700 (PDT) From: Tomasz Duszynski <tduszynski@marvell.com> To: <tduszynski@marvell.com> CC: <Ruifeng.Wang@arm.com>, <bruce.richardson@intel.com>, <david.marchand@redhat.com>, <dev@dpdk.org>, <jerinj@marvell.com>, <konstantin.v.ananyev@yandex.ru>, <mattias.ronnblom@ericsson.com>, <mb@smartsharesystems.com>, <roretzla@linux.microsoft.com>, <thomas@monjalon.net>, <zhoumin@loongson.cn>, <stephen@networkplumber.org> Subject: [PATCH v14 0/4] add support for self monitoring Date: Fri, 11 Oct 2024 11:49:40 +0200 Message-ID: <20241011094944.3586051-1-tduszynski@marvell.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241009112308.2973903-1-tduszynski@marvell.com> References: <20241009112308.2973903-1-tduszynski@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: mI8bIcfc9WvQv0Fjo8mVYcceT8h6B73k X-Proofpoint-ORIG-GUID: mI8bIcfc9WvQv0Fjo8mVYcceT8h6B73k X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.687,Hydra:6.0.235,FMLib:17.0.607.475 definitions=2020-10-13_15,2020-10-13_02,2020-04-07_01 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions <dev.dpdk.org> List-Unsubscribe: <https://mails.dpdk.org/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://mails.dpdk.org/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <https://mails.dpdk.org/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org |
Series | add support for self monitoring | |
Message
Tomasz Duszynski
Oct. 11, 2024, 9:49 a.m. UTC
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 advantages when application runs on isolated cores running dedicated tasks. 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. 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 | 59 +++ app/test/test_trace_perf.c | 4 + doc/api/doxy-api-index.md | 3 +- doc/api/doxy-api.conf.in | 1 + doc/guides/prog_guide/profile_app.rst | 34 ++ doc/guides/prog_guide/trace_lib.rst | 32 ++ doc/guides/rel_notes/release_24_11.rst | 7 + lib/eal/common/eal_common_trace.c | 7 +- lib/eal/common/eal_common_trace_points.c | 5 + lib/eal/include/rte_eal_trace.h | 9 + lib/eal/meson.build | 2 +- lib/eal/version.map | 3 + lib/meson.build | 1 + lib/pmu/meson.build | 21 + lib/pmu/pmu_arm64.c | 94 ++++ lib/pmu/pmu_private.h | 32 ++ lib/pmu/rte_pmu.c | 524 +++++++++++++++++++++++ lib/pmu/rte_pmu.h | 251 +++++++++++ lib/pmu/rte_pmu_pmc_arm64.h | 30 ++ lib/pmu/rte_pmu_pmc_x86_64.h | 24 ++ lib/pmu/version.map | 15 + 23 files changed, 1161 insertions(+), 3 deletions(-) create mode 100644 app/test/test_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