tools/perf/tests/workloads/thloop.c
Source file repositories/reference/linux-study-clean/tools/perf/tests/workloads/thloop.c
File Facts
- System
- Linux kernel
- Corpus path
tools/perf/tests/workloads/thloop.c- Extension
.c- Size
- 1565 bytes
- Lines
- 83
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
Dependency Surface
pthread.hstdlib.hsignal.hunistd.hlinux/compiler.h../tests.h
Detected Declarations
function sighandlerfunction test_loopfunction thloop
Annotated Snippet
if (ret) {
fprintf(stderr, "Error: failed to create thread %d\n", i);
done = 1; // Ensure started threads terminate.
goto out;
}
}
alarm(sec);
test_loop();
err = 0;
out:
for (int i = 1; i < nt; i++) {
if (thread_list && thread_list[i])
pthread_join(thread_list[i], /*retval=*/NULL);
}
free(thread_list);
return err;
}
DEFINE_WORKLOAD(thloop);
Annotation
- Immediate include surface: `pthread.h`, `stdlib.h`, `signal.h`, `unistd.h`, `linux/compiler.h`, `../tests.h`.
- Detected declarations: `function sighandler`, `function test_loop`, `function thloop`.
- Atlas domain: Support Tooling And Documentation / tools.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.