File: code_cov_capture

package info (click to toggle)
intel-gpu-tools 2.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 63,360 kB
  • sloc: xml: 781,458; ansic: 360,567; python: 8,336; yacc: 2,781; perl: 1,196; sh: 1,177; lex: 487; asm: 227; lisp: 35; makefile: 30
file content (27 lines) | stat: -rwxr-xr-x 663 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh

set -e
trap 'catch $LINENO' EXIT
catch() {
	[ $? -eq 0 ] && exit
	echo "$0: error on line $1. Code coverage not stored." >&2
	exit 1
}

if [ -z "$IGT_KERNEL_TREE" ] ; then
	echo "Error! IGT_KERNEL_TREE environment var was not defined." >&2
	exit 1
fi

if [ -z "$1" ] ; then
	echo "Usage: $0 <output>" >&2
	echo "   Please notice that this script assumes $IGT_KERNEL_TREE is used as both Kernel source and object dir." >&2
	exit 1
fi

lcov -q --rc lcov_branch_coverage=1 \
	--test-name "$(basename $1)" -b $IGT_KERNEL_TREE --capture \
	--output-file $1.info

uptime=$(cat /proc/uptime|cut -d' ' -f 1)
echo "[$uptime]     Code coverage wrote to $1.info"