# 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. # #
# this function should skip a testcase if the testsuite is not run in # a runmode that fits the testcase --> if the suite runs in BASIC mode # all STANDARD and EXPERIMENTAL testcases will be skipped; if the suite # runs in STANDARD mode, all EXPERIMENTAL testcases will be skipped and # if the suite runs in EXPERIMENTAL mode, nothing is skipped
consider_skipping()
{
TESTCASE_RUNMODE="$1" # the runmode of a testcase needs to be at least the current suite's runmode if [ $PERFTOOL_TESTSUITE_RUNMODE -lt $TESTCASE_RUNMODE ]; then
print_overall_skipped
exit 2 fi
}
detect_baremetal()
{ # return values: # 0 = bare metal # 1 = virtualization detected # 2 = unknown state
VIRT=`systemd-detect-virt 2>/dev/null`
test $? -eq 127 && return 2
test "$VIRT" = "none"
}
detect_intel()
{ # return values: # 0 = is Intel # 1 = is not Intel or unknown
grep "vendor_id" < /proc/cpuinfo | grep -q "GenuineIntel"
}
detect_amd()
{ # return values: # 0 = is AMD # 1 = is not AMD or unknown
grep "vendor_id" < /proc/cpuinfo | grep -q "AMD"
}
# base probe utility
check_kprobes_available()
{
test -e /sys/kernel/debug/tracing/kprobe_events
}
check_uprobes_available()
{
test -e /sys/kernel/debug/tracing/uprobe_events
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.