skip_valgrind.cocci 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /*
  2. * StarPU --- Runtime system for heterogeneous multicore architectures.
  3. *
  4. * Copyright (C) 2012 INRIA
  5. *
  6. * StarPU is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU Lesser General Public License as published by
  8. * the Free Software Foundation; either version 2.1 of the License, or (at
  9. * your option) any later version.
  10. *
  11. * StarPU is distributed in the hope that it will be useful, but
  12. * WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  14. *
  15. * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  16. */
  17. virtual context
  18. virtual org
  19. virtual patch
  20. virtual report
  21. @initialize:python depends on report || org@
  22. msg="Should you add STARPU_SKIP_IF_VALGRIND; at the beginning of this function ?"
  23. from re import sub
  24. orgmsg = sub(r'(%[a-z])', r'=\1=', msg)
  25. @find_codelet@
  26. identifier a, b;
  27. identifier func;
  28. position p;
  29. @@
  30. void func@p(void *a[], void *b)
  31. {
  32. ...
  33. }
  34. @is_empty_codelet@
  35. identifier find_codelet.a, find_codelet.b;
  36. identifier find_codelet.func;
  37. position find_codelet.p;
  38. @@
  39. void func@p(void *a[], void *b)
  40. {
  41. }
  42. @is_already_ok@
  43. identifier find_codelet.a, find_codelet.b;
  44. identifier find_codelet.func;
  45. position find_codelet.p;
  46. @@
  47. void func@p(void *a[], void *b)
  48. {
  49. STARPU_SKIP_IF_VALGRIND;
  50. ...
  51. }
  52. @depends on find_codelet && !is_empty_codelet && !is_already_ok && context@
  53. identifier find_codelet.a, find_codelet.b;
  54. identifier find_codelet.func;
  55. position find_codelet.p;
  56. @@
  57. *void func@p(void *a[], void *b)
  58. {
  59. ...
  60. }
  61. @script:python depends on find_codelet && !is_empty_codelet && !is_already_ok && org@
  62. p << find_codelet.p;
  63. @@
  64. coccilib.org.print_todo(p[0], orgmsg)
  65. @depends on find_codelet && !is_empty_codelet && !is_already_ok && patch@
  66. identifier find_codelet.a, find_codelet.b;
  67. identifier find_codelet.func;
  68. position find_codelet.p;
  69. @@
  70. void func@p(void *a[], void *b)
  71. {
  72. +STARPU_SKIP_IF_VALGRIND;
  73. +
  74. ...
  75. }
  76. @script:python depends on find_codelet && !is_empty_codelet && !is_already_ok && report@
  77. p << find_codelet.p;
  78. @@
  79. coccilib.report.print_report(p[0], msg)