History

bpf: Separate bpf_get_[stack|stackid] for perf events BPF

Calling get_perf_callchain() on perf_events from PEBS entries may cause unwinder errors. To fix this issue, the callchain is fetched early. Such perf_events are marked with __PERF_SAMPLE_CALLCHAIN_EARLY. Similarly, calling bpf_get_[stack|stackid] on perf_events from PEBS may also cause unwinder errors. To fix this, add separate version of these two helpers, bpf_get_[stack|stackid]_pe. These two hepers use callchain in bpf_perf_event_data_kern->data->callchain.

Song Liu committed 6 years ago

Commit 7b04d6d1 parent 909e4463 files · +170 −20Browse files

Showing the changes to include/linux (1 of 3 files). Show all

Unified · Split

include/linux/bpf.h+2−0
@@ -1675,6 +1675,8 @@ extern const struct bpf_func_proto bpf_get_current_comm_proto; · 1674 unmodified lines
16751675 extern const struct bpf_func_proto bpf_get_stackid_proto;
16761676 extern const struct bpf_func_proto bpf_get_stack_proto;
16771677 extern const struct bpf_func_proto bpf_get_task_stack_proto;
1678+extern const struct bpf_func_proto bpf_get_stackid_proto_pe;
1679+extern const struct bpf_func_proto bpf_get_stack_proto_pe;
16781680 extern const struct bpf_func_proto bpf_sock_map_update_proto;
16791681 extern const struct bpf_func_proto bpf_sock_hash_update_proto;
16801682 extern const struct bpf_func_proto bpf_get_current_cgroup_id_proto;