db: use correct variable in mem_sql()
[smatch.git] / smatch_scripts / gen_paholes.sh
blob044772b26d5b557317d5806db414318428cf4469
1 #!/bin/bash
3 bin_dir=$(dirname $0)
4 remove=$(echo ${bin_dir}/../smatch_data/kernel.paholes.remove)
5 tmp=$(mktemp /tmp/smatch.XXXX)
7 if [ ! -e vmlinux ] ; then
8 echo "No vmlinux file. Not going to create kernel.paholes."
9 exit 1
12 for i in $(find -name \*.ko) ; do
13 pahole -E $i 2> /dev/null
14 done | $bin_dir/find_expanded_holes.pl | sort -u > $tmp
16 pahole -E vmlinux | $bin_dir/find_expanded_holes.pl | sort -u >> $tmp
18 sort -u $tmp > kernel.paholes
19 mv kernel.paholes $tmp
21 echo "// list of functions and the argument they free." > kernel.paholes
22 echo '// generated by `gen_paholes.sh`' >> kernel.paholes
24 cat $tmp $remove $remove 2> /dev/null | sort | uniq -u >> kernel.paholes
26 rm $tmp
27 echo "Generated kernel.paholes"