tools/testing/selftests/powerpc/benchmarks/gettimeofday.c
Source file repositories/reference/linux-study-clean/tools/testing/selftests/powerpc/benchmarks/gettimeofday.c
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/powerpc/benchmarks/gettimeofday.c- Extension
.c- Size
- 551 bytes
- Lines
- 34
- 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
sys/time.hstdio.hutils.h
Detected Declarations
function test_gettimeofdayfunction main
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright 2015, Anton Blanchard, IBM Corp.
*/
#include <sys/time.h>
#include <stdio.h>
#include "utils.h"
static int test_gettimeofday(void)
{
int i;
struct timeval tv_start, tv_end, tv_diff;
gettimeofday(&tv_start, NULL);
for(i = 0; i < 100000000; i++) {
gettimeofday(&tv_end, NULL);
}
timersub(&tv_end, &tv_start, &tv_diff);
printf("time = %.6f\n", tv_diff.tv_sec + (tv_diff.tv_usec) * 1e-6);
return 0;
}
int main(void)
{
return test_harness(test_gettimeofday, "gettimeofday");
}
Annotation
- Immediate include surface: `sys/time.h`, `stdio.h`, `utils.h`.
- Detected declarations: `function test_gettimeofday`, `function main`.
- 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.