[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200126045236.d6ah2l7joxtthdw6@ast-mbp>
Date: Sat, 25 Jan 2020 20:52:38 -0800
From: Alexei Starovoitov <alexei.starovoitov@...il.com>
To: Yonghong Song <yhs@...com>
Cc: Daniel Xu <dxu@...uu.xyz>, bpf <bpf@...r.kernel.org>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Song Liu <songliubraving@...com>,
Andrii Nakryiko <andriin@...com>,
LKML <linux-kernel@...r.kernel.org>,
Kernel Team <Kernel-team@...com>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>
Subject: Re: [PATCH v5 bpf-next 2/2] selftests/bpf: add
bpf_read_branch_records() selftest
On Sun, Jan 26, 2020 at 04:50:14AM +0000, Yonghong Song wrote:
>
>
> On 1/25/20 8:10 PM, Daniel Xu wrote:
> > On Sat Jan 25, 2020 at 6:53 PM, Alexei Starovoitov wrote:
> >> On Sat, Jan 25, 2020 at 2:32 PM Daniel Xu <dxu@...uu.xyz> wrote:
> >>> + attr.type = PERF_TYPE_HARDWARE;
> >>> + attr.config = PERF_COUNT_HW_CPU_CYCLES;
> >>> + attr.freq = 1;
> >>> + attr.sample_freq = 4000;
> >>> + attr.sample_type = PERF_SAMPLE_BRANCH_STACK;
> >>> + attr.branch_sample_type = PERF_SAMPLE_BRANCH_USER | PERF_SAMPLE_BRANCH_ANY;
> >>> + pfd = syscall(__NR_perf_event_open, &attr, -1, 0, -1, PERF_FLAG_FD_CLOEXEC);
> >>> + if (CHECK(pfd < 0, "perf_event_open", "err %d\n", pfd))
> >>> + goto out_destroy;
> >>
> >>
> >> It's failing for me in kvm. Is there way to make it work?
> >> CIs will be vm based too. If this test requires physical host
> >> such test will keep failing in all such environments.
> >> Folks will be annoyed and eventually will disable the test.
> >> Can we figure out how to test in the vm from the start?
> >
> > It seems there's a patchset that's adding LBR support to guest hosts:
> > https://lkml.org/lkml/2019/8/6/215 . However it seems to be stuck in
> > review limbo. Is there anything we can do to help that set along?
> >
> > As far as hacking it, nothing really comes to mind. Seems that patchset
> > is our best hope.
>
> prog_tests/send_signal.c tests send_signal helper under nmi with
> hardware counters. It added a check to see whether the underlying
> hardware counter is supported, if it is not, the test is
> skipped.
>
> Maybe we can use the same appraoch here. If perf_event_open with
> PERF_TYPE_HARDWARE/PERF_SAMPLE_BRANCH_STACK failed,
> we just mark the test as skipped instead of failing.
Instead of failing and skipping the test how about making it test error case?
Like instead of lbr perf_event some other event can be passed into bpf prog.
New helper can still be called and in such case it should return einval?
Powered by blists - more mailing lists