buf_comparison: store which data holds array limits in the data_info table
[smatch.git] / smatch_scripts / gen_rosenberg_funcs.sh
blob504464c349a886132d4b525cfe468c342cb49d02
1 #!/bin/bash
3 file=$1
5 if [[ "$file" = "" ]] ; then
6 echo "Usage: $0 <file with smatch messages>"
7 exit 1
8 fi
10 outfile="kernel.rosenberg_funcs"
11 bin_dir=$(dirname $0)
12 remove=$(echo ${bin_dir}/../smatch_data/${outfile}.remove)
13 tmp=$(mktemp /tmp/smatch.XXXX)
14 tmp2=$(mktemp /tmp/smatch.XXXX)
16 echo "// list of copy_to_user function and buffer parameters." > $outfile
17 echo '// generated by `gen_rosenberg_funcs.sh`' >> $outfile
18 ${bin_dir}/trace_params.pl $file copy_to_user 1 >> $tmp
19 ${bin_dir}/trace_params.pl $file nla_put 3 >> $tmp
20 cat $tmp | sort -u > $tmp2
21 mv $tmp2 $tmp
22 cat $tmp $remove $remove 2> /dev/null | sort | uniq -u >> $outfile
23 rm $tmp
24 echo "Done. List saved as '$outfile'"