tools/perf/tests/shell/test_perf_data_converter_ctf.sh
Source file repositories/reference/linux-study-clean/tools/perf/tests/shell/test_perf_data_converter_ctf.sh
File Facts
- System
- Linux kernel
- Corpus path
tools/perf/tests/shell/test_perf_data_converter_ctf.sh- Extension
.sh- Size
- 2111 bytes
- Lines
- 105
- 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 check_babeltrace_support
Annotated Snippet
#!/bin/bash
# 'perf data convert --to-ctf' command test
# SPDX-License-Identifier: GPL-2.0
set -e
err=0
perfdata=$(mktemp /tmp/__perf_test.perf.data.XXXXX)
ctf_dir=$(mktemp -d /tmp/__perf_test.ctf.XXXXX)
cleanup()
{
rm -f "${perfdata}"
rm -rf "${ctf_dir}"
trap - exit term int
}
trap_cleanup()
{
echo "Unexpected signal in ${FUNCNAME[1]}"
cleanup
exit ${err}
}
trap trap_cleanup exit term int
check_babeltrace_support()
{
if ! perf check feature libbabeltrace
then
echo "perf not linked with libbabeltrace, skipping test"
exit 2
fi
}
test_ctf_converter_file()
{
echo "Testing Perf Data Conversion Command to CTF (File input)"
# Record some data
if ! perf record -o "$perfdata" -F 99 -g -- perf test -w noploop
then
echo "Failed to record perf data"
err=1
return
fi
# Cleanup previous ctf dir
rm -rf "${ctf_dir}"
# Convert
if ! perf data convert --to-ctf "$ctf_dir" --force -i "$perfdata"
then
echo "Perf Data Converter Command to CTF (File input) [FAILED]"
err=1
return
fi
if [ -d "${ctf_dir}" ] && [ "$(ls -A "${ctf_dir}")" ]
then
echo "Perf Data Converter Command to CTF (File input) [SUCCESS]"
else
echo "Perf Data Converter Command to CTF (File input) [FAILED]"
echo " Output directory empty or missing"
err=1
fi
}
test_ctf_converter_pipe()
{
echo "Testing Perf Data Conversion Command to CTF (Pipe mode)"
Annotation
- Detected declarations: `function check_babeltrace_support`.
- 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.