Re: [REGRESSION] 'perf mem record' on a Intel hybrid system broken
From: Namhyung Kim
Date: Wed Dec 11 2024 - 13:48:36 EST
On Wed, Dec 11, 2024 at 12:55:03PM -0500, Liang, Kan wrote:
> On 2024-12-04 2:24 p.m., Namhyung Kim wrote:
> > I think I got a related report from the kernel test robot but it was a
> > Sapphire Rapids machine. I don't have a Intel hybrid machine in hand.
> > I'll try to take a look at it on Sapphire Rapids.
>
> The default precise_ip level for perf mem is always 3.
>
> For the latest intel platforms, it implies PDist, which is only
> available on GP 0.
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/x86/events/intel/core.c#n4412
>
> However, the mem-load PEBS event is available on all GP counters but GP
> 0. :(
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/x86/events/intel/ds.c#n1176
>
> So the precise_ip-- is required.
>
> The failure of scheduling returns -EINVAL.
>
> But Namhyung's patch assumes that the kernel return -EOPNOTSUPP when PMU
> doesn't support the given precise level.
> (Sorry, I didn't notice the case early.)
>
> Is it possible to reduce the precise_ip for the -EINVAL as well?
Sure, please see https://lore.kernel.org/r/Z1DV0lN8qHSysX7f@xxxxxxxxxx
Thanks,
Namhyung