skip_valgrind.cocci 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. @find_codelet@
  24. identifier a, b;
  25. identifier func;
  26. position p;
  27. @@
  28. void func@p(void *a[], void *b)
  29. {
  30. ...
  31. }
  32. @is_empty_codelet@
  33. identifier find_codelet.a, find_codelet.b;
  34. identifier find_codelet.func;
  35. position find_codelet.p;
  36. @@
  37. void func@p(void *a[], void *b)
  38. {
  39. }
  40. @is_already_ok@
  41. identifier find_codelet.a, find_codelet.b;
  42. identifier find_codelet.func;
  43. position find_codelet.p;
  44. @@
  45. void func@p(void *a[], void *b)
  46. {
  47. STARPU_SKIP_IF_VALGRIND;
  48. ...
  49. }
  50. @depends on find_codelet && !is_empty_codelet && !is_already_ok && context@
  51. identifier find_codelet.a, find_codelet.b;
  52. identifier find_codelet.func;
  53. position find_codelet.p;
  54. @@
  55. *void func@p(void *a[], void *b)
  56. {
  57. ...
  58. }
  59. @script:python depends on find_codelet && !is_empty_codelet && !is_already_ok && org@
  60. p << find_codelet.p;
  61. @@
  62. coccilib.org.print_todo(p[0], msg)
  63. @depends on find_codelet && !is_empty_codelet && !is_already_ok && patch@
  64. identifier find_codelet.a, find_codelet.b;
  65. identifier find_codelet.func;
  66. position find_codelet.p;
  67. @@
  68. void func@p(void *a[], void *b)
  69. {
  70. +STARPU_SKIP_IF_VALGRIND;
  71. +
  72. ...
  73. }
  74. @script:python depends on find_codelet && !is_empty_codelet && !is_already_ok && report@
  75. p << find_codelet.p;
  76. @@
  77. coccilib.report.print_report(p[0], msg)