lib/kunit/hooks.c
Source file repositories/reference/linux-study-clean/lib/kunit/hooks.c
File Facts
- System
- Linux kernel
- Corpus path
lib/kunit/hooks.c- Extension
.c- Size
- 477 bytes
- Lines
- 22
- Domain
- Kernel Services
- Bucket
- lib
- Inferred role
- Kernel Services: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
Shared kernel service surface used by multiple subsystems, including helpers, cryptography, virtualization support, and async I/O infrastructure.
- Shared kernel service surface used by multiple subsystems, including helpers, cryptography, virtualization support, and async I/O infrastructure.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
kunit/test-bug.h
Detected Declarations
export kunit_runningexport kunit_hooks
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
/*
* KUnit 'Hooks' implementation.
*
* This file contains code / structures which should be built-in even when
* KUnit itself is built as a module.
*
* Copyright (C) 2022, Google LLC.
* Author: David Gow <davidgow@google.com>
*/
#include <kunit/test-bug.h>
DEFINE_STATIC_KEY_FALSE(kunit_running);
EXPORT_SYMBOL(kunit_running);
/* Function pointers for hooks. */
struct kunit_hooks_table kunit_hooks;
EXPORT_SYMBOL(kunit_hooks);
Annotation
- Immediate include surface: `kunit/test-bug.h`.
- Detected declarations: `export kunit_running`, `export kunit_hooks`.
- Atlas domain: Kernel Services / lib.
- Implementation status: integration 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.