tools/testing/selftests/ftrace/test.d/ftrace/func_cpumask.tc
Source file repositories/reference/linux-study-clean/tools/testing/selftests/ftrace/test.d/ftrace/func_cpumask.tc
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/ftrace/test.d/ftrace/func_cpumask.tc- Extension
.tc- Size
- 847 bytes
- Lines
- 44
- 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 nproc
Annotated Snippet
nproc() {
ls -d /sys/devices/system/cpu/cpu[0-9]* | wc -l
}
fi
NP=`nproc`
if [ $NP -eq 1 ] ;then
echo "We can not test cpumask on UP environment"
exit_unresolved
fi
ORIG_CPUMASK=`cat tracing_cpumask`
do_reset() {
echo $ORIG_CPUMASK > tracing_cpumask
}
echo 0 > tracing_on
echo > trace
: "Bitmask only record on CPU1"
echo 2 > tracing_cpumask
MASK=0x`cat tracing_cpumask`
test `printf "%d" $MASK` -eq 2 || do_reset
echo function > current_tracer
echo 1 > tracing_on
(echo "forked")
echo 0 > tracing_on
: "Check CPU1 events are recorded"
grep -q -e "\[001\]" trace || do_reset
: "There should be No other cpu events"
! grep -qv -e "\[001\]" -e "^#" trace || do_reset
do_reset
Annotation
- Detected declarations: `function nproc`.
- 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.