Re: [PATCH] perf events: Add stalled cycles generic event -PERF_COUNT_HW_STALLED_CYCLES
From: Ingo Molnar
Date: Wed Apr 27 2011 - 12:27:40 EST
* Ingo Molnar <mingo@xxxxxxx> wrote:
> > [...] why not pick cycles where no uops are retiring?
> >
> > cycles_no_uops_retired = cycles - c["UOPS_RETIRED:ANY:c=1:t=1"]
> >
> > In the presence of C-states and some halted cycles, I found that I couldn't
> > measure it via UOPS_RETIRED:ANY:c=1:i=1 because it counts halted cycles too
> > and could be greater than (unhalted) cycles.
>
> Agreed, good point.
>
> You are right that it is more robust to pick 'the CPU was busy on our behalf'
> metric instead of a 'CPU is idle' metric, because that way 'HLT' as a special
> type of idling around does not have to be identified.
Sidenote, there's one advantage of the idle event: it's more meaningful to
profile idle cycles - and it's easy to ignore the HLT loop in the profile
output (we already do).
That way we get a 'hidden overhead' profile: a profile of frequently executed
code which executes in the CPU in a suboptimal way.
So we should probably offer both events.
Thanks,
Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/