tools/testing/selftests/bpf/progs/kprobe_multi_session.c
Source file repositories/reference/linux-study-clean/tools/testing/selftests/bpf/progs/kprobe_multi_session.c
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/bpf/progs/kprobe_multi_session.c- Extension
.c- Size
- 1986 bytes
- Lines
- 89
- 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
linux/bpf.hbpf/bpf_helpers.hbpf/bpf_tracing.hstdbool.hbpf_kfuncs.hbpf_misc.h
Detected Declarations
function session_checkfunction BPF_PROGfunction test_kprobefunction name
Annotated Snippet
if (kfuncs[i] == (void *) addr) {
kprobe_session_result[i]++;
break;
}
}
/*
* Force probes for function bpf_fentry_test[5-8] not to
* install and execute the return probe
*/
if (((const void *) addr == &bpf_fentry_test5) ||
((const void *) addr == &bpf_fentry_test6) ||
((const void *) addr == &bpf_fentry_test7) ||
((const void *) addr == &bpf_fentry_test8))
return 1;
return 0;
}
/*
* No tests in here, just to trigger 'bpf_fentry_test*'
* through tracing test_run
*/
SEC("fentry/bpf_modify_return_test")
int BPF_PROG(trigger)
{
return 0;
}
SEC("kprobe.session/bpf_fentry_test*")
int test_kprobe(struct pt_regs *ctx)
{
return session_check(ctx);
}
/*
* Exact function name (no wildcards) - exercises the fast syms[] path
* in bpf_program__attach_kprobe_multi_opts() which bypasses kallsyms parsing.
*/
SEC("kprobe.session/bpf_fentry_test1")
int test_kprobe_syms(struct pt_regs *ctx)
{
return session_check(ctx);
}
Annotation
- Immediate include surface: `linux/bpf.h`, `bpf/bpf_helpers.h`, `bpf/bpf_tracing.h`, `stdbool.h`, `bpf_kfuncs.h`, `bpf_misc.h`.
- Detected declarations: `function session_check`, `function BPF_PROG`, `function test_kprobe`, `function name`.
- 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.