Re: [PATCH V4 07/14] perf/x86/intel: Support hardware TopDown metrics

From: Liang, Kan
Date: Mon Sep 30 2019 - 12:45:31 EST




On 9/30/2019 12:21 PM, Peter Zijlstra wrote:
{
int idx = event->hwc.idx;

if (is_metric_idx(idx))
return;

// must be FIXED_SLOTS
The FIXED_SLOTS may not be in the group.
Argh.. can we mandate that it is? that is, if you want a metric thing,
you have to have a slots counter first?

If we mandate the FIXED_SLOTS in the group, we don't need the is_first_topdown_event_in_group() check. We just update everything for FIXED_SLOTS event. It will definitely simplify the code.

For perf sub-tool, I can add warning if users missed the SLOTs event or just implicitly add the event.

For RDPMC users, it looks like there is no way to warn them.
But they should always apply for both SLOTS and METRICS?

Andi, what do you think? Will it be a problem for RDPMC users?

Thanks,
Kan