-
Notifications
You must be signed in to change notification settings - Fork 149
Pass external callchain entry to get_perf_callchain #10235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: bpf-next_base
Are you sure you want to change the base?
Conversation
From BPF stack map, we want to ensure that the callchain buffer will not be overwritten by other preemptive tasks. Peter suggested provide more flexible stack-sampling APIs, which can be used in BPF, and we can still use the perf callchain entry with the help of these APIs. The next patch will modify the BPF part. In the future, these APIs will also make it convenient for us to add stack-sampling kfuncs in the eBPF subsystem, just as Andrii and Alexei discussed earlier. Signed-off-by: Peter Zijlstra <peterz@infradead.org> Signed-off-by: Tao Chen <chen.dylane@linux.dev>
From BPF side, preemption usually is enabled. Yonghong said, it is possible that both tasks (at process level) may reach right before "recursion[rctx]++;". In such cases, both tasks will be able to get buffer and this is not right. Signed-off-by: Yonghong Song <yonghong.song@linux.dev> Signed-off-by: Tao Chen <chen.dylane@linux.dev>
As Alexei noted, get_perf_callchain() return values may be reused if a task is preempted after the BPF program enters migrate disable mode. The perf_callchain_entres has a small stack of entries, and we can reuse it as follows: 1. get the perf callchain entry 2. BPF use... 3. put the perf callchain entry Signed-off-by: Tao Chen <chen.dylane@linux.dev>
|
Upstream branch: f8c67d8 |
AI reviewed your patch. Please fix the bug or email reply why it's not a bug. In-Reply-To-Subject: |
|
Forwarding comment 3508522226 via email |
Pull request for series with
subject: Pass external callchain entry to get_perf_callchain
version: 5
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=1021316