tools/perf/tests/shell/record_weak_term.sh
Source file repositories/reference/linux-study-clean/tools/perf/tests/shell/record_weak_term.sh
File Facts
- System
- Linux kernel
- Corpus path
tools/perf/tests/shell/record_weak_term.sh- Extension
.sh- Size
- 1044 bytes
- Lines
- 38
- 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
#!/bin/bash
# record weak terms
# SPDX-License-Identifier: GPL-2.0
# Test that command line options override weak terms from sysfs or inbuilt json.
set -e
shelldir=$(dirname "$0")
# shellcheck source=lib/setup_python.sh
. "${shelldir}"/lib/setup_python.sh
# Find the first event with a specified period, such as
# "cpu_core/event=0x24,period=200003,umask=0xff/"
event=$(perf list --json | $PYTHON -c '
import json, sys
for e in json.load(sys.stdin):
if "EventName" not in e or "/modifier" in e["EventName"]:
continue
if "Encoding" in e and "period=" in e["Encoding"]:
print(e["EventName"])
break
')
if [[ "$event" = "" ]]
then
echo "Skip: No sysfs/json events with inbuilt period."
exit 2
fi
echo "Testing that for $event the period is overridden with 1000"
perf list --detail "$event"
if ! perf record -c 1000 -vv -e "$event" -o /dev/null true 2>&1 | \
grep -q -F '{ sample_period, sample_freq } 1000'
then
echo "Fail: Unexpected verbose output and sample period"
exit 1
fi
echo "Success"
exit 0
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.