>-----Original Message-----
>From: Stephen Hemminger <step...@networkplumber.org>
>Sent: Friday, October 11, 2024 4:19 PM
>To: Konstantin Ananyev <konstantin.anan...@huawei.com>
>Cc: Tomasz Duszynski <tduszyn...@marvell.com>; Thomas Monjalon
><tho...@monjalon.net>;
>ruifeng.w...@arm.com; bruce.richard...@intel.com; david.march...@redhat.com;
>dev@dpdk.org; Jerin
>Jacob <jer...@marvell.com>; konstantin.v.anan...@yandex.ru;
>mattias.ronnb...@ericsson.com;
>m...@smartsharesystems.com; roret...@linux.microsoft.com; zhou...@loongson.cn
>Subject: [EXTERNAL] Re: [PATCH v14 1/4] lib: add generic support for reading
>PMU events
>
>On Fri, 11 Oct 2024 11: 56: 04 +0000 Konstantin Ananyev <konstantin. ananyev@
>huawei. com> wrote: >
>> + * > > + * @return > > + * 0 in case of success, negative value otherwise.
>> > > + */ > >
>+__rte_experimental
>On Fri, 11 Oct 2024 11:56:04 +0000
>Konstantin Ananyev <konstantin.anan...@huawei.com> wrote:
>
>> > + *
>> > + * @return
>> > + * 0 in case of success, negative value otherwise.
>> > + */
>> > +__rte_experimental
>> > +int
>> > +rte_pmu_init(void);
>> > +
>> > +/**
>> > + * @warning
>> > + * @b EXPERIMENTAL: this API may change without prior notice
>> > + *
>> > + * Finalize PMU library. This should be called after PMU counters are no
>> > longer being read.
>> > + */
>> > +__rte_experimental
>> > +void
>> > +rte_pmu_fini(void);
>>
>> Hmm..., why _fini_() is allowed to be called directly while _init_() doesn't?
>
>Is this handled by destructor, called from rte_eal_cleanup() and/or testpmd?
If fast tracepoint is enabled then this is called by eal_trace_fini() which is
called by eal_trace_cleanup().
If fast tracepoint is disabled user should call it himself. Though, that
counter reading works best with fast trace point because everything is handled
automatically.