From: Song Liu <songliubraving@fb.com>
To: <linux-kernel@vger.kernel.org>, <bpf@vger.kernel.org>,
<netdev@vger.kernel.org>
Cc: <ast@kernel.org>, <daniel@iogearbox.net>, <kernel-team@fb.com>,
<john.fastabend@gmail.com>, <kpsingh@chromium.org>,
<brouer@redhat.com>, <peterz@infradead.org>,
Song Liu <songliubraving@fb.com>
Subject: [PATCH v3 bpf-next 0/2] bpf: fix stackmap on perf_events with PEBS
Date: Thu, 16 Jul 2020 15:59:31 -0700 [thread overview]
Message-ID: <20200716225933.196342-1-songliubraving@fb.com> (raw)
Calling get_perf_callchain() on perf_events from PEBS entries may cause
unwinder errors. To fix this issue, perf subsystem fetches callchain early,
and marks perf_events are marked with __PERF_SAMPLE_CALLCHAIN_EARLY.
Similar issue exists when BPF program calls get_perf_callchain() via
helper functions. For more information about this issue, please refer to
discussions in [1].
This set fixes this issue with helper proto bpf_get_stackid_pe and
bpf_get_stack_pe.
[1] https://lore.kernel.org/lkml/ED7B9430-6489-4260-B3C5-9CFA2E3AA87A@fb.com/
Changes v2 => v3:
1. Fix handling of stackmap skip field. (Andrii)
2. Simplify the code in a few places. (Andrii)
Changes v1 => v2:
1. Simplify the design and avoid introducing new helper function. (Andrii)
Song Liu (2):
bpf: separate bpf_get_[stack|stackid] for perf events BPF
selftests/bpf: add callchain_stackid
include/linux/bpf.h | 2 +
kernel/bpf/stackmap.c | 202 ++++++++++++++++--
kernel/trace/bpf_trace.c | 4 +-
.../bpf/prog_tests/perf_event_stackmap.c | 116 ++++++++++
.../selftests/bpf/progs/perf_event_stackmap.c | 59 +++++
5 files changed, 363 insertions(+), 20 deletions(-)
create mode 100644 tools/testing/selftests/bpf/prog_tests/perf_event_stackmap.c
create mode 100644 tools/testing/selftests/bpf/progs/perf_event_stackmap.c
--
2.24.1
next reply other threads:[~2020-07-16 23:45 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-16 22:59 Song Liu [this message]
2020-07-16 22:59 ` [PATCH v3 bpf-next 1/2] bpf: separate bpf_get_[stack|stackid] for perf events BPF Song Liu
2020-07-21 19:10 ` Alexei Starovoitov
2020-07-21 22:40 ` Song Liu
2020-07-21 22:43 ` Alexei Starovoitov
2020-07-21 22:51 ` Song Liu
2020-07-22 15:40 ` Peter Zijlstra
2020-07-22 16:49 ` Song Liu
2020-07-16 22:59 ` [PATCH v3 bpf-next 2/2] selftests/bpf: add callchain_stackid Song Liu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200716225933.196342-1-songliubraving@fb.com \
--to=songliubraving@fb.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=brouer@redhat.com \
--cc=daniel@iogearbox.net \
--cc=john.fastabend@gmail.com \
--cc=kernel-team@fb.com \
--cc=kpsingh@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.