run_valgrind.sh 566 Bytes
Newer Older
Lucas Russo's avatar
Lucas Russo committed
1
#!/bin/bash
2 3
set -u
set -e
Lucas Russo's avatar
Lucas Russo committed
4

5 6
# Prefix
PREFIX=/usr/local
Lucas Russo's avatar
Lucas Russo committed
7 8 9 10 11 12 13 14 15 16 17
# Broker Endpoint
EXPECTED_ARGS=1

if [ "$(id -u)" != "0" ]
then
	echo "This must be run as root"
	exit 1
fi

if [ $# -ne $EXPECTED_ARGS ]
then
18
	echo "Usage: `basename $0` {board slot number}"
Lucas Russo's avatar
Lucas Russo committed
19 20 21
	exit 1;
fi

22
board_slot=$1
Lucas Russo's avatar
Lucas Russo committed
23

24
valgrind --leak-check=yes --trace-children=yes \
25 26 27 28 29 30 31
    --suppressions=valgrind.supp \
    ${PREFIX}/bin/ebpm -f ${PREFIX}/etc/bpm_sw/bpm_sw.cfg \
    -n be -t pcie \
    -i ${board_slot} -e /dev/fpga/${board_slot} -s 0 \
    -b tcp://127.0.0.1:8978 -l stdout > \
    valgrind_report.txt 2>&1