# 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"