rosenberg: handle bit fields better
[smatch.git] / smatch_scripts / gen_rosenberg_funcs.sh
blob0152ba9c1192054677c6f62588b07558edc035a5
1 #!/bin/bash
3 file=$1
4 project=$(echo "$2" | cut -d = -f 2)
6 if [[ "$file" = "" ]] ; then
7 echo "Usage: $0 <file with smatch messages> -p=<project>"
8 exit 1
9 fi
11 if [[ "$project" != "kernel" ]] ; then
12 exit 0
15 outfile="kernel.rosenberg_funcs"
16 bin_dir=$(dirname $0)
17 remove=$(echo ${bin_dir}/../smatch_data/${outfile}.remove)
18 tmp=$(mktemp /tmp/smatch.XXXX)
19 tmp2=$(mktemp /tmp/smatch.XXXX)
21 echo "// list of copy_to_user function and buffer parameters." > $outfile
22 echo '// generated by `gen_rosenberg_funcs.sh`' >> $outfile
23 ${bin_dir}/trace_params.pl $file copy_to_user 1 >> $tmp
24 ${bin_dir}/trace_params.pl $file rds_info_copy 1 >> $tmp
25 ${bin_dir}/trace_params.pl $file nla_put 3 >> $tmp
26 ${bin_dir}/trace_params.pl $file skb_put_data 1 >> $tmp
27 ${bin_dir}/trace_params.pl $file snd_timer_user_append_to_tqueue 1 >> $tmp
28 ${bin_dir}/trace_params.pl $file __send_signal 1 >> $tmp
29 ${bin_dir}/trace_params.pl $file usb_bulk_msg 2 >> $tmp
31 cat $tmp | sort -u > $tmp2
32 mv $tmp2 $tmp
33 cat $tmp $remove $remove 2> /dev/null | sort | uniq -u >> $outfile
34 rm $tmp
35 echo "Done. List saved as '$outfile'"