Re: WARNING with LBR + precise_ip=2 + bpf_get_stackid()

From: Peter Zijlstra
Date: Fri Jun 19 2020 - 04:15:42 EST


On Thu, Jun 18, 2020 at 03:35:55PM -0700, Andi Kleen wrote:
> > We noticed that this only happens with precise_ip >= 2. This is caused by
> > setup_pebs_fixed_sample_data() using pens->real_ip:
> >
> > set_linear_ip(regs, pebs->real_ip);
>
> With precise_ip == 1 the IP will be one instruction behind.
> That's the only difference to 2 or 3.
>
> So something about the actual instruction confuses the unwinder.

It's trying to do an unwind with the PEBS IP (or worse the whole PEBS
regset), which doesn't match the interrupt IP or the stack layout at
that time. Of course it doesn't work.