From e44e3482bdb4d0ebde2d8b41830ac2cdb07948fb Mon Sep 17 00:00:00 2001 From: Yang Zhang Date: Fri, 28 Aug 2015 09:58:54 +0800 Subject: Add qemu 2.4.0 Change-Id: Ic99cbad4b61f8b127b7dc74d04576c0bcbaaf4f5 Signed-off-by: Yang Zhang --- qemu/roms/u-boot/test/trace/test-trace.sh | 76 +++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100755 qemu/roms/u-boot/test/trace/test-trace.sh (limited to 'qemu/roms/u-boot/test/trace') diff --git a/qemu/roms/u-boot/test/trace/test-trace.sh b/qemu/roms/u-boot/test/trace/test-trace.sh new file mode 100755 index 000000000..aa02f0947 --- /dev/null +++ b/qemu/roms/u-boot/test/trace/test-trace.sh @@ -0,0 +1,76 @@ +# Copyright (c) 2013 The Chromium OS Authors. +# +# SPDX-License-Identifier: GPL-2.0+ +# + +# Simple test script for tracing with sandbox + +OUTPUT_DIR=sandbox +TRACE_OPT="FTRACE=1" + +fail() { + echo "Test failed: $1" + if [ -n ${tmp} ]; then + rm ${tmp} + fi + exit 1 +} + +build_uboot() { + echo "Build sandbox" + OPTS="O=${OUTPUT_DIR} ${TRACE_OPT}" + NUM_CPUS=$(grep -c processor /proc/cpuinfo) + make ${OPTS} sandbox_config + make ${OPTS} -s -j${NUM_CPUS} +} + +run_trace() { + echo "Run trace" + ./${OUTPUT_DIR}/u-boot < 0 ? 1 : 0)}')" + + if [ "${counts}" != "1 1 0 1 " ]; then + fail "trace collection error: ${counts}" + fi +} + +echo "Simple trace test / sanity check using sandbox" +echo +tmp="$(tempfile)" +build_uboot +run_trace >${tmp} +check_results ${tmp} +rm ${tmp} +echo "Test passed" -- cgit 1.2.3-korg