tools/testing/selftests/sched_ext/non_scx_kfunc_deny.c
Source file repositories/reference/linux-study-clean/tools/testing/selftests/sched_ext/non_scx_kfunc_deny.c
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/sched_ext/non_scx_kfunc_deny.c- Extension
.c- Size
- 1252 bytes
- Lines
- 48
- 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
bpf/bpf.hscx/common.hunistd.herrno.hstdio.hnon_scx_kfunc_deny.bpf.skel.hscx_test.h
Detected Declarations
function Copyright
Annotated Snippet
#include <bpf/bpf.h>
#include <scx/common.h>
#include <unistd.h>
#include <errno.h>
#include <stdio.h>
#include "non_scx_kfunc_deny.bpf.skel.h"
#include "scx_test.h"
static enum scx_test_status run(void *ctx)
{
struct non_scx_kfunc_deny *skel;
int err;
skel = non_scx_kfunc_deny__open();
if (!skel) {
SCX_ERR("Failed to open skel");
return SCX_TEST_FAIL;
}
err = non_scx_kfunc_deny__load(skel);
non_scx_kfunc_deny__destroy(skel);
if (err == 0) {
SCX_ERR("non-SCX BPF program loaded when it should have been rejected");
return SCX_TEST_FAIL;
}
return SCX_TEST_PASS;
}
struct scx_test non_scx_kfunc_deny = {
.name = "non_scx_kfunc_deny",
.description = "Verify that non-SCX struct_ops programs cannot call SCX kfuncs",
.run = run,
};
REGISTER_SCX_TEST(&non_scx_kfunc_deny)
Annotation
- Immediate include surface: `bpf/bpf.h`, `scx/common.h`, `unistd.h`, `errno.h`, `stdio.h`, `non_scx_kfunc_deny.bpf.skel.h`, `scx_test.h`.
- Detected declarations: `function Copyright`.
- 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.