tools/testing/selftests/kvm/lib/assert.c
Source file repositories/reference/linux-study-clean/tools/testing/selftests/kvm/lib/assert.c
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/kvm/lib/assert.c- Extension
.c- Size
- 2318 bytes
- Lines
- 103
- 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.
Dependency Surface
test_util.hsys/syscall.hkselftest.hexecinfo.h
Detected Declarations
function test_dump_stackfunction test_dump_stackfunction __attribute__
Annotated Snippet
static void test_dump_stack(void) {}
#endif
static pid_t _gettid(void)
{
return syscall(SYS_gettid);
}
void __attribute__((noinline))
test_assert(bool exp, const char *exp_str,
const char *file, unsigned int line, const char *fmt, ...)
{
va_list ap;
if (!(exp)) {
va_start(ap, fmt);
fprintf(stderr, "==== Test Assertion Failure ====\n"
" %s:%u: %s\n"
" pid=%d tid=%d errno=%d - %s\n",
file, line, exp_str, getpid(), _gettid(),
errno, strerror(errno));
test_dump_stack();
if (fmt) {
fputs(" ", stderr);
vfprintf(stderr, fmt, ap);
fputs("\n", stderr);
}
va_end(ap);
if (errno == EACCES) {
print_skip("Access denied - Exiting");
exit(KSFT_SKIP);
}
exit(254);
}
return;
}
Annotation
- Immediate include surface: `test_util.h`, `sys/syscall.h`, `kselftest.h`, `execinfo.h`.
- Detected declarations: `function test_dump_stack`, `function test_dump_stack`, `function __attribute__`.
- 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.