[PATCH v3 2/4] eal: allow applications to report their cpu cycles usage

Morten Brørup mb at smartsharesystems.com
Wed Dec 7 12:21:05 CET 2022


> From: Robin Jarry [mailto:rjarry at redhat.com]
> Sent: Wednesday, 7 December 2022 12.01
> 
> Hi Mattias,
> 
> Mattias Rönnblom, Nov 29, 2022 at 17:10:
> > > + * @param [out] busy_cycles
> > > + *   The number of busy CPU cycles since the application start.
> >
> > Wouldn't it be more appropriate to describe it as "TSC cycles",
> instead
> > of "CPU cycles"? Or technically "The amount of busy time since
> > application start, in TSC cycles".
> >
> > Reporting actual CPU core cycles spent is not possible, in the
> general case.
> 
> Well, technically, these "cycles" could mean anything. You could report
> the number of microseconds, Joules, whatever. The important information
> is the ratio compared to the total number of "cycles". Perhaps Morten's
> suggestion (units) would be more precise, but I fear it would also be
> more confusing.
> 
> I don't mind adding the specific TSC cycles nomenclature if there is
> a consensus.

Let's stick with TSC cycles. As you mention yourself, sometimes clarity is better than abstraction.

Having a fixed unit of measure also makes it easier to use in DPDK libraries and wherever, in the future.

-Morten



More information about the dev mailing list