tools/testing/selftests/bpf/progs/test_send_signal_kern.c
Source file repositories/reference/linux-study-clean/tools/testing/selftests/bpf/progs/test_send_signal_kern.c
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/bpf/progs/test_send_signal_kern.c- Extension
.c- Size
- 1531 bytes
- Lines
- 70
- Domain
- Support Tooling And Documentation
- Bucket
- tools
- Inferred role
- Support Tooling And Documentation: implementation source
- Status
- source implementation candidate
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
vmlinux.hlinux/version.hbpf/bpf_helpers.h
Detected Declarations
function bpf_send_signal_testfunction send_signal_tpfunction send_signal_tp_schedfunction send_signal_perf
Annotated Snippet
if (target_pid) {
target_task = bpf_task_from_pid(target_pid);
if (!target_task)
return 0;
value = 8;
}
if (signal_thread) {
if (target_pid)
ret = bpf_send_signal_task(target_task, sig, PIDTYPE_PID, value);
else
ret = bpf_send_signal_thread(sig);
} else {
if (target_pid)
ret = bpf_send_signal_task(target_task, sig, PIDTYPE_TGID, value);
else
ret = bpf_send_signal(sig);
}
if (ret == 0)
status = 1;
}
if (target_task)
bpf_task_release(target_task);
return 0;
}
SEC("tracepoint/syscalls/sys_enter_nanosleep")
int send_signal_tp(void *ctx)
{
return bpf_send_signal_test(ctx);
}
SEC("tracepoint/sched/sched_switch")
int send_signal_tp_sched(void *ctx)
{
return bpf_send_signal_test(ctx);
}
SEC("perf_event")
int send_signal_perf(void *ctx)
{
return bpf_send_signal_test(ctx);
}
char __license[] SEC("license") = "GPL";
Annotation
- Immediate include surface: `vmlinux.h`, `linux/version.h`, `bpf/bpf_helpers.h`.
- Detected declarations: `function bpf_send_signal_test`, `function send_signal_tp`, `function send_signal_tp_sched`, `function send_signal_perf`.
- Atlas domain: Support Tooling And Documentation / tools.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.