tools/testing/selftests/bpf/prog_tests/timer_lockup.c
Source file repositories/reference/linux-study-clean/tools/testing/selftests/bpf/prog_tests/timer_lockup.c
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/bpf/prog_tests/timer_lockup.c- Extension
.c- Size
- 2187 bytes
- Lines
- 102
- 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
sched.htest_progs.hpthread.hnetwork_helpers.hsys/sysinfo.htimer_lockup.skel.h
Detected Declarations
function test_timer_lockup
Annotated Snippet
if (i > 50) {
WRITE_ONCE(skip, true);
break;
}
}
return NULL;
}
void test_timer_lockup(void)
{
int timer1_prog, timer2_prog;
struct timer_lockup *skel;
pthread_t thrds[2];
void *ret;
if (get_nprocs() < 2) {
test__skip();
return;
}
skel = timer_lockup__open_and_load();
if (!skel && errno == EOPNOTSUPP) {
test__skip();
return;
}
if (!ASSERT_OK_PTR(skel, "timer_lockup__open_and_load"))
return;
timer1_prog = bpf_program__fd(skel->progs.timer1_prog);
timer2_prog = bpf_program__fd(skel->progs.timer2_prog);
timer1_err = &skel->bss->timer1_err;
timer2_err = &skel->bss->timer2_err;
if (!ASSERT_OK(pthread_create(&thrds[0], NULL, timer_lockup_thread,
&timer1_prog),
"pthread_create thread1"))
goto out;
if (!ASSERT_OK(pthread_create(&thrds[1], NULL, timer_lockup_thread,
&timer2_prog),
"pthread_create thread2")) {
pthread_exit(&thrds[0]);
goto out;
}
pthread_join(thrds[1], &ret);
pthread_join(thrds[0], &ret);
if (skip) {
test__skip();
goto out;
}
if (*timer1_err != -EDEADLK && *timer1_err != 0)
ASSERT_FAIL("timer1_err bad value");
if (*timer2_err != -EDEADLK && *timer2_err != 0)
ASSERT_FAIL("timer2_err bad value");
out:
timer_lockup__destroy(skel);
return;
}
Annotation
- Immediate include surface: `sched.h`, `test_progs.h`, `pthread.h`, `network_helpers.h`, `sys/sysinfo.h`, `timer_lockup.skel.h`.
- Detected declarations: `function test_timer_lockup`.
- 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.