~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/tools/perf/tests/shell/common/settings.sh

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 # SPDX-License-Identifier: GPL-2.0
  2 #
  3 #       settings.sh
  4 #       Author: Michael Petlan <mpetlan@redhat.com>
  5 #
  6 #       Description:
  7 #
  8 #               This file contains global settings for the whole testsuite.
  9 #       Its purpose is to make it easier when it is necessary i.e. to
 10 #       change the usual sample command which is used in all of the tests
 11 #       in many files.
 12 #
 13 #               This file is intended to be sourced in the tests.
 14 #
 15 
 16 #### which perf to use in the testing
 17 export CMD_PERF=${CMD_PERF:-`which perf`}
 18 
 19 #### basic programs examinated by perf
 20 export CMD_BASIC_SLEEP="sleep 0.1"
 21 export CMD_QUICK_SLEEP="sleep 0.01"
 22 export CMD_LONGER_SLEEP="sleep 2"
 23 export CMD_DOUBLE_LONGER_SLEEP="sleep 4"
 24 export CMD_VERY_LONG_SLEEP="sleep 30"
 25 export CMD_SIMPLE="true"
 26 
 27 #### testsuite run mode
 28 # define constants:
 29 export RUNMODE_BASIC=0
 30 export RUNMODE_STANDARD=1
 31 export RUNMODE_EXPERIMENTAL=2
 32 # default runmode is STANDARD
 33 export PERFTOOL_TESTSUITE_RUNMODE=${PERFTOOL_TESTSUITE_RUNMODE:-$RUNMODE_STANDARD}
 34 
 35 #### common settings
 36 export TESTLOG_VERBOSITY=${TESTLOG_VERBOSITY:-2}
 37 export TESTLOG_FORCE_COLOR=${TESTLOG_FORCE_COLOR:-n}
 38 export TESTLOG_ERR_MSG_MAX_LINES=${TESTLOG_ERR_MSG_MAX_LINES:-20}
 39 export TESTLOG_CLEAN=${TESTLOG_CLEAN:-y}
 40 
 41 #### other environment-related settings
 42 export TEST_IGNORE_MISSING_PMU=${TEST_IGNORE_MISSING_PMU:-n}
 43 
 44 #### clear locale
 45 export LC_ALL=C
 46 
 47 #### colors
 48 if [ -t 1 ] || [ "$TESTLOG_FORCE_COLOR" = "yes" ]; then
 49         export MPASS="\e[32m"
 50         export MALLPASS="\e[1;32m"
 51         export MFAIL="\e[31m"
 52         export MALLFAIL="\e[1;31m"
 53         export MWARN="\e[1;35m"
 54         export MSKIP="\e[33m"
 55         export MHIGH="\e[1;33m"
 56         export MEND="\e[m"
 57 else
 58         export MPASS=""
 59         export MALLPASS=""
 60         export MFAIL=""
 61         export MALLFAIL=""
 62         export MWARN=""
 63         export MSKIP=""
 64         export MHIGH=""
 65         export MEND=""
 66 fi
 67 
 68 ### general info
 69 DIR_PATH=`dirname "$(readlink -e "$0")"`
 70 
 71 TEST_NAME=`basename $DIR_PATH | sed 's/base/perf/'`; export TEST_NAME
 72 MY_ARCH=`arch`; export MY_ARCH
 73 
 74 # storing logs and temporary files variables
 75 if [ -n "$PERFSUITE_RUN_DIR" ]; then
 76         # when $PERFSUITE_RUN_DIR is set to something, all the logs and temp files will be placed there
 77         # --> the $PERFSUITE_RUN_DIR/perf_something/examples and $PERFSUITE_RUN_DIR/perf_something/logs
 78         #     dirs will be used for that
 79         PERFSUITE_RUN_DIR=`readlink -f $PERFSUITE_RUN_DIR`; export PERFSUITE_RUN_DIR
 80         export CURRENT_TEST_DIR="$PERFSUITE_RUN_DIR/$TEST_NAME"
 81         export MAKE_TARGET_DIR="$CURRENT_TEST_DIR/examples"
 82         export LOGS_DIR="$CURRENT_TEST_DIR/logs"
 83         export HEADER_TAR_DIR="$CURRENT_TEST_DIR/header_tar"
 84         test -d "$CURRENT_TEST_DIR" || mkdir -p "$CURRENT_TEST_DIR"
 85         test -d "$LOGS_DIR" || mkdir -p "$LOGS_DIR"
 86 else
 87         # when $PERFSUITE_RUN_DIR is not set, logs will be placed here
 88         export CURRENT_TEST_DIR="."
 89         export LOGS_DIR="."
 90         export HEADER_TAR_DIR="./header_tar"
 91 fi
 92 
 93 
 94 #### test parametrization
 95 if [ ! -d ./common ]; then
 96         # set parameters based on runmode
 97         if [ -f ../common/parametrization.$PERFTOOL_TESTSUITE_RUNMODE.sh ]; then
 98                 # shellcheck source=/dev/null
 99                 . ../common/parametrization.$PERFTOOL_TESTSUITE_RUNMODE.sh
100         fi
101         # if some parameters haven't been set until now, set them to default
102         if [ -f ../common/parametrization.sh ]; then
103                 . ../common/parametrization.sh
104         fi
105 fi

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php