diff options
author | Bill Peck <bpeck@redhat.com> | 2013-11-18 14:53:49 -0500 |
---|---|---|
committer | Bill Peck <bpeck@redhat.com> | 2013-11-18 14:53:49 -0500 |
commit | b1891720a57e1be59e1aea83149c1b998b554daa (patch) | |
tree | 7f761897c370515e878413dcb9cb981f6b8a3083 | |
parent | a369f27b2022dd994a33fdf52e5f8d95831a44b2 (diff) | |
download | tests-b1891720a57e1be59e1aea83149c1b998b554daa.tar.gz tests-b1891720a57e1be59e1aea83149c1b998b554daa.tar.xz tests-b1891720a57e1be59e1aea83149c1b998b554daa.zip |
Added performance fs_mark test.
-rw-r--r-- | kernel/performance/fs_mark/Makefile | 75 | ||||
-rw-r--r-- | kernel/performance/fs_mark/PURPOSE | 160 | ||||
-rw-r--r-- | kernel/performance/fs_mark/plot_1 | 18 | ||||
-rw-r--r-- | kernel/performance/fs_mark/plot_2 | 18 | ||||
-rw-r--r-- | kernel/performance/fs_mark/plot_3 | 18 | ||||
-rw-r--r-- | kernel/performance/fs_mark/plot_4 | 18 | ||||
-rwxr-xr-x | kernel/performance/fs_mark/runtest.sh | 151 |
7 files changed, 458 insertions, 0 deletions
diff --git a/kernel/performance/fs_mark/Makefile b/kernel/performance/fs_mark/Makefile new file mode 100644 index 0000000..4effa22 --- /dev/null +++ b/kernel/performance/fs_mark/Makefile @@ -0,0 +1,75 @@ +# The name of the package under test +PACKAGE_NAME=kernel + +# The toplevel namespace within which the test lives. +TOPLEVEL_NAMESPACE=/$(PACKAGE_NAME) + +# The version of the test rpm that gets +# created / submitte +export TESTVERSION=1.2 + +# The path of the test below the package +RELATIVE_PATH=performance/fs_mark + +# The relative path name to the test +export TEST=$(TOPLEVEL_NAMESPACE)/$(RELATIVE_PATH) + +# Name of the tgz file that will be bundled in the rpm +TARGET=fs_mark-3.2 + +FILES= $(METADATA) \ + $(TARGET).tgz \ + plot_1 \ + plot_2 \ + plot_3 \ + plot_4 \ + runtest.sh \ + Makefile + +clean: + $(RM) *~ rm $(METADATA) + rm -rf $(TARGET) rh-tests-kernel-*.rpm + rm -rf fs_mark $(TARGET).tgz + +run: build + chmod +x ./runtest.sh + ./runtest.sh + +build: $(METADATA) $(TARGET) + make -C fs_mark + cp plot_[1234] fs_mark + +$(TARGET).tgz: + wget http://download.devel.redhat.com/qa/rhts/lookaside/$(TARGET).tgz + +$(TARGET): $(TARGET).tgz + tar -zxvf $(TARGET).tgz + +# Include a global make rules file +include /usr/share/rhts/lib/rhts-make.include + +showmeta: $(METADATA) + @cat $(METADATA) + @rhts-lint $(METADATA) + +$(METADATA): + touch $(METADATA) + @echo "Name: $(TEST)" > $(METADATA) + @echo "Description: Modified 3.2 version of \ + Larry McVoy's lmbench program." >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "TestTime: 80m" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Releases: RHEL4 RHELServer5 RHEL6 RHEL7 RedHatEnterpriseLinux7" >> $(METADATA) + @echo "#Architectures: All" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Type: KernelTier1" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "RunFor: kernel" >> $(METADATA) + @echo "Requires: kernel-devel" >> $(METADATA) + @echo "Requires: gcc" >> $(METADATA) + @echo "Requires: make" >> $(METADATA) + @echo "Requires: glibc-static" >> $(METADATA) + @echo "Requires: gnuplot" >> $(METADATA) + @echo "Owner: Jeff Burke <jburke@redhat.com>" >> $(METADATA) + @echo "License: GPLv2" >> $(METADATA) diff --git a/kernel/performance/fs_mark/PURPOSE b/kernel/performance/fs_mark/PURPOSE new file mode 100644 index 0000000..813febc --- /dev/null +++ b/kernel/performance/fs_mark/PURPOSE @@ -0,0 +1,160 @@ +#===================================================================== +# +# PURPOSE file for: +# /kernel/performance/fs_mark +# +# Description: +# The fs_mark benchmark tests synchronous write workloads. It can +# vary the number of files, directory depth, etc. It has detailed +# timings for reads, writes, unlinks and fsyncs that make it good +# for simulating mail servers and other setups. +# +# Author(s): +# Kernel General Test Team +# <kernel-general-test-team@redhat.com> +# +#===================================================================== +# Note: +# This task writes to two directories synchronously. +# As a benchmark, this task can be used to compare results from +# testing a released kernel version and "currently testing" kernel +# version. +# +#===================================================================== +# This task takes optional parameters: +# [] FSMARK_S_PARAM - the size of the files written +# (Our task default is "FSMARK_S_PARAM = 32768") +# +# [] FSMARK_N_PARAM - the number of files to write +# (Our task default is "FSMARK_N_PARAM = 4096") +# +#===================================================================== +# These are the options to fs-mark that we currrently use: +# (See here for all available options: +# http://file.bos.redhat.com/pbunyan/KT1/PURPOSE/fs_mark-options) +# +# [] "-d" +# This argument allows you to specify one or more directories to +# run the test against. One thread is created for each of these +# root directories. Note that "-d" can appear multiple times. +# +# [] "-s num" +# Specifies the size(s) of the files to be tested. +# +# [] "-n num" +# Specifies the number of files to be tested. +# +# [] "-l logfile_name" +# Sets the name of the logfile. +# +# [] "-r num" +# Sets the number of random bytes at the end of the file name. +# To have purely random names, use "-p X -r X". +# +# [] "-D num" +# This flag allows you to specify how many subdirectories you +# want to use under each of the above root directories. Invoking +# fs_mark with "-D 256" would create 256 directories under +# specified directory. Only one thread is used to write to all of +# the subdirectories. +# +#===================================================================== +# The task output shows: +# FSUse% Count Size Files/sec App Overhead +# ## #### ##### #.# ###### # +# FSUse%: The % full the file system is on the first directory +# specified. +# Count: How many files have been written. +# Size: Size of files written. +# Files/sec: The rate that files are written to disk. +# App Overhead: Time in microseconds spent in the inner file writing +# loop not doing file writing related system calls. +# +# *A graph is provided with all test results for ease of comparisons. +# +#===================================================================== +# We have three versions of the test we run: +# (Sample from: https://beaker.engineering.redhat.com/recipes/897455) +# [] Default +# Here is a sample "default" test run +# ./fs_mark -d /mnt/testarea/testdir1 -d /mnt/testarea/testdir2 +# -s 32768 -n 4096 -l /mnt/testarea/fs_1.log +# +# Version: Version 3.2, 2 thread(s) starting at `date`. +# Sync method: INBAND FSYNC: fsync() per file in write loop. +# Directories: No subdirectories used. +# File names: 40 bytes long, (16 initial bytes of time stamp with +# 24 random bytes at end of name). +# Files info: The size 32768 bytes written with an IO size of +# 16384 bytes per write. +# App overhead: The time in microseconds spent in the inner file writing +# loop not doing file writing related system calls. +# +# FSUse% Count Size Files/sec App OverheadA +# 12 8192 32768 41.6 61471 +# +# [] Random +# Here is a sample "random" test run +# ./fs_mark -d /mnt/testarea/testdir1 -d /mnt/testarea/testdir2 +# -s 32768 -n 4096 -l /mnt/testarea/fs_2.log -r 32 +# +# Version: Version 3.2, 2 thread(s) starting at Mon `date`. +# Sync method: INBAND FSYNC: fsync() per file in write loop. +# Directories: No subdirectories used. +# File names: 40 bytes long, (8 initial bytes of time stamp with +# 32 random bytes at end of name). +# Files info: The size 32768 bytes written with an IO size of +# 16384 bytes per write. +# App overhead: The time in microseconds spent in the inner file writing +# loop not doing file writing related system calls. +# +# FSUse% Count Size Files/sec App Overhead +# 12 8192 32768 42.0 62339 +# +# [] MultiDir +# Here is a sample "multi-dir" test run +# ./fs_mark -d /mnt/testarea/testdir1 -d /mnt/testarea/testdir2 +# -s 32768 -n 4096 -l mnt/testarea/fs_3.log -D 128 +# +# Version: Version 3.2, 2 thread(s) starting at `date` +# Sync method: INBAND FSYNC: fsync() per file in write loop. +# Directories: Time based hash between directories across +# 128 subdirectories with 180 seconds per subdirectory. +# File names: 40 bytes long, (16 initial bytes of time stamp with +# 24 random bytes at end of name) +# Files info: The size 32768 bytes written with an IO size of +# 16384 bytes per write. +# App overhead: The time in microseconds spent in the inner file writing +# loop not doing file writing related system calls. +# +# FSUse% Count Size Files/sec App Overhead +# 12 8192 32768 42.1 62815 +# +# [] Random_MultiDir +# Here is a sample "random-multi-dir" test run +# ./fs_mark -d /mnt/testarea/testdir1 -d /mnt/testarea/testdir2 +# -s 32768 -n 4096 -l /mnt/testarea/fs_4.log -r 32 -D 128 +# +# Version: Version 3.2, 2 thread(s) starting at `date` +# Sync method: INBAND FSYNC: fsync() per file in write loop. +# Directories: Time based hash between directories across +# 128 subdirectories with 180 seconds per subdirectory. +# File names: 40 bytes long, (8 initial bytes of time stamp with +# 32 random bytes at end of name). +# Files info: The size 32768 bytes written with an IO size of +# 16384 bytes per write. +# App overhead: The time in microseconds spent in the inner file writing +# loop not doing file writing related system calls. +# +# FSUse% Count Size Files/sec App Overhead +# 12 8192 32768 42.2 63590 +# +#===================================================================== +# Test details: +# Furthur detailed explanations and command line arguments are available, +# if interested. There is an excellent README file written by +# Ric Wheeler <ric@emc.com> in the tarball found here: +# http://downloads.sourceforge.net/project/fsmark/fsmark/3.3/fs_mark-3.3.tar.gz +# +#===================================================================== +# EndFile diff --git a/kernel/performance/fs_mark/plot_1 b/kernel/performance/fs_mark/plot_1 new file mode 100644 index 0000000..f583687 --- /dev/null +++ b/kernel/performance/fs_mark/plot_1 @@ -0,0 +1,18 @@ +set term dumb + +set ytics 10 + +set xlabel "Number of Files" +set ylabel "Files/Second" + +set title "Number of $FSMARK_S_PARAM bytes Files/Sec" + +set output "plot-1.txt" + +plot \ + '/mnt/testarea/fs_1.log' using 2:4 title "Two Directories" lw 5 + +exit + + + diff --git a/kernel/performance/fs_mark/plot_2 b/kernel/performance/fs_mark/plot_2 new file mode 100644 index 0000000..980ee9e --- /dev/null +++ b/kernel/performance/fs_mark/plot_2 @@ -0,0 +1,18 @@ +set term dumb + +set ytics 10 + +set xlabel "Number of Files" +set ylabel "Files/Second" + +set title "Number of $FSMARK_S_PARAM bytes Files/Sec" + +set output "plot-2.txt" + +plot \ + '/mnt/testarea/fs_2.log' using 2:4 title "Two Directories" lw 5 + +exit + + + diff --git a/kernel/performance/fs_mark/plot_3 b/kernel/performance/fs_mark/plot_3 new file mode 100644 index 0000000..e914b04 --- /dev/null +++ b/kernel/performance/fs_mark/plot_3 @@ -0,0 +1,18 @@ +set term dumb + +set ytics 10 + +set xlabel "Number of Files" +set ylabel "Files/Second" + +set title "Number of $FSMARK_S_PARAM bytes Files/Sec" + +set output "plot-3.txt" + +plot \ + '/mnt/testarea/fs_3.log' using 2:4 title "Two Directories" lw 5 + +exit + + + diff --git a/kernel/performance/fs_mark/plot_4 b/kernel/performance/fs_mark/plot_4 new file mode 100644 index 0000000..ed48f0d --- /dev/null +++ b/kernel/performance/fs_mark/plot_4 @@ -0,0 +1,18 @@ +set term dumb + +set ytics 10 + +set xlabel "Number of Files" +set ylabel "Files/Second" + +set title "Number of $FSMARK_S_PARAM bytes Files/Sec" + +set output "plot-4.txt" + +plot \ + '/mnt/testarea/fs_4.log' using 2:4 title "Two Directories" lw 5 + +exit + + + diff --git a/kernel/performance/fs_mark/runtest.sh b/kernel/performance/fs_mark/runtest.sh new file mode 100755 index 0000000..d7460d9 --- /dev/null +++ b/kernel/performance/fs_mark/runtest.sh @@ -0,0 +1,151 @@ +#!/bin/sh + +# Source the common test script helpers +. /usr/bin/rhts_environment.sh + +# Functions +RprtRslt() +{ + TEST=$1 + result=$2 + + if test ! -s "$OUTPUTFILE" ; then + export result="FAIL" + else + if [ "$result" = "PASS" ] ; then + export result="PASS" + else + export result="FAIL" + fi + fi + + # File the results in the database + report_result $TEST $result +} + +TimeNow() +{ + date "+%Y.%m.%d %H:%M:%S" +} + +RunTest() +{ + case "$1" in + 1) + TESTARGS='-l /mnt/testarea/fs_1.log' + RUNTEST=Default + ;; + + 2) + TESTARGS='-l /mnt/testarea/fs_2.log -r 32' + RUNTEST=Random + ;; + + 3) + TESTARGS='-l /mnt/testarea/fs_3.log -D 128' + RUNTEST=MultiDir + ;; + + 4) + TESTARGS='-l /mnt/testarea/fs_4.log -r 32 -D 128' + RUNTEST=Random_MultiDir + ;; + esac + + echo "***** Start of $RUNTEST $(TimeNow) *****" | tee -a $OUTPUTFILE + + # Default result to Fail + export result_r="FAIL" + + echo "./fs_mark -d ${DIR1} -d ${DIR2} -s $FSMARK_S_PARAM -n $FSMARK_N_PARAM $TESTARGS" | tee -a $OUTPUTFILE + ./fs_mark -d ${DIR1} -d ${DIR2} -s $FSMARK_S_PARAM -n $FSMARK_N_PARAM $TESTARGS 2>&1 >> $OUTPUTFILE + if [ $? -eq 0 ] ; then + echo "$RUNTEST Passed: " | tee -a $OUTPUTFILE + result_r="PASS" + else + echo "$RUNTEST Failed: " | tee -a $OUTPUTFILE + result_r="FAIL" + fi + + echo " " >> $OUTPUTFILE + echo "***** End of $RUNTEST $(TimeNow) *****" | tee -a $OUTPUTFILE + echo " " >> $OUTPUTFILE + + if [ -e plot_$1 ] ; then + gnuplot plot_$1 + echo "*******************************************************************************" >> $OUTPUTFILE + cat plot-$1.txt >> $OUTPUTFILE + echo "*******************************************************************************" >> $OUTPUTFILE + fi + + RprtRslt "$FSMARK_RESULT_PREFIX$RUNTEST" $result_r +} + +# ---------- Start Test ------------- +# Setup some variables +# env params: name default +# FSMARK_TESTDIR /mnt/testarea +# FSMARK_S_PARAM 32768 +# FSMARK_N_PARAM 4096 +# FSMARK_RESULT_PREFIX +# +# This test can be included by other tests, so if you plan to change/remove +# some of env. variables, you should keep this in mind. + +if [ -e /etc/redhat-release ] ; then + installeddistro=$(cat /etc/redhat-release) +else + installeddistro=unknown +fi + +kernbase=$(rpm -q --queryformat '%{name}-%{version}-%{release}.%{arch}\n' -qf /boot/config-$(uname -r)) +testver=$(rpm -qf $0) + +if [ -z "$FSMARK_S_PARAM" ]; then + FSMARK_S_PARAM=32768 +fi + +if [ -z "$FSMARK_N_PARAM" ]; then + FSMARK_N_PARAM=4096 +fi + +if [ -n "$FSMARK_TESTDIR" -a -d "$FSMARK_TESTDIR" ]; then + echo "FSMARK_TESTDIR: $FSMARK_TESTDIR" | tee -a $OUTPUTFILE +else + FSMARK_TESTDIR="/mnt/testarea" +fi + +DIR1=$FSMARK_TESTDIR/testdir1 +DIR2=$FSMARK_TESTDIR/testdir2 +echo "Going to run tests in $DIR1, $DIR2" | tee -a $OUTPUTFILE + +cd ./fs_mark + +TESTS='1 2 3 4' + +for t in $TESTS ; do + if [ -e /mnt/testarea/fs_$t.log ]; then + rm -f /mnt/testarea/fs_$t.log + fi +done + +for t in $TESTS ; do + OUTPUTFILE=`mktemp /tmp/tmp.XXXXXX` + + echo "***** Current Running Kernel Package = "$kernbase" *****" | tee -a $OUTPUTFILE + echo "***** Current Running Distro = "$installeddistro" *****" | tee -a $OUTPUTFILE + echo "***** Current Running test version = "$testver" *****" | tee -a $OUTPUTFILE + + if [ -d $DIR1 ]; then + rm -rf $DIR1 + fi + if [ -d $DIR2 ]; then + rm -rf $DIR2 + fi + mkdir -p $DIR1 + mkdir -p $DIR2 + echo "Running fs_mark test: $FSMARK_RESULT_PREFIX$t" | tee -a $OUTPUTFILE + RunTest $t +done + +exit 0 |