aboutsummaryrefslogtreecommitdiffstats
path: root/gcov-mm
blob: cf5e052be2ddd69b5c3c5f731d84392026bf7101 (plain)
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
#!/bin/sh

DEBUGFS=/sys/kernel/debug
GCOV_ROOT=$DEBUGFS/gcov

if [[ $(/usr/bin/stat -fc %T $DEBUGFS) != debugfs ]]; then
	mount -t debugfs debugfs $DEBUGFS
fi
if [[ ! -d $GCOV_ROOT ]]; then
	echo $GCOV_ROOT does not exist
	echo Forgot to enable CONFIG_GCOV_KERNEL / CONFIG_GCOV_PROFILE_ALL?
	exit 1
fi

GCOV_TREE=$(find $GCOV_ROOT -name fs)
GCOV_TREE=$(dirname $GCOV_TREE)
MM_FILES=$(cd $GCOV_TREE/mm; echo *.gcda | sed 's/\.gcda/.c/'; cd - > /dev/null)

cp -a $GCOV_TREE/mm/ . || exit 

cd mm || exit

for file in $MM_FILES
do
	gcov $file > /dev/null
done