diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 07:24:57 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 07:24:57 +0000 |
commit | 070852d8604cece0c31f28ff3eb8d21d9ba415fb (patch) | |
tree | 9097175a6a5b8b7e37af9a96269ac0b61a0189cd /decoder/tests/perf-test-scripts | |
parent | Initial commit. (diff) | |
download | libopencsd-upstream.tar.xz libopencsd-upstream.zip |
Adding upstream version 1.3.3.upstream/1.3.3upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'decoder/tests/perf-test-scripts')
-rwxr-xr-x | decoder/tests/perf-test-scripts/perf-setup-env.bash | 51 | ||||
-rwxr-xr-x | decoder/tests/perf-test-scripts/perf-test-report.bash | 14 | ||||
-rwxr-xr-x | decoder/tests/perf-test-scripts/perf-test-script.bash | 11 |
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 $* |