summaryrefslogtreecommitdiffstats
path: root/decoder/tests/perf-test-scripts
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xdecoder/tests/perf-test-scripts/perf-setup-env.bash51
-rwxr-xr-xdecoder/tests/perf-test-scripts/perf-test-report.bash14
-rwxr-xr-xdecoder/tests/perf-test-scripts/perf-test-script.bash11
3 files changed, 76 insertions, 0 deletions
diff --git a/decoder/tests/perf-test-scripts/perf-setup-env.bash b/decoder/tests/perf-test-scripts/perf-setup-env.bash
new file mode 100755
index 0000000..95bfdc8
--- /dev/null
+++ b/decoder/tests/perf-test-scripts/perf-setup-env.bash
@@ -0,0 +1,51 @@
+#!/bin/bash
+# Script to set up the environment for testing perf with OpenCSD
+#
+# See HOWTO.md for details on how these environment variables should be set and used.
+#
+# to use this script:-
+#
+# 1) for perf exec env only
+# source perf-setup-env.bash
+#
+# 2) for perf build and exec env
+# source perf-setup-env.bash buildenv
+#
+
+#------ User Edits Start -------
+# Edit as required for user system.
+
+# Root of the opencsd library project as cloned from github
+export OPENCSD_ROOT=~/work/opencsd-master
+
+# the opencsd build library directory to use.
+export OCSD_LIB_DIR=lib/builddir
+
+# the root of the perf branch / perf dev-tree as checked out
+export PERF_ROOT=~/work/kernel-dev
+
+# the arm x-compiler toolchain path
+export XTOOLS_PATH=~/work/gcc-x-aarch64-6.2/bin
+
+#------ User Edits End -------
+
+# path to source/include root dir - used by perf build to
+# include Opencsd decoder.
+
+if [ "$1" == "buildenv" ]; then
+ export CSTRACE_PATH=${OPENCSD_ROOT}/decoder
+ export CSLIBS=${CSTRACE_PATH}/${OCSD_LIB_DIR}
+ export CSINCLUDES=${CSTRACE_PATH}/include
+
+ # add library to lib path
+ if [ "${LD_LIBRARY_PATH}" == "" ]; then
+ export LD_LIBRARY_PATH=${CSLIBS}
+ else
+ export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${CSLIBS}
+ fi
+fi
+
+# perf script defines
+export PERF_EXEC_PATH=${PERF_ROOT}/tools/perf
+export PERF_SCRIPT_PATH=${PERF_EXEC_PATH}/scripts/python
+
diff --git a/decoder/tests/perf-test-scripts/perf-test-report.bash b/decoder/tests/perf-test-scripts/perf-test-report.bash
new file mode 100755
index 0000000..f8d4e7e
--- /dev/null
+++ b/decoder/tests/perf-test-scripts/perf-test-report.bash
@@ -0,0 +1,14 @@
+#!/bin/bash
+#
+# Script to run perf report
+#
+# Uses environment set up by perf-setup-env.bash.
+# See HOWTO.md for further details.
+#
+# run from directory containing perf.data file.
+#
+#
+
+${PERF_EXEC_PATH}/perf report --stdio $*
+
+
diff --git a/decoder/tests/perf-test-scripts/perf-test-script.bash b/decoder/tests/perf-test-scripts/perf-test-script.bash
new file mode 100755
index 0000000..745e8b7
--- /dev/null
+++ b/decoder/tests/perf-test-scripts/perf-test-script.bash
@@ -0,0 +1,11 @@
+#!/bin/bash
+#
+# Script to run perf report
+#
+# Uses environment set up by perf-setup-env.bash.
+# See HOWTO.md for further details.
+#
+# run from directory containing perf.data file.
+#
+
+${PERF_EXEC_PATH}/perf --exec-path=${PERF_EXEC_PATH} script --script=python:${PERF_SCRIPT_PATH}/cs-trace-disasm.py -- -d ${XTOOLS_PATH}/aarch64-linux-gnu-objdump $*