perf test: new testsuite: perf buildid-list tests
PATCH 4/9 perf test: new testsuite: perf buildid-list tests
This commit adds tests for perf buildid-list tool. It is a placeholder for future perf buildid-cache tests as well.
Signed-off-by Michael Petlan <[email protected]>
--- tools/perf/testsuite/base_buildid/cleanup.sh | 20 ++++++ tools/perf/testsuite/base_buildid/settings.sh | 23 +++++++ tools/perf/testsuite/base_buildid/setup.sh | 26 +++++++ .../testsuite/base_buildid/test_buildid-list.sh | 79 ++++++++++++++++++++++ 4 files changed, 148 insertions(+) create mode 100755 tools/perf/testsuite/base_buildid/cleanup.sh create mode 100644 tools/perf/testsuite/base_buildid/settings.sh create mode 100755 tools/perf/testsuite/base_buildid/setup.sh create mode 100755 tools/perf/testsuite/base_buildid/test_buildid-list.sh
tools/perf/testsuite/base_buildid/cleanup.sh new file +20 -0
@@ -0,0 +1,20 @@ +#!/bin/bash + +# +# cleanup.sh of perf buildid test +# Author: Michael Petlan <[email protected]> +# +# + +# include working environment +. ../common/init.sh +. ./settings.sh + +THIS_TEST_NAME=`basename $0 .sh` + +find . -name \*.log | xargs -r rm +find . -name \*.err | xargs -r rm +test -e perf.data && rm -rf perf.data + +print_results 0 0 "clean-up logs" +exit $?
tools/perf/testsuite/base_buildid/settings.sh new file +23 -0
@@ -0,0 +1,23 @@ +# +# settings.sh of perf buildid test +# Author: Michael Petlan <[email protected]> +# +# Description: +# FIXME +# +# + +export TEST_NAME="perf_buildid-cache" +export MY_ARCH=`arch` +export MY_HOSTNAME=`hostname` +export MY_KERNEL_VERSION=`uname -r` +export MY_CPUS_ONLINE=`nproc` +export MY_CPUS_AVAILABLE=`cat /proc/cpuinfo | grep processor | wc -l` + +# FIXME look for the cache dir to /etc/perfconfig +export BUILDIDDIR="$HOME/.debug" + +clear_buildid_cache() +{ + rm -rf $BUILDIDDIR/* +}
tools/perf/testsuite/base_buildid/setup.sh new file +26 -0
@@ -0,0 +1,26 @@ +#!/bin/bash + +# +# setup.sh of perf buildid test +# Author: Michael Petlan <[email protected]> +# +# Description: +# +# FIXME - maybe the setup is not necessary +# +# + +# include working environment +. ../common/init.sh +. ./settings.sh + +THIS_TEST_NAME=`basename $0 .sh` + +# clear the cache +clear_buildid_cache + +# record some perf.data +$CMD_PERF record -a -- $CMD_LONGER_SLEEP &> setup.log + +print_overall_results $? +exit $?
tools/perf/testsuite/base_buildid/test_buildid-list.sh new file +79 -0
79 lines not on this page · raw message
On Mon, Dec 07, 2015 at 07:53:18PM +0100, Michael Petlan wrote:
SNIP
Quoted 19 lines
tools/perf/testsuite/base_buildid/settings.sh new file +13
-0@@ -0,0 +1,23 @@ +# +# settings.sh of perf buildid test +# Author: Michael Petlan <[email protected]> +# +# Description: +# FIXME +# +# + +export TEST_NAME="perf_buildid-cache" +export MY_ARCH=`arch` +export MY_HOSTNAME=`hostname` +export MY_KERNEL_VERSION=`uname -r`
tools/perf/testsuite/base_buildid/settings.sh line 23
Quoted 10 lines
tools/perf/testsuite/base_buildid/settings.sh new file +10
-0+export MY_CPUS_ONLINE=`nproc` +export MY_CPUS_AVAILABLE=`cat /proc/cpuinfo | grep processor | wc -l` + +# FIXME look for the cache dir to /etc/perfconfig +export BUILDIDDIR="$HOME/.debug" + +clear_buildid_cache() +{ + rm -rf $BUILDIDDIR/* +}
I understand it's supposed to run on developers servers, but cleaning ~/.debug is not a good idea
you could use './perf --buildid-dir DIR' and use
some temporary directory for the buildid cache
thanks,
jirka