tools/testing/selftests/sync/sync_alloc.c
Source file repositories/reference/linux-study-clean/tools/testing/selftests/sync/sync_alloc.c
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/sync/sync_alloc.c- Extension
.c- Size
- 2339 bytes
- Lines
- 75
- 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
sync.hsw_sync.hsynctest.h
Detected Declarations
function filesfunction test_alloc_fencefunction test_alloc_fence_negative
Annotated Snippet
#include "sync.h"
#include "sw_sync.h"
#include "synctest.h"
int test_alloc_timeline(void)
{
int timeline, valid;
timeline = sw_sync_timeline_create();
valid = sw_sync_timeline_is_valid(timeline);
ASSERT(valid, "Failure allocating timeline\n");
sw_sync_timeline_destroy(timeline);
return 0;
}
int test_alloc_fence(void)
{
int timeline, fence, valid;
timeline = sw_sync_timeline_create();
valid = sw_sync_timeline_is_valid(timeline);
ASSERT(valid, "Failure allocating timeline\n");
fence = sw_sync_fence_create(timeline, "allocFence", 1);
valid = sw_sync_fence_is_valid(fence);
ASSERT(valid, "Failure allocating fence\n");
sw_sync_fence_destroy(fence);
sw_sync_timeline_destroy(timeline);
return 0;
}
int test_alloc_fence_negative(void)
{
int fence, timeline;
timeline = sw_sync_timeline_create();
ASSERT(timeline > 0, "Failure allocating timeline\n");
fence = sw_sync_fence_create(-1, "fence", 1);
ASSERT(fence < 0, "Success allocating negative fence\n");
sw_sync_fence_destroy(fence);
sw_sync_timeline_destroy(timeline);
return 0;
}
Annotation
- Immediate include surface: `sync.h`, `sw_sync.h`, `synctest.h`.
- Detected declarations: `function files`, `function test_alloc_fence`, `function test_alloc_fence_negative`.
- 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.