tools/perf/tests/shell/common/init.sh
Source file repositories/reference/linux-study-clean/tools/perf/tests/shell/common/init.sh
File Facts
- System
- Linux kernel
- Corpus path
tools/perf/tests/shell/common/init.sh- Extension
.sh- Size
- 3358 bytes
- Lines
- 144
- 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
# SPDX-License-Identifier: GPL-2.0
#
# init.sh
# Author: Michael Petlan <mpetlan@redhat.com>
#
# Description:
#
# This file should be used for initialization of basic functions
# for checking, reporting results etc.
#
#
. "$(dirname $0)/../common/settings.sh"
. "$(dirname $0)/../common/patterns.sh"
THIS_TEST_NAME=`basename $0 .sh`
_echo()
{
test "$TESTLOG_VERBOSITY" -ne 0 && echo -e "$@"
}
print_results()
{
PERF_RETVAL="$1"; shift
CHECK_RETVAL="$1"; shift
FAILURE_REASON=""
TASK_COMMENT="$*"
if [ $PERF_RETVAL -eq 0 ] && [ $CHECK_RETVAL -eq 0 ]; then
_echo "$MPASS-- [ PASS ] --$MEND $TEST_NAME :: $THIS_TEST_NAME :: $TASK_COMMENT"
return 0
else
if [ $PERF_RETVAL -ne 0 ]; then
FAILURE_REASON="command exitcode"
fi
if [ $CHECK_RETVAL -ne 0 ]; then
test -n "$FAILURE_REASON" && FAILURE_REASON="$FAILURE_REASON + "
FAILURE_REASON="$FAILURE_REASON""output regexp parsing"
fi
_echo "$MFAIL-- [ FAIL ] --$MEND $TEST_NAME :: $THIS_TEST_NAME :: $TASK_COMMENT ($FAILURE_REASON)"
return 1
fi
}
print_overall_results()
{
RETVAL="$1"; shift
TASK_COMMENT="$*"
test -n "$TASK_COMMENT" && TASK_COMMENT=":: $TASK_COMMENT"
if [ $RETVAL -eq 0 ]; then
_echo "$MALLPASS## [ PASS ] ##$MEND $TEST_NAME :: $THIS_TEST_NAME SUMMARY"
else
_echo "$MALLFAIL## [ FAIL ] ##$MEND $TEST_NAME :: $THIS_TEST_NAME SUMMARY :: $RETVAL failures found $TASK_COMMENT"
fi
return $RETVAL
}
print_testcase_skipped()
{
TASK_COMMENT="$*"
_echo "$MSKIP-- [ SKIP ] --$MEND $TEST_NAME :: $THIS_TEST_NAME :: $TASK_COMMENT :: testcase skipped"
return 0
}
print_overall_skipped()
{
_echo "$MSKIP## [ SKIP ] ##$MEND $TEST_NAME :: $THIS_TEST_NAME :: testcase skipped"
return 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.