Re: [PATCH v1] perf top: Merge hybrid common events

Andi Kleen <[email protected]>
Newsgroups org.kernel.vger.linux-perf-users
Message-ID <[email protected]>
On 2026-08-18 19:58, Ian Rogers wrote:

> Since we have frequency mode on events and the periods are aggregated,
> I find it hard to fully think about the ramifications. Consider this
> example: I have two identical loops, one loop runs on a p-core and the
> other on an e-core, both accessing identical data that fits in the L1
> cache. Since the IPC on the e-core is lower, the number of cycles it
> spends in its loop should be higher. A user might mistakenly conclude
> from the higher cycle count in one loop that cache/memory issues exist
> in the e-core's loop, rather than realizing a scheduler issue caused
> that loop to run on an e-core. If we detect a hybrid system we could
> switch the default event to for all perf tools to instructions, as
> instructions don't suffer from this problem.

You already have this problem in any other system from the last 20 years 
or
so which has frequency scaling. There is nothing special here about 
hybrid.

The scheduler has some internal magic to handle problems like this, but
it's probably not directly applicable to user presented views.

In perf there is also frequency mode (which is usually used with top) 
which
kind of mitigates it anyways because it evens out the number of samples
(at the cost of some terrible statistical properties, but that's a
different chapter)

Also in general people don't look at cycle counts, they look at 
percentages
which scale per CPU.

> How can we merge non-legacy events? On ARM there is no PMU with a type
> number file with TYPE_HARDWARE.

Very few people use top with anything other than cycles, so it's 
probably
not a very urgent problem.  I suppose you could push the problem to
the user with some configuration file.

-Andi
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.