lkml.org 
[lkml]   [2020]   [Jul]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v3 bpf-next 1/2] bpf: separate bpf_get_[stack|stackid] for perf events BPF
Date


> On Jul 21, 2020, at 3:43 PM, Alexei Starovoitov <alexei.starovoitov@gmail.com> wrote:
>
> On Tue, Jul 21, 2020 at 3:40 PM Song Liu <songliubraving@fb.com> wrote:
>>
>> We only need to block precise_ip >= 2. precise_ip == 1 is OK.
>
> Are you sure?
> intel_pmu_hw_config() has:
> if (event->attr.precise_ip) {
> if (event->attr.sample_type & PERF_SAMPLE_CALLCHAIN)
> event->attr.sample_type |= __PERF_SAMPLE_CALLCHAIN_EARLY;
> }

The bit that breaks the unwinder was in setup_pebs_fixed_sample_data():

if (x86_pmu.intel_cap.pebs_format >= 2) {
set_linear_ip(regs, pebs->real_ip);
regs->flags |= PERF_EFLAGS_EXACT;
}

"real_ip" causes the issue.

But on a second thought, it is probably better also blocks precise_ip == 1,
to match the logic in intel_pmu_hw_config().

Thanks,
Song
\
 
 \ /
  Last update: 2020-07-22 00:52    [W:0.056 / U:1.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site