tools/perf/tests/shell/evlist.sh
Source file repositories/reference/linux-study-clean/tools/perf/tests/shell/evlist.sh
File Facts
- System
- Linux kernel
- Corpus path
tools/perf/tests/shell/evlist.sh- Extension
.sh- Size
- 1576 bytes
- Lines
- 81
- 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_evlist_simple
Annotated Snippet
#!/bin/bash
# perf evlist tests
# SPDX-License-Identifier: GPL-2.0
set -e
err=0
perfdata=$(mktemp /tmp/__perf_test.perf.data.XXXXX)
cleanup() {
rm -f "${perfdata}"
trap - EXIT TERM INT
}
trap_cleanup() {
echo "Unexpected signal in ${FUNCNAME[1]}"
cleanup
exit 1
}
trap trap_cleanup EXIT TERM INT
test_evlist_simple() {
echo "Simple evlist test"
if ! perf record -e cpu-clock -o "${perfdata}" true 2> /dev/null
then
echo "Simple evlist [Failed record]"
err=1
return
fi
if ! perf evlist -i "${perfdata}" | grep -q "cpu-clock"
then
echo "Simple evlist [Failed to list event]"
err=1
return
fi
echo "Simple evlist test [Success]"
}
test_evlist_group() {
echo "Group evlist test"
if ! perf record -e "{cpu-clock,task-clock}" -o "${perfdata}" \
-- perf test -w noploop 2> /dev/null
then
echo "Group evlist [Skipped event group recording failed]"
return
fi
if ! perf evlist -i "${perfdata}" -g | grep -q "{.*cpu-clock.*,.*task-clock.*}"
then
echo "Group evlist [Failed to list event group]"
err=1
return
fi
echo "Group evlist test [Success]"
}
test_evlist_verbose() {
echo "Event configuration evlist test"
if ! perf record -e cycles -o "${perfdata}" true 2> /dev/null
then
echo "Event configuration evlist [Failed record]"
err=1
return
fi
if ! perf evlist -i "${perfdata}" -v | grep -q "config:"
then
echo "Event configuration evlist [Failed to list verbose info]"
err=1
return
Annotation
- Detected declarations: `function test_evlist_simple`.
- 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.