tools/testing/selftests/ftrace/test.d/remotes/functions
Source file repositories/reference/linux-study-clean/tools/testing/selftests/ftrace/test.d/remotes/functions
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/ftrace/test.d/remotes/functions- Extension
[no extension]- Size
- 1707 bytes
- Lines
- 100
- 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
- No top-level syscall, struct, function, initcall, or export declaration detected by the generator.
Annotated Snippet
# SPDX-License-Identifier: GPL-2.0
setup_remote()
{
local name=$1
[ -e $TRACING_DIR/remotes/$name/write_event ] || exit_unresolved
cd remotes/$name/
echo 0 > tracing_on
clear_trace
echo 7 > buffer_size_kb
echo 0 > events/enable
echo 1 > events/$name/selftest/enable
echo 1 > tracing_on
}
setup_remote_test()
{
[ -d $TRACING_DIR/remotes/test/ ] || modprobe remote_test || exit_unresolved
setup_remote "test"
}
assert_loaded()
{
grep -q "(loaded)" buffer_size_kb || return 1
}
assert_unloaded()
{
grep -q "(unloaded)" buffer_size_kb || return 1
}
reload_remote()
{
echo 0 > tracing_on
clear_trace
assert_unloaded
echo 1 > tracing_on
assert_loaded
}
dump_trace_pipe()
{
output=$(mktemp $TMPDIR/remote_test.XXXXXX)
cat trace_pipe > $output &
pid=$!
sleep 1
kill -1 $pid
echo $output
}
check_trace()
{
start_id="$1"
end_id="$2"
file="$3"
# Ensure the file is not empty
test -n "$(head $file)"
prev_ts=0
id=0
# Only keep <timestamp> <id>
tmp=$(mktemp $TMPDIR/remote_test.XXXXXX)
sed -e 's/\[[0-9]*\]\s*\([0-9]*.[0-9]*\): [a-z]* id=\([0-9]*\)/\1 \2/' $file > $tmp
Annotation
- 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.