skip_valgrind.cocci 2.1 KB

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