tools/perf/tests/shell/kwork.sh
Source file repositories/reference/linux-study-clean/tools/perf/tests/shell/kwork.sh
File Facts
- System
- Linux kernel
- Corpus path
tools/perf/tests/shell/kwork.sh- Extension
.sh- Size
- 1509 bytes
- Lines
- 80
- 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_kwork_record
Annotated Snippet
#!/bin/bash
# perf kwork tests
# SPDX-License-Identifier: GPL-2.0
set -e
# Root permissions required for tracing events.
if [ "$(id -u)" != 0 ]; then
echo "[Skip] No root permission"
exit 2
fi
err=0
perfdata=$(mktemp /tmp/__perf_test_kwork.perf.data.XXXXX)
cleanup() {
rm -f "${perfdata}"
rm -f "${perfdata}".old
trap - EXIT TERM INT
}
trap_cleanup() {
echo "Unexpected signal in ${FUNCNAME[1]}"
cleanup
exit 1
}
trap trap_cleanup EXIT TERM INT
test_kwork_record() {
echo "Kwork record"
perf kwork record -o "${perfdata}" -- sleep 1
echo "Kwork record [Success]"
}
test_kwork_report() {
echo "Kwork report"
if ! perf kwork report -i "${perfdata}" | grep -q "Kwork Name"; then
echo "Kwork report [Failed missing output]"
err=1
fi
echo "Kwork report [Success]"
}
test_kwork_latency() {
echo "Kwork latency"
if ! perf kwork latency -i "${perfdata}" | grep -q "Avg delay"; then
echo "Kwork latency [Failed missing output]"
err=1
fi
echo "Kwork latency [Success]"
}
test_kwork_timehist() {
echo "Kwork timehist"
if ! perf kwork timehist -i "${perfdata}" | grep -q "Kwork name"; then
echo "Kwork timehist [Failed missing output]"
err=1
fi
echo "Kwork timehist [Success]"
}
test_kwork_top() {
echo "Kwork top"
if ! perf kwork top -i "${perfdata}" | grep -q "COMMAND"; then
echo "Kwork top [Failed missing output]"
err=1
fi
echo "Kwork top [Success]"
}
Annotation
- Detected declarations: `function test_kwork_record`.
- 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.