tools/testing/selftests/ptp/phc.sh
Source file repositories/reference/linux-study-clean/tools/testing/selftests/ptp/phc.sh
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/ptp/phc.sh- Extension
.sh- Size
- 3108 bytes
- Lines
- 195
- Domain
- Support Tooling And Documentation
- Bucket
- tools
- Inferred role
- Support Tooling And Documentation: tools
- Status
- atlas-only
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
- No C-style include directives detected by the generator.
Detected Declarations
function require_commandfunction fi
Annotated Snippet
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0
ALL_TESTS="
settime
adjtime
adjfreq
"
DEV=$1
# Kselftest framework requirement - SKIP code is 4.
ksft_skip=4
##############################################################################
# Sanity checks
if [[ "$(id -u)" -ne 0 ]]; then
echo "SKIP: need root privileges"
exit $ksft_skip
fi
if [[ "$DEV" == "" ]]; then
echo "SKIP: PTP device not provided"
exit $ksft_skip
fi
require_command()
{
local cmd=$1; shift
if [[ ! -x "$(command -v "$cmd")" ]]; then
echo "SKIP: $cmd not installed"
exit $ksft_skip
fi
}
phc_sanity()
{
phc_ctl $DEV get &> /dev/null
if [ $? != 0 ]; then
echo "SKIP: unknown clock $DEV: No such device"
exit $ksft_skip
fi
}
require_command phc_ctl
phc_sanity
##############################################################################
# Helpers
# Exit status to return at the end. Set in case one of the tests fails.
EXIT_STATUS=0
PASS_COUNT=0
# Per-test return value. Clear at the beginning of each test.
RET=0
check_err()
{
local err=$1
if [[ $RET -eq 0 && $err -ne 0 ]]; then
RET=$err
fi
}
log_test()
{
local test_name=$1
Annotation
- Detected declarations: `function require_command`, `function fi`.
- Atlas domain: Support Tooling And Documentation / tools.
- Implementation status: atlas-only.
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.