fxt.h 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2009-2014 Université de Bordeaux
  4. * Copyright (C) 2010, 2011, 2012, 2013, 2014 Centre National de la Recherche Scientifique
  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. #ifndef __FXT_H__
  18. #define __FXT_H__
  19. #ifndef _GNU_SOURCE
  20. #define _GNU_SOURCE /* ou _BSD_SOURCE ou _SVID_SOURCE */
  21. #endif
  22. #include <string.h>
  23. #include <sys/types.h>
  24. #include <stdlib.h>
  25. #include <common/config.h>
  26. #ifdef HAVE_UNISTD_H
  27. #include <unistd.h>
  28. #endif
  29. #include <common/utils.h>
  30. #include <starpu.h>
  31. /* some key to identify the worker kind */
  32. #define _STARPU_FUT_APPS_KEY 0x100
  33. #define _STARPU_FUT_CPU_KEY 0x101
  34. #define _STARPU_FUT_CUDA_KEY 0x102
  35. #define _STARPU_FUT_OPENCL_KEY 0x103
  36. #define _STARPU_FUT_MIC_KEY 0x104
  37. #define _STARPU_FUT_SCC_KEY 0x105
  38. #define _STARPU_FUT_WORKER_INIT_START 0x5100
  39. #define _STARPU_FUT_WORKER_INIT_END 0x5101
  40. #define _STARPU_FUT_START_CODELET_BODY 0x5102
  41. #define _STARPU_FUT_END_CODELET_BODY 0x5103
  42. #define _STARPU_FUT_JOB_PUSH 0x5104
  43. #define _STARPU_FUT_JOB_POP 0x5105
  44. #define _STARPU_FUT_UPDATE_TASK_CNT 0x5106
  45. #define _STARPU_FUT_START_FETCH_INPUT 0x5107
  46. #define _STARPU_FUT_END_FETCH_INPUT 0x5108
  47. #define _STARPU_FUT_START_PUSH_OUTPUT 0x5109
  48. #define _STARPU_FUT_END_PUSH_OUTPUT 0x5110
  49. #define _STARPU_FUT_TAG 0x5111
  50. #define _STARPU_FUT_TAG_DEPS 0x5112
  51. #define _STARPU_FUT_TASK_DEPS 0x5113
  52. #define _STARPU_FUT_DATA_COPY 0x5114
  53. #define _STARPU_FUT_WORK_STEALING 0x5115
  54. #define _STARPU_FUT_WORKER_DEINIT_START 0x5116
  55. #define _STARPU_FUT_WORKER_DEINIT_END 0x5117
  56. #define _STARPU_FUT_WORKER_SLEEP_START 0x5118
  57. #define _STARPU_FUT_WORKER_SLEEP_END 0x5119
  58. #define _STARPU_FUT_USER_DEFINED_START 0x5120
  59. #define _STARPU_FUT_USER_DEFINED_END 0x5121
  60. #define _STARPU_FUT_NEW_MEM_NODE 0x5122
  61. #define _STARPU_FUT_START_CALLBACK 0x5123
  62. #define _STARPU_FUT_END_CALLBACK 0x5124
  63. #define _STARPU_FUT_TASK_DONE 0x5125
  64. #define _STARPU_FUT_TAG_DONE 0x5126
  65. #define _STARPU_FUT_START_ALLOC 0x5127
  66. #define _STARPU_FUT_END_ALLOC 0x5128
  67. #define _STARPU_FUT_START_ALLOC_REUSE 0x5129
  68. #define _STARPU_FUT_END_ALLOC_REUSE 0x5130
  69. #define _STARPU_FUT_START_MEMRECLAIM 0x5131
  70. #define _STARPU_FUT_END_MEMRECLAIM 0x5132
  71. #define _STARPU_FUT_START_DRIVER_COPY 0x5133
  72. #define _STARPU_FUT_END_DRIVER_COPY 0x5134
  73. #define _STARPU_FUT_START_DRIVER_COPY_ASYNC 0x5135
  74. #define _STARPU_FUT_END_DRIVER_COPY_ASYNC 0x5136
  75. #define _STARPU_FUT_START_PROGRESS 0x5137
  76. #define _STARPU_FUT_END_PROGRESS 0x5138
  77. #define _STARPU_FUT_USER_EVENT 0x5139
  78. #define _STARPU_FUT_SET_PROFILING 0x513a
  79. #define _STARPU_FUT_TASK_WAIT_FOR_ALL 0x513b
  80. #define _STARPU_FUT_EVENT 0x513c
  81. #define _STARPU_FUT_THREAD_EVENT 0x513d
  82. #define _STARPU_FUT_CODELET_DETAILS 0x513e
  83. #define _STARPU_FUT_CODELET_DATA 0x513f
  84. #define _STARPU_FUT_LOCKING_MUTEX 0x5140
  85. #define _STARPU_FUT_MUTEX_LOCKED 0x5141
  86. #define _STARPU_FUT_UNLOCKING_MUTEX 0x5142
  87. #define _STARPU_FUT_MUTEX_UNLOCKED 0x5143
  88. #define _STARPU_FUT_TRYLOCK_MUTEX 0x5144
  89. #define _STARPU_FUT_RDLOCKING_RWLOCK 0x5145
  90. #define _STARPU_FUT_RWLOCK_RDLOCKED 0x5146
  91. #define _STARPU_FUT_WRLOCKING_RWLOCK 0x5147
  92. #define _STARPU_FUT_RWLOCK_WRLOCKED 0x5148
  93. #define _STARPU_FUT_UNLOCKING_RWLOCK 0x5149
  94. #define _STARPU_FUT_RWLOCK_UNLOCKED 0x514a
  95. #define _STARPU_FUT_LOCKING_SPINLOCK 0x514b
  96. #define _STARPU_FUT_SPINLOCK_LOCKED 0x514c
  97. #define _STARPU_FUT_UNLOCKING_SPINLOCK 0x514d
  98. #define _STARPU_FUT_SPINLOCK_UNLOCKED 0x514e
  99. #define _STARPU_FUT_TRYLOCK_SPINLOCK 0x514f
  100. #define _STARPU_FUT_COND_WAIT_BEGIN 0x5150
  101. #define _STARPU_FUT_COND_WAIT_END 0x5151
  102. #define _STARPU_FUT_MEMORY_FULL 0x5152
  103. #define _STARPU_FUT_DATA_LOAD 0x5153
  104. #define _STARPU_FUT_START_UNPARTITION 0x5154
  105. #define _STARPU_FUT_END_UNPARTITION 0x5155
  106. #define _STARPU_FUT_START_FREE 0x5156
  107. #define _STARPU_FUT_END_FREE 0x5157
  108. #define _STARPU_FUT_START_WRITEBACK 0x5158
  109. #define _STARPU_FUT_END_WRITEBACK 0x5159
  110. #define _STARPU_FUT_SCHED_COMPONENT_PUSH_PRIO 0x515a
  111. #define _STARPU_FUT_SCHED_COMPONENT_POP_PRIO 0x515b
  112. #define _STARPU_FUT_HYPERVISOR_BEGIN 0x5160
  113. #define _STARPU_FUT_HYPERVISOR_END 0x5161
  114. #define _STARPU_FUT_BARRIER_WAIT_BEGIN 0x5162
  115. #define _STARPU_FUT_BARRIER_WAIT_END 0x5163
  116. #define _STARPU_FUT_WORKER_SCHEDULING_START 0x5164
  117. #define _STARPU_FUT_WORKER_SCHEDULING_END 0x5165
  118. #define _STARPU_FUT_WORKER_SCHEDULING_PUSH 0x5166
  119. #define _STARPU_FUT_WORKER_SCHEDULING_POP 0x5167
  120. #define _STARPU_FUT_START_EXECUTING 0x5168
  121. #define _STARPU_FUT_END_EXECUTING 0x5169
  122. #ifdef STARPU_USE_FXT
  123. #include <fxt/fxt.h>
  124. #include <fxt/fut.h>
  125. /* Some versions of FxT do not include the declaration of the function */
  126. #ifdef HAVE_ENABLE_FUT_FLUSH
  127. #if !HAVE_DECL_ENABLE_FUT_FLUSH
  128. void enable_fut_flush();
  129. #endif
  130. #endif
  131. #ifdef HAVE_FUT_SET_FILENAME
  132. #if !HAVE_DECL_FUT_SET_FILENAME
  133. void fut_set_filename(char *filename);
  134. #endif
  135. #endif
  136. long _starpu_gettid(void);
  137. /* Initialize the FxT library. */
  138. void _starpu_init_fxt_profiling(unsigned trace_buffer_size);
  139. /* Stop the FxT library, and generate the trace file. */
  140. void _starpu_stop_fxt_profiling(void);
  141. /* Associate the current processing unit to the identifier of the LWP that runs
  142. * the worker. */
  143. void _starpu_fxt_register_thread(unsigned);
  144. #ifdef FUT_NEEDS_COMMIT
  145. #define _STARPU_FUT_COMMIT(size) fut_commitstampedbuffer(size)
  146. #else
  147. #define _STARPU_FUT_COMMIT(size) do { } while (0)
  148. #endif
  149. #ifdef FUT_DO_PROBE1STR
  150. #define _STARPU_FUT_DO_PROBE1STR(CODE, P1, str) FUT_DO_PROBE1STR(CODE, P1, str)
  151. #else
  152. /* Sometimes we need something a little more specific than the wrappers from
  153. * FxT: these macro permit to put add an event with 3 (or 4) numbers followed
  154. * by a string. */
  155. #define _STARPU_FUT_DO_PROBE1STR(CODE, P1, str) \
  156. do { \
  157. if(fut_active) { \
  158. /* No more than FXT_MAX_PARAMS args are allowed */ \
  159. /* we add a \0 just in case ... */ \
  160. size_t len = STARPU_MIN(strlen(str)+1, (FXT_MAX_PARAMS - 1)*sizeof(unsigned long));\
  161. unsigned nbargs_str = (len + sizeof(unsigned long) - 1)/(sizeof(unsigned long));\
  162. unsigned nbargs = 1 + nbargs_str; \
  163. size_t total_len = FUT_SIZE(nbargs); \
  164. unsigned long *futargs = \
  165. fut_getstampedbuffer(FUT_CODE(CODE, nbargs), total_len);\
  166. *(futargs++) = (unsigned long)(P1); \
  167. snprintf((char *)futargs, len, "%s", str); \
  168. ((char *)futargs)[len - 1] = '\0'; \
  169. _STARPU_FUT_COMMIT(total_len); \
  170. } \
  171. } while (0);
  172. #endif
  173. #ifdef FUT_DO_PROBE2STR
  174. #define _STARPU_FUT_DO_PROBE2STR(CODE, P1, P2, str) FUT_DO_PROBE2STR(CODE, P1, P2, str)
  175. #else
  176. /* Sometimes we need something a little more specific than the wrappers from
  177. * FxT: these macro permit to put add an event with 3 (or 4) numbers followed
  178. * by a string. */
  179. #define _STARPU_FUT_DO_PROBE2STR(CODE, P1, P2, str) \
  180. do { \
  181. if(fut_active) { \
  182. /* No more than FXT_MAX_PARAMS args are allowed */ \
  183. /* we add a \0 just in case ... */ \
  184. size_t len = STARPU_MIN(strlen(str)+1, (FXT_MAX_PARAMS - 2)*sizeof(unsigned long));\
  185. unsigned nbargs_str = (len + sizeof(unsigned long) - 1)/(sizeof(unsigned long));\
  186. unsigned nbargs = 2 + nbargs_str; \
  187. size_t total_len = FUT_SIZE(nbargs); \
  188. unsigned long *futargs = \
  189. fut_getstampedbuffer(FUT_CODE(CODE, nbargs), total_len);\
  190. *(futargs++) = (unsigned long)(P1); \
  191. *(futargs++) = (unsigned long)(P2); \
  192. snprintf((char *)futargs, len, "%s", str); \
  193. ((char *)futargs)[len - 1] = '\0'; \
  194. _STARPU_FUT_COMMIT(total_len); \
  195. } \
  196. } while (0);
  197. #endif
  198. #ifdef FUT_DO_PROBE3STR
  199. #define _STARPU_FUT_DO_PROBE3STR(CODE, P1, P2, P3, str) FUT_DO_PROBE3STR(CODE, P1, P2, P3, str)
  200. #else
  201. #define _STARPU_FUT_DO_PROBE3STR(CODE, P1, P2, P3, str) \
  202. do { \
  203. if(fut_active) { \
  204. /* No more than FXT_MAX_PARAMS args are allowed */ \
  205. /* we add a \0 just in case ... */ \
  206. size_t len = STARPU_MIN(strlen(str)+1, (FXT_MAX_PARAMS - 3)*sizeof(unsigned long));\
  207. unsigned nbargs_str = (len + sizeof(unsigned long) - 1)/(sizeof(unsigned long));\
  208. unsigned nbargs = 3 + nbargs_str; \
  209. size_t total_len = FUT_SIZE(nbargs); \
  210. unsigned long *futargs = \
  211. fut_getstampedbuffer(FUT_CODE(CODE, nbargs), total_len);\
  212. *(futargs++) = (unsigned long)(P1); \
  213. *(futargs++) = (unsigned long)(P2); \
  214. *(futargs++) = (unsigned long)(P3); \
  215. snprintf((char *)futargs, len, "%s", str); \
  216. ((char *)futargs)[len - 1] = '\0'; \
  217. _STARPU_FUT_COMMIT(total_len); \
  218. } \
  219. } while (0);
  220. #endif
  221. #ifdef FUT_DO_PROBE4STR
  222. #define _STARPU_FUT_DO_PROBE4STR(CODE, P1, P2, P3, P4, str) FUT_DO_PROBE4STR(CODE, P1, P2, P3, P4, str)
  223. #else
  224. #define _STARPU_FUT_DO_PROBE4STR(CODE, P1, P2, P3, P4, str) \
  225. do { \
  226. if(fut_active) { \
  227. /* No more than FXT_MAX_PARAMS args are allowed */ \
  228. /* we add a \0 just in case ... */ \
  229. size_t len = STARPU_MIN(strlen(str)+1, (FXT_MAX_PARAMS - 4)*sizeof(unsigned long));\
  230. unsigned nbargs_str = (len + sizeof(unsigned long) - 1)/(sizeof(unsigned long));\
  231. unsigned nbargs = 4 + nbargs_str; \
  232. size_t total_len = FUT_SIZE(nbargs); \
  233. unsigned long *futargs = \
  234. fut_getstampedbuffer(FUT_CODE(CODE, nbargs), total_len);\
  235. *(futargs++) = (unsigned long)(P1); \
  236. *(futargs++) = (unsigned long)(P2); \
  237. *(futargs++) = (unsigned long)(P3); \
  238. *(futargs++) = (unsigned long)(P4); \
  239. snprintf((char *)futargs, len, "%s", str); \
  240. ((char *)futargs)[len - 1] = '\0'; \
  241. _STARPU_FUT_COMMIT(total_len); \
  242. } \
  243. } while (0);
  244. #endif
  245. #ifdef FUT_DO_PROBE5STR
  246. #define _STARPU_FUT_DO_PROBE5STR(CODE, P1, P2, P3, P4, P5, str) FUT_DO_PROBE5STR(CODE, P1, P2, P3, P4, P5, str)
  247. #else
  248. #define _STARPU_FUT_DO_PROBE5STR(CODE, P1, P2, P3, P4, P5, str) \
  249. do { \
  250. if(fut_active) { \
  251. /* No more than FXT_MAX_PARAMS args are allowed */ \
  252. /* we add a \0 just in case ... */ \
  253. size_t len = STARPU_MIN(strlen(str)+1, (FXT_MAX_PARAMS - 5)*sizeof(unsigned long));\
  254. unsigned nbargs_str = (len + sizeof(unsigned long) - 1)/(sizeof(unsigned long));\
  255. unsigned nbargs = 5 + nbargs_str; \
  256. size_t total_len = FUT_SIZE(nbargs); \
  257. unsigned long *futargs = \
  258. fut_getstampedbuffer(FUT_CODE(CODE, nbargs), total_len);\
  259. *(futargs++) = (unsigned long)(P1); \
  260. *(futargs++) = (unsigned long)(P2); \
  261. *(futargs++) = (unsigned long)(P3); \
  262. *(futargs++) = (unsigned long)(P4); \
  263. *(futargs++) = (unsigned long)(P5); \
  264. snprintf((char *)futargs, len, "%s", str); \
  265. ((char *)futargs)[len - 1] = '\0'; \
  266. _STARPU_FUT_COMMIT(total_len); \
  267. } \
  268. } while (0);
  269. #endif
  270. #ifdef FUT_DO_PROBE6STR
  271. #define _STARPU_FUT_DO_PROBE6STR(CODE, P1, P2, P3, P4, P5, P6, str) FUT_DO_PROBE6STR(CODE, P1, P2, P3, P4, P5, P6, str)
  272. #else
  273. #define _STARPU_FUT_DO_PROBE6STR(CODE, P1, P2, P3, P4, P5, P6, str) \
  274. do { \
  275. if(fut_active) { \
  276. /* No more than FXT_MAX_PARAMS args are allowed */ \
  277. /* we add a \0 just in case ... */ \
  278. size_t len = STARPU_MIN(strlen(str)+1, (FXT_MAX_PARAMS - 6)*sizeof(unsigned long));\
  279. unsigned nbargs_str = (len + sizeof(unsigned long) - 1)/(sizeof(unsigned long));\
  280. unsigned nbargs = 6 + nbargs_str; \
  281. size_t total_len = FUT_SIZE(nbargs); \
  282. unsigned long *futargs = \
  283. fut_getstampedbuffer(FUT_CODE(CODE, nbargs), total_len);\
  284. *(futargs++) = (unsigned long)(P1); \
  285. *(futargs++) = (unsigned long)(P2); \
  286. *(futargs++) = (unsigned long)(P3); \
  287. *(futargs++) = (unsigned long)(P4); \
  288. *(futargs++) = (unsigned long)(P5); \
  289. *(futargs++) = (unsigned long)(P6); \
  290. snprintf((char *)futargs, len, "%s", str); \
  291. ((char *)futargs)[len - 1] = '\0'; \
  292. _STARPU_FUT_COMMIT(total_len); \
  293. } \
  294. } while (0);
  295. #endif
  296. #ifdef FUT_DO_PROBE7STR
  297. #define _STARPU_FUT_DO_PROBE7STR(CODE, P1, P2, P3, P4, P5, P6, P7, str) FUT_DO_PROBE7STR(CODE, P1, P2, P3, P4, P5, P6, P7, str)
  298. #else
  299. #define _STARPU_FUT_DO_PROBE7STR(CODE, P1, P2, P3, P4, P5, P6, P7, str) \
  300. do { \
  301. if(fut_active) { \
  302. /* No more than FXT_MAX_PARAMS args are allowed */ \
  303. /* we add a \0 just in case ... */ \
  304. size_t len = STARPU_MIN(strlen(str)+1, (FXT_MAX_PARAMS - 7)*sizeof(unsigned long));\
  305. unsigned nbargs_str = (len + sizeof(unsigned long) - 1)/(sizeof(unsigned long));\
  306. unsigned nbargs = 7 + nbargs_str; \
  307. size_t total_len = FUT_SIZE(nbargs); \
  308. unsigned long *futargs = \
  309. fut_getstampedbuffer(FUT_CODE(CODE, nbargs), total_len);\
  310. *(futargs++) = (unsigned long)(P1); \
  311. *(futargs++) = (unsigned long)(P2); \
  312. *(futargs++) = (unsigned long)(P3); \
  313. *(futargs++) = (unsigned long)(P4); \
  314. *(futargs++) = (unsigned long)(P5); \
  315. *(futargs++) = (unsigned long)(P6); \
  316. *(futargs++) = (unsigned long)(P7); \
  317. snprintf((char *)futargs, len, "%s", str); \
  318. ((char *)futargs)[len - 1] = '\0'; \
  319. _STARPU_FUT_COMMIT(total_len); \
  320. } \
  321. } while (0);
  322. #endif
  323. #ifndef FUT_RAW_PROBE7
  324. #define FUT_RAW_PROBE7(CODE,P1,P2,P3,P4,P5,P6,P7) do { \
  325. if(fut_active) { \
  326. unsigned long *__args __attribute__((unused))= \
  327. fut_getstampedbuffer(CODE, \
  328. FUT_SIZE(7)); \
  329. *(__args++)=(unsigned long)(P1);*(__args++)=(unsigned long)(P2);*(__args++)=(unsigned long)(P3);*(__args++)=(unsigned long)(P4);*(__args++)=(unsigned long)(P5);*(__args++)=(unsigned long)(P6);*(__args++)=(unsigned long)(P7); \
  330. _STARPU_FUT_COMMIT(FUT_SIZE(7)); \
  331. } \
  332. } while (0)
  333. #endif
  334. #ifndef FUT_DO_PROBE7
  335. #define FUT_DO_PROBE7(CODE,P1,P2,P3,P4,P5,P6,P7) do { \
  336. FUT_RAW_PROBE7(FUT_CODE(CODE, 7),P1,P2,P3,P4,P5,P6,P7); \
  337. } while (0)
  338. #endif
  339. /* workerkind = _STARPU_FUT_CPU_KEY for instance */
  340. #define _STARPU_TRACE_NEW_MEM_NODE(nodeid) \
  341. FUT_DO_PROBE2(_STARPU_FUT_NEW_MEM_NODE, nodeid, _starpu_gettid());
  342. #define _STARPU_TRACE_WORKER_INIT_START(workerkind, workerid, devid, memnode) \
  343. FUT_DO_PROBE5(_STARPU_FUT_WORKER_INIT_START, workerkind, workerid, devid, memnode, _starpu_gettid());
  344. #define _STARPU_TRACE_WORKER_INIT_END(__workerid) \
  345. FUT_DO_PROBE2(_STARPU_FUT_WORKER_INIT_END, _starpu_gettid(), (__workerid));
  346. #define _STARPU_TRACE_START_CODELET_BODY(job, nimpl, perf_arch, workerid) \
  347. do { \
  348. const char *model_name = _starpu_job_get_model_name((job)); \
  349. if (model_name) \
  350. { \
  351. /* we include the symbol name */ \
  352. _STARPU_FUT_DO_PROBE4STR(_STARPU_FUT_START_CODELET_BODY, (job), ((job)->task)->sched_ctx, workerid, 1, model_name); \
  353. } \
  354. else { \
  355. FUT_DO_PROBE4(_STARPU_FUT_START_CODELET_BODY, (job), ((job)->task)->sched_ctx, workerid, 0); \
  356. } \
  357. { \
  358. if ((job)->task->cl) \
  359. { \
  360. const int __nbuffers = STARPU_TASK_GET_NBUFFERS((job)->task); \
  361. char __buf[FXT_MAX_PARAMS*sizeof(long)]; \
  362. int __i; \
  363. for (__i = 0; __i < __nbuffers; __i++) \
  364. { \
  365. starpu_data_handle_t __handle = STARPU_TASK_GET_HANDLE((job)->task, __i); \
  366. void *__interface = _STARPU_TASK_GET_INTERFACES((job)->task)[__i]; \
  367. if (__handle->ops->describe) \
  368. { \
  369. __handle->ops->describe(__interface, __buf, sizeof(__buf)); \
  370. _STARPU_FUT_DO_PROBE1STR(_STARPU_FUT_CODELET_DATA, workerid, __buf); \
  371. } \
  372. } \
  373. } \
  374. const size_t __job_size = _starpu_job_get_data_size((job)->task->cl?(job)->task->cl->model:NULL, perf_arch, nimpl, (job)); \
  375. const uint32_t __job_hash = _starpu_compute_buffers_footprint((job)->task->cl?(job)->task->cl->model:NULL, perf_arch, nimpl, (job));\
  376. FUT_DO_PROBE7(_STARPU_FUT_CODELET_DETAILS, (job), ((job)->task)->sched_ctx, __job_size, __job_hash, (job)->task->tag_id, workerid, ((job)->job_id)); \
  377. } \
  378. } while(0);
  379. #define _STARPU_TRACE_END_CODELET_BODY(job, nimpl, perf_arch, workerid) \
  380. do { \
  381. const size_t job_size = _starpu_job_get_data_size((job)->task->cl?(job)->task->cl->model:NULL, perf_arch, nimpl, (job)); \
  382. const uint32_t job_hash = _starpu_compute_buffers_footprint((job)->task->cl?(job)->task->cl->model:NULL, perf_arch, nimpl, (job));\
  383. char _archname[32]=""; \
  384. starpu_perfmodel_get_arch_name(perf_arch, _archname, 32, 0); \
  385. _STARPU_FUT_DO_PROBE4STR(_STARPU_FUT_END_CODELET_BODY, (job), (job_size), (job_hash), workerid, _archname); \
  386. } while(0);
  387. #define _STARPU_TRACE_START_EXECUTING() \
  388. FUT_DO_PROBE1(_STARPU_FUT_START_EXECUTING, _starpu_gettid());
  389. #define _STARPU_TRACE_END_EXECUTING() \
  390. FUT_DO_PROBE1(_STARPU_FUT_END_EXECUTING, _starpu_gettid());
  391. #define _STARPU_TRACE_START_CALLBACK(job) \
  392. FUT_DO_PROBE2(_STARPU_FUT_START_CALLBACK, job, _starpu_gettid());
  393. #define _STARPU_TRACE_END_CALLBACK(job) \
  394. FUT_DO_PROBE2(_STARPU_FUT_END_CALLBACK, job, _starpu_gettid());
  395. #define _STARPU_TRACE_JOB_PUSH(task, prio) \
  396. FUT_DO_PROBE3(_STARPU_FUT_JOB_PUSH, task, prio, _starpu_gettid());
  397. #define _STARPU_TRACE_JOB_POP(task, prio) \
  398. FUT_DO_PROBE3(_STARPU_FUT_JOB_POP, task, prio, _starpu_gettid());
  399. #define _STARPU_TRACE_UPDATE_TASK_CNT(counter) \
  400. FUT_DO_PROBE2(_STARPU_FUT_UPDATE_TASK_CNT, counter, _starpu_gettid())
  401. #define _STARPU_TRACE_START_FETCH_INPUT(job) \
  402. FUT_DO_PROBE2(_STARPU_FUT_START_FETCH_INPUT, job, _starpu_gettid());
  403. #define _STARPU_TRACE_END_FETCH_INPUT(job) \
  404. FUT_DO_PROBE2(_STARPU_FUT_END_FETCH_INPUT, job, _starpu_gettid());
  405. #define _STARPU_TRACE_START_PUSH_OUTPUT(job) \
  406. FUT_DO_PROBE2(_STARPU_FUT_START_PUSH_OUTPUT, job, _starpu_gettid());
  407. #define _STARPU_TRACE_END_PUSH_OUTPUT(job) \
  408. FUT_DO_PROBE2(_STARPU_FUT_END_PUSH_OUTPUT, job, _starpu_gettid());
  409. #define _STARPU_TRACE_TAG(tag, job) \
  410. FUT_DO_PROBE2(_STARPU_FUT_TAG, tag, (job)->job_id)
  411. #define _STARPU_TRACE_TAG_DEPS(tag_child, tag_father) \
  412. FUT_DO_PROBE2(_STARPU_FUT_TAG_DEPS, tag_child, tag_father)
  413. #define _STARPU_TRACE_TASK_DEPS(job_prev, job_succ) \
  414. FUT_DO_PROBE2(_STARPU_FUT_TASK_DEPS, (job_prev)->job_id, (job_succ)->job_id)
  415. #define _STARPU_TRACE_GHOST_TASK_DEPS(ghost_prev_id, job_succ_id) \
  416. FUT_DO_PROBE2(_STARPU_FUT_TASK_DEPS, (ghost_prev_id), (job_succ_id))
  417. #define _STARPU_TRACE_TASK_DONE(job) \
  418. do { \
  419. unsigned exclude_from_dag = (job)->exclude_from_dag; \
  420. const char *model_name = _starpu_job_get_model_name((job)); \
  421. if (model_name) \
  422. { \
  423. _STARPU_FUT_DO_PROBE4STR(_STARPU_FUT_TASK_DONE, (job)->job_id, _starpu_gettid(), (long unsigned)exclude_from_dag, 1, model_name);\
  424. } \
  425. else { \
  426. FUT_DO_PROBE4(_STARPU_FUT_TASK_DONE, (job)->job_id, _starpu_gettid(), (long unsigned)exclude_from_dag, 0);\
  427. } \
  428. } while(0);
  429. #define _STARPU_TRACE_TAG_DONE(tag) \
  430. do { \
  431. struct _starpu_job *job = (tag)->job; \
  432. const char *model_name = _starpu_job_get_model_name((job)); \
  433. if (model_name) \
  434. { \
  435. _STARPU_FUT_DO_PROBE3STR(_STARPU_FUT_TAG_DONE, (tag)->id, _starpu_gettid(), 1, model_name); \
  436. } \
  437. else { \
  438. FUT_DO_PROBE3(_STARPU_FUT_TAG_DONE, (tag)->id, _starpu_gettid(), 0);\
  439. } \
  440. } while(0);
  441. #define _STARPU_TRACE_DATA_COPY(src_node, dst_node, size) \
  442. FUT_DO_PROBE3(_STARPU_FUT_DATA_COPY, src_node, dst_node, size)
  443. #define _STARPU_TRACE_START_DRIVER_COPY(src_node, dst_node, size, com_id) \
  444. FUT_DO_PROBE4(_STARPU_FUT_START_DRIVER_COPY, src_node, dst_node, size, com_id)
  445. #define _STARPU_TRACE_END_DRIVER_COPY(src_node, dst_node, size, com_id) \
  446. FUT_DO_PROBE4(_STARPU_FUT_END_DRIVER_COPY, src_node, dst_node, size, com_id)
  447. #define _STARPU_TRACE_START_DRIVER_COPY_ASYNC(src_node, dst_node) \
  448. FUT_DO_PROBE2(_STARPU_FUT_START_DRIVER_COPY_ASYNC, src_node, dst_node)
  449. #define _STARPU_TRACE_END_DRIVER_COPY_ASYNC(src_node, dst_node) \
  450. FUT_DO_PROBE2(_STARPU_FUT_END_DRIVER_COPY_ASYNC, src_node, dst_node)
  451. #define _STARPU_TRACE_WORK_STEALING(empty_q, victim_q) \
  452. FUT_DO_PROBE2(_STARPU_FUT_WORK_STEALING, empty_q, victim_q)
  453. #define _STARPU_TRACE_WORKER_DEINIT_START \
  454. FUT_DO_PROBE1(_STARPU_FUT_WORKER_DEINIT_START, _starpu_gettid());
  455. #define _STARPU_TRACE_WORKER_DEINIT_END(workerkind) \
  456. FUT_DO_PROBE2(_STARPU_FUT_WORKER_DEINIT_END, workerkind, _starpu_gettid());
  457. #define _STARPU_TRACE_WORKER_SCHEDULING_START \
  458. FUT_DO_PROBE1(_STARPU_FUT_WORKER_SCHEDULING_START, _starpu_gettid());
  459. #define _STARPU_TRACE_WORKER_SCHEDULING_END \
  460. FUT_DO_PROBE1(_STARPU_FUT_WORKER_SCHEDULING_END, _starpu_gettid());
  461. #define _STARPU_TRACE_WORKER_SCHEDULING_PUSH \
  462. FUT_DO_PROBE1(_STARPU_FUT_WORKER_SCHEDULING_PUSH, _starpu_gettid());
  463. #define _STARPU_TRACE_WORKER_SCHEDULING_POP \
  464. FUT_DO_PROBE1(_STARPU_FUT_WORKER_SCHEDULING_POP, _starpu_gettid());
  465. #define _STARPU_TRACE_WORKER_SLEEP_START \
  466. FUT_DO_PROBE1(_STARPU_FUT_WORKER_SLEEP_START, _starpu_gettid());
  467. #define _STARPU_TRACE_WORKER_SLEEP_END \
  468. FUT_DO_PROBE1(_STARPU_FUT_WORKER_SLEEP_END, _starpu_gettid());
  469. #define _STARPU_TRACE_USER_DEFINED_START \
  470. FUT_DO_PROBE1(_STARPU_FUT_USER_DEFINED_START, _starpu_gettid());
  471. #define _STARPU_TRACE_USER_DEFINED_END \
  472. FUT_DO_PROBE1(_STARPU_FUT_USER_DEFINED_END, _starpu_gettid());
  473. #define _STARPU_TRACE_START_ALLOC(memnode, size) \
  474. FUT_DO_PROBE3(_STARPU_FUT_START_ALLOC, memnode, _starpu_gettid(), size);
  475. #define _STARPU_TRACE_END_ALLOC(memnode) \
  476. FUT_DO_PROBE2(_STARPU_FUT_END_ALLOC, memnode, _starpu_gettid());
  477. #define _STARPU_TRACE_START_ALLOC_REUSE(memnode, size) \
  478. FUT_DO_PROBE3(_STARPU_FUT_START_ALLOC_REUSE, memnode, _starpu_gettid(), size);
  479. #define _STARPU_TRACE_END_ALLOC_REUSE(memnode) \
  480. FUT_DO_PROBE2(_STARPU_FUT_END_ALLOC_REUSE, memnode, _starpu_gettid());
  481. #define _STARPU_TRACE_START_FREE(memnode, size) \
  482. FUT_DO_PROBE3(_STARPU_FUT_START_FREE, memnode, _starpu_gettid(), size);
  483. #define _STARPU_TRACE_END_FREE(memnode) \
  484. FUT_DO_PROBE2(_STARPU_FUT_END_FREE, memnode, _starpu_gettid());
  485. #define _STARPU_TRACE_START_WRITEBACK(memnode) \
  486. FUT_DO_PROBE2(_STARPU_FUT_START_WRITEBACK, memnode, _starpu_gettid());
  487. #define _STARPU_TRACE_END_WRITEBACK(memnode) \
  488. FUT_DO_PROBE2(_STARPU_FUT_END_WRITEBACK, memnode, _starpu_gettid());
  489. #define _STARPU_TRACE_START_MEMRECLAIM(memnode,is_prefetch) \
  490. FUT_DO_PROBE3(_STARPU_FUT_START_MEMRECLAIM, memnode, is_prefetch, _starpu_gettid());
  491. #define _STARPU_TRACE_END_MEMRECLAIM(memnode, is_prefetch) \
  492. FUT_DO_PROBE3(_STARPU_FUT_END_MEMRECLAIM, memnode, is_prefetch, _starpu_gettid());
  493. /* We skip these events becasue they are called so often that they cause FxT to
  494. * fail and make the overall trace unreadable anyway. */
  495. #define _STARPU_TRACE_START_PROGRESS(memnode) \
  496. do {} while (0)
  497. // FUT_DO_PROBE2(_STARPU_FUT_START_PROGRESS, memnode, _starpu_gettid());
  498. #define _STARPU_TRACE_END_PROGRESS(memnode) \
  499. do {} while (0)
  500. //FUT_DO_PROBE2(_STARPU_FUT_END_PROGRESS, memnode, _starpu_gettid());
  501. #define _STARPU_TRACE_USER_EVENT(code) \
  502. FUT_DO_PROBE2(_STARPU_FUT_USER_EVENT, code, _starpu_gettid());
  503. #define _STARPU_TRACE_SET_PROFILING(status) \
  504. FUT_DO_PROBE2(_STARPU_FUT_SET_PROFILING, status, _starpu_gettid());
  505. #define _STARPU_TRACE_TASK_WAIT_FOR_ALL \
  506. FUT_DO_PROBE0(_STARPU_FUT_TASK_WAIT_FOR_ALL)
  507. #define _STARPU_TRACE_EVENT(S) \
  508. FUT_DO_PROBESTR(_STARPU_FUT_EVENT,S)
  509. #define _STARPU_TRACE_THREAD_EVENT(S) \
  510. _STARPU_FUT_DO_PROBE1STR(_STARPU_FUT_THREAD_EVENT, _starpu_gettid(), S)
  511. #define _STARPU_TRACE_HYPERVISOR_BEGIN() \
  512. FUT_DO_PROBE1(_STARPU_FUT_HYPERVISOR_BEGIN, _starpu_gettid());
  513. #define _STARPU_TRACE_HYPERVISOR_END() \
  514. FUT_DO_PROBE1(_STARPU_FUT_HYPERVISOR_END, _starpu_gettid());
  515. #ifdef STARPU_FXT_LOCK_TRACES
  516. #define _STARPU_TRACE_LOCKING_MUTEX() do { \
  517. const char *file; \
  518. file = strrchr(__FILE__,'/') + 1; \
  519. _STARPU_FUT_DO_PROBE2STR(_STARPU_FUT_LOCKING_MUTEX,__LINE__,_starpu_gettid(),file); \
  520. } while (0)
  521. #define _STARPU_TRACE_MUTEX_LOCKED() do { \
  522. const char *file; \
  523. file = strrchr(__FILE__,'/') + 1; \
  524. _STARPU_FUT_DO_PROBE2STR(_STARPU_FUT_MUTEX_LOCKED,__LINE__,_starpu_gettid(),file); \
  525. } while(0)
  526. #define _STARPU_TRACE_UNLOCKING_MUTEX() do { \
  527. const char *file; \
  528. file = strrchr(__FILE__,'/') + 1; \
  529. _STARPU_FUT_DO_PROBE2STR(_STARPU_FUT_UNLOCKING_MUTEX,__LINE__,_starpu_gettid(),file); \
  530. } while(0)
  531. #define _STARPU_TRACE_MUTEX_UNLOCKED() do {\
  532. const char *file; \
  533. file = strrchr(__FILE__,'/') + 1; \
  534. _STARPU_FUT_DO_PROBE2STR(_STARPU_FUT_MUTEX_UNLOCKED,__LINE__,_starpu_gettid(),file); \
  535. } while(0)
  536. #define _STARPU_TRACE_TRYLOCK_MUTEX() do { \
  537. const char *file; \
  538. file = strrchr(__FILE__,'/') + 1; \
  539. _STARPU_FUT_DO_PROBE2STR(_STARPU_FUT_TRYLOCK_MUTEX,__LINE__,_starpu_gettid(),file); \
  540. } while(0)
  541. #define _STARPU_TRACE_RDLOCKING_RWLOCK() do { \
  542. const char *file; \
  543. file = strrchr(__FILE__,'/') + 1; \
  544. _STARPU_FUT_DO_PROBE2STR(_STARPU_FUT_RDLOCKING_RWLOCK,__LINE__,_starpu_gettid(),file); \
  545. } while(0)
  546. #define _STARPU_TRACE_RWLOCK_RDLOCKED() do { \
  547. const char *file; \
  548. file = strrchr(__FILE__,'/') + 1; \
  549. _STARPU_FUT_DO_PROBE2STR(_STARPU_FUT_RWLOCK_RDLOCKED,__LINE__,_starpu_gettid(),file); \
  550. } while(0)
  551. #define _STARPU_TRACE_WRLOCKING_RWLOCK() do { \
  552. const char *file; \
  553. file = strrchr(__FILE__,'/') + 1; \
  554. _STARPU_FUT_DO_PROBE2STR(_STARPU_FUT_WRLOCKING_RWLOCK,__LINE__,_starpu_gettid(),file); \
  555. } while(0)
  556. #define _STARPU_TRACE_RWLOCK_WRLOCKED() do { \
  557. const char *file; \
  558. file = strrchr(__FILE__,'/') + 1; \
  559. _STARPU_FUT_DO_PROBE2STR(_STARPU_FUT_RWLOCK_WRLOCKED,__LINE__,_starpu_gettid(),file); \
  560. } while(0)
  561. #define _STARPU_TRACE_UNLOCKING_RWLOCK() do { \
  562. const char *file; \
  563. file = strrchr(__FILE__,'/') + 1; \
  564. _STARPU_FUT_DO_PROBE2STR(_STARPU_FUT_UNLOCKING_RWLOCK,__LINE__,_starpu_gettid(),file); \
  565. } while(0)
  566. #define _STARPU_TRACE_RWLOCK_UNLOCKED() do { \
  567. const char *file; \
  568. file = strrchr(__FILE__,'/') + 1; \
  569. _STARPU_FUT_DO_PROBE2STR(_STARPU_FUT_RWLOCK_UNLOCKED,__LINE__,_starpu_gettid(),file); \
  570. } while(0)
  571. #define STARPU_TRACE_SPINLOCK_CONDITITION (starpu_worker_get_type(starpu_worker_get_id()) == STARPU_CUDA_WORKER)
  572. #define _STARPU_TRACE_LOCKING_SPINLOCK() do {\
  573. if (STARPU_TRACE_SPINLOCK_CONDITITION) { \
  574. const char *file; \
  575. file = strrchr(__FILE__,'/') + 1; \
  576. _STARPU_FUT_DO_PROBE2STR(_STARPU_FUT_LOCKING_SPINLOCK,__LINE__,_starpu_gettid(),file); \
  577. } \
  578. } while(0)
  579. #define _STARPU_TRACE_SPINLOCK_LOCKED() do { \
  580. if (STARPU_TRACE_SPINLOCK_CONDITITION) { \
  581. const char *file; \
  582. file = strrchr(__FILE__,'/') + 1; \
  583. _STARPU_FUT_DO_PROBE2STR(_STARPU_FUT_SPINLOCK_LOCKED,__LINE__,_starpu_gettid(),file); \
  584. } \
  585. } while(0)
  586. #define _STARPU_TRACE_UNLOCKING_SPINLOCK() do { \
  587. if (STARPU_TRACE_SPINLOCK_CONDITITION) { \
  588. const char *file; \
  589. file = strrchr(__FILE__,'/') + 1; \
  590. _STARPU_FUT_DO_PROBE2STR(_STARPU_FUT_UNLOCKING_SPINLOCK,__LINE__,_starpu_gettid(),file); \
  591. } \
  592. } while(0)
  593. #define _STARPU_TRACE_SPINLOCK_UNLOCKED() do { \
  594. if (STARPU_TRACE_SPINLOCK_CONDITITION) { \
  595. const char *file; \
  596. file = strrchr(__FILE__,'/') + 1; \
  597. _STARPU_FUT_DO_PROBE2STR(_STARPU_FUT_SPINLOCK_UNLOCKED,__LINE__,_starpu_gettid(),file); \
  598. } \
  599. } while(0)
  600. #define _STARPU_TRACE_TRYLOCK_SPINLOCK() do { \
  601. if (STARPU_TRACE_SPINLOCK_CONDITITION) { \
  602. const char *file; \
  603. file = strrchr(__FILE__,'/') + 1; \
  604. _STARPU_FUT_DO_PROBE2STR(_STARPU_FUT_TRYLOCK_SPINLOCK,__LINE__,_starpu_gettid(),file); \
  605. } \
  606. } while(0)
  607. #define _STARPU_TRACE_COND_WAIT_BEGIN() do { \
  608. const char *file; \
  609. file = strrchr(__FILE__,'/') + 1; \
  610. _STARPU_FUT_DO_PROBE2STR(_STARPU_FUT_COND_WAIT_BEGIN,__LINE__,_starpu_gettid(),file); \
  611. } while(0)
  612. #define _STARPU_TRACE_COND_WAIT_END() do { \
  613. const char *file; \
  614. file = strrchr(__FILE__,'/') + 1; \
  615. _STARPU_FUT_DO_PROBE2STR(_STARPU_FUT_COND_WAIT_END,__LINE__,_starpu_gettid(),file); \
  616. } while(0)
  617. #define _STARPU_TRACE_BARRIER_WAIT_BEGIN() do { \
  618. const char *file; \
  619. file = strrchr(__FILE__,'/') + 1; \
  620. _STARPU_FUT_DO_PROBE2STR(_STARPU_FUT_BARRIER_WAIT_BEGIN,__LINE__,_starpu_gettid(),file); \
  621. } while(0)
  622. #define _STARPU_TRACE_BARRIER_WAIT_END() do { \
  623. const char *file; \
  624. file = strrchr(__FILE__,'/') + 1; \
  625. _STARPU_FUT_DO_PROBE2STR(_STARPU_FUT_BARRIER_WAIT_END,__LINE__,_starpu_gettid(),file); \
  626. } while(0)
  627. #else // !STARPU_FXT_LOCK_TRACES
  628. #define _STARPU_TRACE_LOCKING_MUTEX() do {} while(0)
  629. #define _STARPU_TRACE_MUTEX_LOCKED() do {} while(0)
  630. #define _STARPU_TRACE_UNLOCKING_MUTEX() do {} while(0)
  631. #define _STARPU_TRACE_MUTEX_UNLOCKED() do {} while(0)
  632. #define _STARPU_TRACE_TRYLOCK_MUTEX() do {} while(0)
  633. #define _STARPU_TRACE_RDLOCKING_RWLOCK() do {} while(0)
  634. #define _STARPU_TRACE_RWLOCK_RDLOCKED() do {} while(0)
  635. #define _STARPU_TRACE_WRLOCKING_RWLOCK() do {} while(0)
  636. #define _STARPU_TRACE_RWLOCK_WRLOCKED() do {} while(0)
  637. #define _STARPU_TRACE_UNLOCKING_RWLOCK() do {} while(0)
  638. #define _STARPU_TRACE_RWLOCK_UNLOCKED() do {} while(0)
  639. #define _STARPU_TRACE_LOCKING_SPINLOCK() do {} while(0)
  640. #define _STARPU_TRACE_SPINLOCK_LOCKED() do {} while(0)
  641. #define _STARPU_TRACE_UNLOCKING_SPINLOCK() do {} while(0)
  642. #define _STARPU_TRACE_SPINLOCK_UNLOCKED() do {} while(0)
  643. #define _STARPU_TRACE_TRYLOCK_SPINLOCK() do {} while(0)
  644. #define _STARPU_TRACE_COND_WAIT_BEGIN() do {} while(0)
  645. #define _STARPU_TRACE_COND_WAIT_END() do {} while(0)
  646. #define _STARPU_TRACE_BARRIER_WAIT_BEGIN() do {} while(0)
  647. #define _STARPU_TRACE_BARRIER_WAIT_END() do {} while(0)
  648. #endif // STARPU_FXT_LOCK_TRACES
  649. #define _STARPU_TRACE_MEMORY_FULL(size) \
  650. FUT_DO_PROBE2(_STARPU_FUT_MEMORY_FULL,size,_starpu_gettid());
  651. #define _STARPU_TRACE_DATA_LOAD(workerid,size) \
  652. FUT_DO_PROBE2(_STARPU_FUT_DATA_LOAD, workerid, size);
  653. #define _STARPU_TRACE_START_UNPARTITION(handle, memnode) \
  654. FUT_DO_PROBE3(_STARPU_FUT_START_UNPARTITION, memnode, _starpu_gettid(), handle);
  655. #define _STARPU_TRACE_END_UNPARTITION(handle, memnode) \
  656. FUT_DO_PROBE3(_STARPU_FUT_END_UNPARTITION, memnode, _starpu_gettid(), handle);
  657. #define _STARPU_TRACE_SCHED_COMPONENT_PUSH_PRIO(workerid, ntasks, exp_len) \
  658. FUT_DO_PROBE4(_STARPU_FUT_SCHED_COMPONENT_PUSH_PRIO, _starpu_gettid(), workerid, ntasks, exp_len);
  659. #define _STARPU_TRACE_SCHED_COMPONENT_POP_PRIO(workerid, ntasks, exp_len) \
  660. FUT_DO_PROBE4(_STARPU_FUT_SCHED_COMPONENT_POP_PRIO, _starpu_gettid(), workerid, ntasks, exp_len);
  661. #else // !STARPU_USE_FXT
  662. /* Dummy macros in case FxT is disabled */
  663. #define _STARPU_TRACE_NEW_MEM_NODE(nodeid) do {} while(0)
  664. #define _STARPU_TRACE_WORKER_INIT_START(a,b,c) do {} while(0)
  665. #define _STARPU_TRACE_WORKER_INIT_END(workerid) do {} while(0)
  666. #define _STARPU_TRACE_START_CODELET_BODY(job, nimpl, perf_arch, workerid) do {} while(0)
  667. #define _STARPU_TRACE_END_CODELET_BODY(job, nimpl, perf_arch, workerid) do {} while(0)
  668. #define _STARPU_TRACE_START_EXECUTING() do {} while(0)
  669. #define _STARPU_TRACE_END_EXECUTING() do {} while(0)
  670. #define _STARPU_TRACE_START_CALLBACK(job) do {} while(0)
  671. #define _STARPU_TRACE_END_CALLBACK(job) do {} while(0)
  672. #define _STARPU_TRACE_JOB_PUSH(task, prio) do {} while(0)
  673. #define _STARPU_TRACE_JOB_POP(task, prio) do {} while(0)
  674. #define _STARPU_TRACE_UPDATE_TASK_CNT(counter) do {} while(0)
  675. #define _STARPU_TRACE_START_FETCH_INPUT(job) do {} while(0)
  676. #define _STARPU_TRACE_END_FETCH_INPUT(job) do {} while(0)
  677. #define _STARPU_TRACE_START_PUSH_OUTPUT(job) do {} while(0)
  678. #define _STARPU_TRACE_END_PUSH_OUTPUT(job) do {} while(0)
  679. #define _STARPU_TRACE_TAG(tag, job) do {} while(0)
  680. #define _STARPU_TRACE_TAG_DEPS(a, b) do {} while(0)
  681. #define _STARPU_TRACE_TASK_DEPS(a, b) do {} while(0)
  682. #define _STARPU_TRACE_GHOST_TASK_DEPS(a, b) do {} while(0)
  683. #define _STARPU_TRACE_TASK_DONE(a) do {} while(0)
  684. #define _STARPU_TRACE_TAG_DONE(a) do {} while(0)
  685. #define _STARPU_TRACE_DATA_COPY(a, b, c) do {} while(0)
  686. #define _STARPU_TRACE_START_DRIVER_COPY(a,b,c,d) do {} while(0)
  687. #define _STARPU_TRACE_END_DRIVER_COPY(a,b,c,d) do {} while(0)
  688. #define _STARPU_TRACE_START_DRIVER_COPY_ASYNC(a,b) do {} while(0)
  689. #define _STARPU_TRACE_END_DRIVER_COPY_ASYNC(a,b) do {} while(0)
  690. #define _STARPU_TRACE_WORK_STEALING(a, b) do {} while(0)
  691. #define _STARPU_TRACE_WORKER_DEINIT_START do {} while(0)
  692. #define _STARPU_TRACE_WORKER_DEINIT_END(a) do {} while(0)
  693. #define _STARPU_TRACE_WORKER_SCHEDULING_START do {} while(0)
  694. #define _STARPU_TRACE_WORKER_SCHEDULING_END do {} while(0)
  695. #define _STARPU_TRACE_WORKER_SCHEDULING_PUSH do {} while(0)
  696. #define _STARPU_TRACE_WORKER_SCHEDULING_POP do {} while(0)
  697. #define _STARPU_TRACE_WORKER_SLEEP_START do {} while(0)
  698. #define _STARPU_TRACE_WORKER_SLEEP_END do {} while(0)
  699. #define _STARPU_TRACE_USER_DEFINED_START do {} while(0)
  700. #define _STARPU_TRACE_USER_DEFINED_END do {} while(0)
  701. #define _STARPU_TRACE_START_ALLOC(memnode, size) do {} while(0)
  702. #define _STARPU_TRACE_END_ALLOC(memnode) do {} while(0)
  703. #define _STARPU_TRACE_START_ALLOC_REUSE(a, size) do {} while(0)
  704. #define _STARPU_TRACE_END_ALLOC_REUSE(a) do {} while(0)
  705. #define _STARPU_TRACE_START_FREE(memnode, size) do {} while(0)
  706. #define _STARPU_TRACE_END_FREE(memnode) do {} while(0)
  707. #define _STARPU_TRACE_START_WRITEBACK(memnode) do {} while(0)
  708. #define _STARPU_TRACE_END_WRITEBACK(memnode) do {} while(0)
  709. #define _STARPU_TRACE_START_MEMRECLAIM(memnode,is_prefetch) do {} while(0)
  710. #define _STARPU_TRACE_END_MEMRECLAIM(memnode,is_prefetch) do {} while(0)
  711. #define _STARPU_TRACE_START_PROGRESS(memnode) do {} while(0)
  712. #define _STARPU_TRACE_END_PROGRESS(memnode) do {} while(0)
  713. #define _STARPU_TRACE_USER_EVENT(code) do {} while(0)
  714. #define _STARPU_TRACE_SET_PROFILING(status) do {} while(0)
  715. #define _STARPU_TRACE_TASK_WAIT_FOR_ALL do {} while(0)
  716. #define _STARPU_TRACE_EVENT(S) do {} while(0)
  717. #define _STARPU_TRACE_THREAD_EVENT(S) do {} while(0)
  718. #define _STARPU_TRACE_LOCKING_MUTEX() do {} while(0)
  719. #define _STARPU_TRACE_MUTEX_LOCKED() do {} while(0)
  720. #define _STARPU_TRACE_UNLOCKING_MUTEX() do {} while(0)
  721. #define _STARPU_TRACE_MUTEX_UNLOCKED() do {} while(0)
  722. #define _STARPU_TRACE_TRYLOCK_MUTEX() do {} while(0)
  723. #define _STARPU_TRACE_RDLOCKING_RWLOCK() do {} while(0)
  724. #define _STARPU_TRACE_RWLOCK_RDLOCKED() do {} while(0)
  725. #define _STARPU_TRACE_WRLOCKING_RWLOCK() do {} while(0)
  726. #define _STARPU_TRACE_RWLOCK_WRLOCKED() do {} while(0)
  727. #define _STARPU_TRACE_UNLOCKING_RWLOCK() do {} while(0)
  728. #define _STARPU_TRACE_RWLOCK_UNLOCKED() do {} while(0)
  729. #define _STARPU_TRACE_LOCKING_SPINLOCK() do {} while(0)
  730. #define _STARPU_TRACE_SPINLOCK_LOCKED() do {} while(0)
  731. #define _STARPU_TRACE_UNLOCKING_SPINLOCK() do {} while(0)
  732. #define _STARPU_TRACE_SPINLOCK_UNLOCKED() do {} while(0)
  733. #define _STARPU_TRACE_TRYLOCK_SPINLOCK() do {} while(0)
  734. #define _STARPU_TRACE_COND_WAIT_BEGIN() do {} while(0)
  735. #define _STARPU_TRACE_COND_WAIT_END() do {} while(0)
  736. #define _STARPU_TRACE_BARRIER_WAIT_BEGIN() do {} while(0)
  737. #define _STARPU_TRACE_BARRIER_WAIT_END() do {} while(0)
  738. #define _STARPU_TRACE_MEMORY_FULL(size) do {} while(0)
  739. #define _STARPU_TRACE_DATA_LOAD(workerid,size) do {} while(0)
  740. #define _STARPU_TRACE_START_UNPARTITION(handle, memnode) do {} while(0)
  741. #define _STARPU_TRACE_END_UNPARTITION(handle, memnode) do {} while(0)
  742. #define _STARPU_TRACE_SCHED_COMPONENT_PUSH_PRIO(workerid, ntasks, exp_len) do {} while(0)
  743. #define _STARPU_TRACE_SCHED_COMPONENT_POP_PRIO(workerid, ntasks, exp_len) do {} while(0)
  744. #define _STARPU_TRACE_HYPERVISOR_BEGIN() do {} while(0)
  745. #define _STARPU_TRACE_HYPERVISOR_END() do {} while(0)
  746. #endif // STARPU_USE_FXT
  747. #endif // __FXT_H__