linux/tools/include/uapi
Yonghong Song 8482941f09 bpf: Add bpf_send_signal_thread() helper
Commit 8b401f9ed2 ("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
2020-01-15 11:44:51 -08:00
..
asm riscv, bpf: Add missing uapi header for BPF_PROG_TYPE_PERF_EVENT programs 2019-12-19 16:03:31 +01:00
asm-generic tools headers uapi: Sync asm-generic/mman-common.h with the kernel 2019-09-30 17:28:44 -03:00
drm tools headers UAPI: Update tools's copy of drm.h headers 2019-12-04 16:22:38 -03:00
linux bpf: Add bpf_send_signal_thread() helper 2020-01-15 11:44:51 -08:00
sound tools include uapi: Sync sound/asound.h copy 2019-04-16 12:36:20 -03:00