tools/tracing/rtla/tests/unit/timerlat_top_cli.c
Source file repositories/reference/linux-study-clean/tools/tracing/rtla/tests/unit/timerlat_top_cli.c
File Facts
- System
- Linux kernel
- Corpus path
tools/tracing/rtla/tests/unit/timerlat_top_cli.c- Extension
.c- Size
- 13951 bytes
- Lines
- 655
- 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
check.hstdio.hstdlib.hsched.hlimits.hunistd.hsys/sysinfo.hlinux/container_of.hcli_params_assert.h../../src/cli.h
Detected Declarations
function to_timerlat_paramsfunction START_TESTfunction START_TESTfunction START_TESTfunction START_TESTfunction START_TESTfunction START_TESTfunction START_TESTfunction START_TESTfunction START_TESTfunction START_TESTfunction START_TESTfunction START_TESTfunction START_TESTfunction START_TESTfunction START_TESTfunction START_TESTfunction START_TESTfunction START_TESTfunction START_TESTfunction START_TESTfunction START_TESTfunction START_TESTfunction START_TESTfunction START_TESTfunction START_TESTfunction START_TESTfunction START_TESTfunction START_TESTfunction START_TESTfunction START_TESTfunction START_TESTfunction START_TESTfunction START_TESTfunction START_TESTfunction START_TESTfunction START_TESTfunction START_TESTfunction START_TESTfunction START_TESTfunction START_TESTfunction START_TESTfunction START_TESTfunction START_TESTfunction START_TESTfunction START_TESTfunction START_TESTfunction START_TEST
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
#define _GNU_SOURCE
#include <check.h>
#include <stdio.h>
#include <stdlib.h>
#include <sched.h>
#include <limits.h>
#include <unistd.h>
#include <sys/sysinfo.h>
#include <linux/container_of.h>
#include "cli_params_assert.h"
#include "../../src/cli.h"
#define PARSE_ARGS(...) char *argv[] = { __VA_ARGS__, NULL };\
int argc = sizeof(argv) / sizeof(char *) - 1;\
struct common_params *params =\
timerlat_top_parse_args(argc, argv);\
struct timerlat_params *tlat_params __maybe_unused =\
to_timerlat_params(params)
/* Tracing Options */
START_TEST(test_irq_short)
{
PARSE_ARGS("timerlat", "top", "-i", "20");
ck_assert_int_eq(params->stop_us, 20);
}
END_TEST
START_TEST(test_irq_long)
{
PARSE_ARGS("timerlat", "top", "--irq", "20");
ck_assert_int_eq(params->stop_us, 20);
}
END_TEST
START_TEST(test_period_short)
{
PARSE_ARGS("timerlat", "top", "-p", "200");
ck_assert_int_eq(tlat_params->timerlat_period_us, 200);
}
END_TEST
START_TEST(test_period_long)
{
PARSE_ARGS("timerlat", "top", "--period", "200");
ck_assert_int_eq(tlat_params->timerlat_period_us, 200);
}
END_TEST
START_TEST(test_stack_short)
{
PARSE_ARGS("timerlat", "top", "-s", "20");
ck_assert_int_eq(tlat_params->print_stack, 20);
}
END_TEST
START_TEST(test_stack_long)
{
PARSE_ARGS("timerlat", "top", "--stack", "20");
ck_assert_int_eq(tlat_params->print_stack, 20);
}
END_TEST
START_TEST(test_thread_short)
{
PARSE_ARGS("timerlat", "top", "-T", "20");
ck_assert_int_eq(params->stop_total_us, 20);
}
END_TEST
START_TEST(test_thread_long)
{
PARSE_ARGS("timerlat", "top", "--thread", "20");
ck_assert_int_eq(params->stop_total_us, 20);
}
END_TEST
/* Event Configuration */
Annotation
- Immediate include surface: `check.h`, `stdio.h`, `stdlib.h`, `sched.h`, `limits.h`, `unistd.h`, `sys/sysinfo.h`, `linux/container_of.h`.
- Detected declarations: `function to_timerlat_params`, `function START_TEST`, `function START_TEST`, `function START_TEST`, `function START_TEST`, `function START_TEST`, `function START_TEST`, `function START_TEST`, `function START_TEST`, `function START_TEST`.
- 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.