tools/testing/selftests/bpf/test_kmods/bpf_testmod.h
Source file repositories/reference/linux-study-clean/tools/testing/selftests/bpf/test_kmods/bpf_testmod.h
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/bpf/test_kmods/bpf_testmod.h- Extension
.h- Size
- 3074 bytes
- Lines
- 129
- 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/types.h
Detected Declarations
struct task_structstruct cgroupstruct bpf_testmod_test_read_ctxstruct bpf_testmod_test_write_ctxstruct bpf_testmod_test_writable_ctxstruct bpf_iter_testmod_seqstruct bpf_testmod_opsstruct bpf_testmod_ops2struct bpf_testmod_ops3struct st_ops_argsstruct bpf_testmod_st_opsstruct bpf_testmod_multi_st_ops
Annotated Snippet
struct bpf_testmod_test_read_ctx {
char *buf;
loff_t off;
size_t len;
};
struct bpf_testmod_test_write_ctx {
char *buf;
loff_t off;
size_t len;
};
struct bpf_testmod_test_writable_ctx {
bool early_ret;
int val;
};
/* BPF iter that returns *value* *n* times in a row */
struct bpf_iter_testmod_seq {
s64 value;
int cnt;
};
struct bpf_testmod_ops {
int (*test_1)(void);
void (*test_2)(int a, int b);
/* Used to test nullable arguments. */
int (*test_maybe_null)(int dummy, struct task_struct *task);
int (*unsupported_ops)(void);
/* Used to test ref_acquired arguments. */
int (*test_refcounted)(int dummy, struct task_struct *task);
/* Used to test checking of __ref arguments when it not the first argument. */
int (*test_refcounted_multi)(int dummy, struct task_struct *task,
struct task_struct *task2);
/* Used to test returning referenced kptr. */
struct task_struct *(*test_return_ref_kptr)(int dummy, struct task_struct *task,
struct cgroup *cgrp);
/* The following fields are used to test shadow copies. */
char onebyte;
struct {
int a;
int b;
} unsupported;
int data;
/* The following pointers are used to test the maps having multiple
* pages of trampolines.
*/
int (*tramp_1)(int value);
int (*tramp_2)(int value);
int (*tramp_3)(int value);
int (*tramp_4)(int value);
int (*tramp_5)(int value);
int (*tramp_6)(int value);
int (*tramp_7)(int value);
int (*tramp_8)(int value);
int (*tramp_9)(int value);
int (*tramp_10)(int value);
int (*tramp_11)(int value);
int (*tramp_12)(int value);
int (*tramp_13)(int value);
int (*tramp_14)(int value);
int (*tramp_15)(int value);
int (*tramp_16)(int value);
int (*tramp_17)(int value);
int (*tramp_18)(int value);
int (*tramp_19)(int value);
int (*tramp_20)(int value);
int (*tramp_21)(int value);
int (*tramp_22)(int value);
int (*tramp_23)(int value);
int (*tramp_24)(int value);
int (*tramp_25)(int value);
int (*tramp_26)(int value);
int (*tramp_27)(int value);
int (*tramp_28)(int value);
int (*tramp_29)(int value);
int (*tramp_30)(int value);
int (*tramp_31)(int value);
int (*tramp_32)(int value);
int (*tramp_33)(int value);
int (*tramp_34)(int value);
int (*tramp_35)(int value);
int (*tramp_36)(int value);
int (*tramp_37)(int value);
int (*tramp_38)(int value);
int (*tramp_39)(int value);
int (*tramp_40)(int value);
};
Annotation
- Immediate include surface: `linux/types.h`.
- Detected declarations: `struct task_struct`, `struct cgroup`, `struct bpf_testmod_test_read_ctx`, `struct bpf_testmod_test_write_ctx`, `struct bpf_testmod_test_writable_ctx`, `struct bpf_iter_testmod_seq`, `struct bpf_testmod_ops`, `struct bpf_testmod_ops2`, `struct bpf_testmod_ops3`, `struct st_ops_args`.
- 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.