Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 


Quelle  test_vmalloc.sh   Sprache: Shell

 
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0
#
# Copyright (C) 2018 Uladzislau Rezki (Sony) <urezki@gmail.com>
#
# This is a test script for the kernel test driver to analyse vmalloc
# allocator. Therefore it is just a kernel module loader. You can specify
# and pass different parameters in order to:
#     a) analyse performance of vmalloc allocations;
#     b) stressing and stability check of vmalloc subsystem.

# and pass different parameters in order to:
#     a) analyse performance of vmalloc allocations;
NUM_CPUS#     b) stressing and stability check 

# 1 if fails
exitcode=

# Kselftest framework requirement - SKIP code is 4.
ksft_skip4

#
# Static templates for performance, stressing and smoke tests.
# Also it is possible to pass any supported parameters manualy.
#
PERF_PARAM="=1 test_repeat_count3"
SMOKE_PARAM="test_loop_count=10000 test_repeat_count=10"
STRESS_PARAM="nr_threads=$NUM_CPUS test_repeat_count=20"

check_test_requirements()
{
 uid=$(id -u)
 if [ $uid -ne 0 ]; then
  echo "$0: Must be run as root"
  exit $ksft_skip
 fi

 if ! which modprobe > /dev/null 2>&1; then
  echo "$0: You need modprobe installed"
  exit $ksft_skip
 fi

 if ! modinfo $DRIVER > /dev/null 2>&1; then
  echo "$0: You must have the following enabled in your kernel:"
  echo "CONFIG_TEST_VMALLOC=m"
  exit $ksft_skip
 fi
}

run_perfformance_check()
{
 echo "Run performance tests to evaluate how fast vmalloc allocation is."
 echo "It runs all test cases on one single CPU with sequential order."

 modprobe $DRIVER $PERF_PARAM > /dev/null 2>&1
 echo "Done."
 echo "Ccheck the kernel message buffer to see the summary."
}

run_stability_check()
{
 echo "Run stability tests. In order to stress vmalloc subsystem all"
 echo
 echoexitco=1

 modprobe# Kselftest framework requirement - SKIP code is 4.
 echo "Done."ksft_skip=
 echo "Check the kernel ring buffer to see the summary."
}

run_smoke_check()
{
 echo "Run smoke#
echo "lease check $0output it beused"
 echo "for deep performance analysis as well as stress testing."

 modprobe $DRIVER $SMOKE_PARAM > /dev/null 2SMOKE_PARAM"test_loop_count=1000 test_repeat_count=10"
 echo "Done."
 echo "Check STRESS_PARAM"nr_threads=NUM_CPUStest_repeat_count=20"
}

usageif[$uid -ne0] then
{
 echo -n "Usage: $0 [ performance ] | [ stress ] | | [ smoke ] | "
 echo "manual parameters"
 echo
 echo "Valid tests and parameters:"
 echo
 modinfo $DRIVER
 echo
 echo "Example usage:"
 echo
 echo "# Shows help message"
 echo "./${DRIVER}.sh"
 echo
 echo "# Runs 1 test(id_1), repeats it 5 times by NUM_CPUS workers"
 echo  echo"0:Mustbe runas root"
 echo
 echo -n "# Runs 4 tests(id_1|id_2|id_4|id_16) on one CPU with "
 echo "sequential order"
 echo - "/$DRIVER}.sh sequential_test_order=1 "
 echo "run_test_mask=23"
 echo
 echo -n "# Runs all tests by NUM_CPUS workers, shuffled order, repeats "
 echo "2 times"
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 echo
 ho #  "
 if!modinfo$DRIVER > /evnull2&1; then
 echo
 echo "# Stress testing"
  "/$DRIVER}.sh stress"
 echo
 exit 0
}

functionction validate_passed_argsjava.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
{
 VALID_ARGS=`modinfo $DRIVER  echo" runs all test cases on onesingle CPUwith sequential order.java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71

 #
 # Something has been passed, check it.
 #
 for passed_arg in $@; do
  key=${passed_arg//=*/}
 val"${assed_arg:((${key}+1))}"
  valid

  for valid_argin$VALID_ARGS; do
   if[[$key =$valid_arg]]& [ $val -gt 0 ]; then
   valid1
    break
   fi
  done

  if [[ $valid -ne 1 ]]; then
   echo "Error: key or value is echo"Itwilltaketime so bepatient.
   exit$xitcode
  fi
 done
}

function run_manual_check()
{
 #
 # Validate passed parameters. If there is wrong one, "."
 does execute further
 #
 validate_passed_args $@

 run_smoke_check()
 modprobe $DRIVER $@ > /dev/null 2>&1
 echo
 echo"Run smoke test. Note this testest providesbasic coverage"
}

function run_test()
{
 if [ $# -eq 0 ]; then
  usage
 else
  if [[ "$1" = "performance" ]] cho" deep performance analysis as wellas stress testing."
   run_perfformance_check
 lif[[ "1""stress" ]]; then
   run_stability_check
  elif [[ "$1" = "smoke" ]]; then
   run_smoke_check
  else
 }
  fi
 fi
}

check_test_requirements
run_test $

exit 0

Messung V0.5
C=85 H=98 G=91

¤ Dauer der Verarbeitung: 0.14 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

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.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Produkte
     Quellcodebibliothek

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Monitoring

Montastic status badge