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 CDE1042439; Fri, 20 Jan 2023 19:29:34 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7167E40E5A; Fri, 20 Jan 2023 19:29:34 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 129134067E for ; Fri, 20 Jan 2023 19:29:32 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 553F220E0A23; Fri, 20 Jan 2023 10:29:31 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 553F220E0A23 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1674239371; bh=m86t+BedRVOIclV6YaJJEp0lEv+0Qnjn9FJTD3Ts+ag=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=KICauOqLldM5EoE1fypwxpPSYlacTlBJodo00agsDTAim9gr7+F+oXpJqEG9f6SiK QhlGwD7vbMoN3OArUANQ8G968Srj4io3WGbayOdUUJpap8ZqRekkoSc/CvSJkRcF5d NEpU1JaKe2N2WyW+NYhDmGd4nc91gml7TGTEgfgY= Date: Fri, 20 Jan 2023 10:29:31 -0800 From: Tyler Retzlaff To: Tomasz Duszynski Cc: dev@dpdk.org, Thomas Monjalon , jerinj@marvell.com, mb@smartsharesystems.com, Ruifeng.Wang@arm.com, mattias.ronnblom@ericsson.com, zhoumin@loongson.cn, bruce.richardson@intel.com Subject: Re: [PATCH v6 1/4] lib: add generic support for reading PMU events Message-ID: <20230120182931.GA5224@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <20230110234642.1188550-1-tduszynski@marvell.com> <20230119233916.4029128-1-tduszynski@marvell.com> <20230119233916.4029128-2-tduszynski@marvell.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230119233916.4029128-2-tduszynski@marvell.com> User-Agent: Mutt/1.5.21 (2010-09-15) 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 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 += ['test_metrics.c'] > fast_tests += [['metrics_autotest', true, true]] > endif > +if is_linux > + test_sources += ['test_pmu.c'] > + fast_tests += [['pmu_autotest', true, true]] > +endif traditionally we don't conditionally include tests at the meson.build level, 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 skipped on windows, i'm sure it could be adapted to skip on freebsd if you aren't supporting it.