aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf
diff options
context:
space:
mode:
authorYonghong Song <yhs@fb.com>2020-01-14 19:50:02 -0800
committerAlexei Starovoitov <ast@kernel.org>2020-01-15 11:44:51 -0800
commit8482941f09067da42f9c3362e15bfb3f3c19d610 (patch)
tree66bbf4957c6b903a77ab29ff8fa2a4104cd32e09 /tools/testing/selftests/bpf
parentxsk: Support allocations of large umems (diff)
downloadlinux-dev-8482941f09067da42f9c3362e15bfb3f3c19d610.tar.xz
linux-dev-8482941f09067da42f9c3362e15bfb3f3c19d610.zip
bpf: Add bpf_send_signal_thread() helper
Commit 8b401f9ed244 ("bpf: implement bpf_send_signal() helper") added helper bpf_send_signal() which permits bpf program to send a signal to the current process. The signal may be delivered to any threads in the process. We found a use case where sending the signal to the current thread is more preferable. - A bpf program will collect the stack trace and then send signal to the user application. - The user application will add some thread specific information to the just collected stack trace for later analysis. If bpf_send_signal() is used, user application will need to check whether the thread receiving the signal matches the thread collecting the stack by checking thread id. If not, it will need to send signal to another thread through pthread_kill(). This patch proposed a new helper bpf_send_signal_thread(), which sends the signal to the thread corresponding to the current kernel task. This way, user space is guaranteed that bpf_program execution context and user space signal handling context are the same thread. Signed-off-by: Yonghong Song <yhs@fb.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Link: https://lore.kernel.org/bpf/20200115035002.602336-1-yhs@fb.com
Diffstat (limited to 'tools/testing/selftests/bpf')
0 files changed, 0 insertions, 0 deletions