tools/testing/selftests/cpufreq/cpufreq.sh
Source file repositories/reference/linux-study-clean/tools/testing/selftests/cpufreq/cpufreq.sh
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/cpufreq/cpufreq.sh- Extension
.sh- Size
- 5160 bytes
- Lines
- 265
- 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 read_all_cpufreq_files
Annotated Snippet
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0
# protect against multiple inclusion
if [ $FILE_CPUFREQ ]; then
return 0
else
FILE_CPUFREQ=DONE
fi
source cpu.sh
# $1: cpu
cpu_should_have_cpufreq_directory()
{
if [ ! -d $CPUROOT/$1/cpufreq ]; then
printf "Warning: No cpufreq directory present for $1\n"
fi
}
cpu_should_not_have_cpufreq_directory()
{
if [ -d $CPUROOT/$1/cpufreq ]; then
printf "Warning: cpufreq directory present for $1\n"
fi
}
for_each_policy()
{
policies=$(ls $CPUFREQROOT| grep "policy[0-9].*")
for policy in $policies; do
$@ $policy
done
}
for_each_policy_concurrent()
{
policies=$(ls $CPUFREQROOT| grep "policy[0-9].*")
for policy in $policies; do
$@ $policy &
done
}
# $1: Path
read_cpufreq_files_in_dir()
{
local files=`ls $1`
printf "Printing directory: $1\n\n"
for file in $files; do
if [ -f $1/$file ]; then
printf "$file:"
#file is readable ?
local rfile=$(ls -l $1/$file | awk '$1 ~ /^.*r.*/ { print $NF; }')
if [ ! -z $rfile ]; then
cat $1/$file
else
printf "$file is not readable\n"
fi
else
printf "\n"
read_cpufreq_files_in_dir "$1/$file"
fi
done
printf "\n"
}
Annotation
- Detected declarations: `function read_all_cpufreq_files`.
- 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.