starpu_check_register.sh 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #!/bin/bash
  2. # Note: expects Coccinelle's spatch command n the PATH
  3. # See: http://coccinelle.lip6.fr/
  4. # StarPU --- Runtime system for heterogeneous multicore architectures.
  5. #
  6. # Copyright (C) 2011 CNRS
  7. # Copyright (C) 2011 INRIA
  8. #
  9. # StarPU is free software; you can redistribute it and/or modify
  10. # it under the terms of the GNU Lesser General Public License as published by
  11. # the Free Software Foundation; either version 2.1 of the License, or (at
  12. # your option) any later version.
  13. #
  14. # StarPU is distributed in the hope that it will be useful, but
  15. # WITHOUT ANY WARRANTY; without even the implied warranty of
  16. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  17. #
  18. # See the GNU Lesser General Public License in COPYING.LGPL for more details.
  19. stcolor=$(tput sgr0)
  20. redcolor=$(tput setaf 1)
  21. filese=$(find examples -type f -not -path "*svn*" -name '*.c')
  22. filest=$(find tests -type f -not -path "*svn*" -name '*.c')
  23. for file in $filest $filese ; do
  24. handles=$(spatch -very_quiet -sp_file tools/dev/starpu_check_register.cocci $file)
  25. if test "x$handles" != "x" ; then
  26. for handle in $handles; do
  27. echo "$handle"
  28. register=$(echo $handle|awk -F ',' '{print $1}')
  29. location=$(echo $handle|awk -F ',' '{print $2}')
  30. echo "data handle ${redcolor}${register}${stcolor} registered at location $location does not seem to be properly unregistered"
  31. done
  32. fi
  33. done