tools/testing/selftests/bpf/prog_tests/hash_large_key.c
Source file repositories/reference/linux-study-clean/tools/testing/selftests/bpf/prog_tests/hash_large_key.c
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/bpf/prog_tests/hash_large_key.c- Extension
.c- Size
- 1038 bytes
- Lines
- 44
- 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
test_progs.htest_hash_large_key.skel.h
Detected Declarations
struct bigelementfunction test_hash_large_key
Annotated Snippet
struct bigelement {
int a;
char b[4096];
long long c;
} key;
bzero(&key, sizeof(key));
skel = test_hash_large_key__open_and_load();
if (CHECK(!skel, "skel_open_and_load", "skeleton open/load failed\n"))
return;
hash_map_fd = bpf_map__fd(skel->maps.hash_map);
if (CHECK(hash_map_fd < 0, "bpf_map__fd", "failed\n"))
goto cleanup;
err = test_hash_large_key__attach(skel);
if (CHECK(err, "attach_raw_tp", "err %d\n", err))
goto cleanup;
err = bpf_map_update_elem(hash_map_fd, &key, &value, BPF_ANY);
if (CHECK(err, "bpf_map_update_elem", "errno=%d\n", errno))
goto cleanup;
key.c = 1;
err = bpf_map_lookup_elem(hash_map_fd, &key, &value);
if (CHECK(err, "bpf_map_lookup_elem", "errno=%d\n", errno))
goto cleanup;
CHECK_FAIL(value != 42);
cleanup:
test_hash_large_key__destroy(skel);
}
Annotation
- Immediate include surface: `test_progs.h`, `test_hash_large_key.skel.h`.
- Detected declarations: `struct bigelement`, `function test_hash_large_key`.
- 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.