tools/testing/selftests/ftrace/test.d/00basic/trace_marker_raw.tc
Source file repositories/reference/linux-study-clean/tools/testing/selftests/ftrace/test.d/00basic/trace_marker_raw.tc
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/ftrace/test.d/00basic/trace_marker_raw.tc- Extension
.tc- Size
- 2449 bytes
- Lines
- 126
- 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 test_multiple_writesfunction get_buffer_data_size
Annotated Snippet
if ( $i == "#" ) {
i++;
cnt = strtonum("0x" $i);
num = NF - (i + 1);
# The number of items is always rounded up by 4
cnt2 = int((cnt + 3) / 4) * 4;
if (cnt2 != num) {
exit 1;
}
break;
}
}
}
// { if (NR > 30) { exit 0; } } ' trace_pipe;
}
get_buffer_data_size() {
sed -ne 's/^.*data.*size:\([0-9][0-9]*\).*/\1/p' events/header_page
}
test_buffer() {
# The id must be four bytes, test that 3 bytes fails a write
if echo -n abc > ./trace_marker_raw ; then
echo "Too small of write expected to fail but did not"
echo ${ORIG} > buffer_size_kb
exit_fail
fi
size=`get_buffer_data_size`
echo size = $size
# Now add a little more than what it can handle
if write_buffer 0xdeadbeef $size ; then
echo "Too big of write expected to fail but did not"
echo ${ORIG} > buffer_size_kb
exit_fail
fi
}
ORIG=`cat buffer_size_kb`
# test_multiple_writes test needs at least 12KB buffer
NEW_SIZE=12
if [ ${ORIG} -lt ${NEW_SIZE} ]; then
echo ${NEW_SIZE} > buffer_size_kb
fi
test_buffer
if ! test_multiple_writes; then
echo ${ORIG} > buffer_size_kb
exit_fail
fi
echo ${ORIG} > buffer_size_kb
Annotation
- Detected declarations: `function test_multiple_writes`, `function get_buffer_data_size`.
- 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.