[EXT] Re: [PATCH v5 0/4] add support for self monitoring

Tomasz Duszynski tduszynski at marvell.com
Wed Jan 11 10:39:35 CET 2023


Hi Tyler,

>-----Original Message-----
>From: Tyler Retzlaff <roretzla at linux.microsoft.com>
>Sent: Wednesday, January 11, 2023 1:32 AM
>To: Tomasz Duszynski <tduszynski at marvell.com>; bruce.richardson at intel.com; mb at smartsharesystems.com
>Cc: dev at dpdk.org; thomas at monjalon.net; Jerin Jacob Kollanukkaran <jerinj at marvell.com>;
>mb at smartsharesystems.com; Ruifeng.Wang at arm.com; mattias.ronnblom at ericsson.com; zhoumin at 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 like a clear example of
>something that doesn't belong in the EAL. has there been a discussion as to whether or not this
>should be in a separate library?

No, I don't recall anybody having any concerns about the code placement. Rationale behind 
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 came out naturally. 

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 that. Which means
both can be used independently. 

That said, since this code has both platform agnostic and platform specific parts this can either be split into: 
1. library + eal platform code
2. all under eal 

Either approach seems legit. Thoughts?

>
>a basic test is whether or not an implementation exists or can be reasonably provided for all
>platforms and that isn't strictly evident here. red flag is to see yet more code being added
>conditionally compiled for a single platform.

Even libs are not entirely pristine and have platform specific ifdefs lurking so not sure where
this red flag is coming from. 

>
>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


More information about the dev mailing list