fxt.h 48 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2009-2017 Université de Bordeaux
  4. * Copyright (C) 2010, 2011, 2012, 2013, 2014, 2016, 2017 CNRS
  5. * Copyright (C) 2016 Inria
  6. *
  7. * StarPU is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU Lesser General Public License as published by
  9. * the Free Software Foundation; either version 2.1 of the License, or (at
  10. * your option) any later version.
  11. *
  12. * StarPU is distributed in the hope that it will be useful, but
  13. * WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  15. *
  16. * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  17. */
  18. #ifndef __FXT_H__
  19. #define __FXT_H__
  20. #ifndef _GNU_SOURCE
  21. #define _GNU_SOURCE /* ou _BSD_SOURCE ou _SVID_SOURCE */
  22. #endif
  23. #include <string.h>
  24. #include <sys/types.h>
  25. #include <stdlib.h>
  26. #include <common/config.h>
  27. #ifdef HAVE_UNISTD_H
  28. #include <unistd.h>
  29. #endif
  30. #include <common/utils.h>
  31. #include <starpu.h>
  32. /* some key to identify the worker kind */
  33. #define _STARPU_FUT_APPS_KEY 0x100
  34. #define _STARPU_FUT_CPU_KEY 0x101
  35. #define _STARPU_FUT_CUDA_KEY 0x102
  36. #define _STARPU_FUT_OPENCL_KEY 0x103
  37. #define _STARPU_FUT_MIC_KEY 0x104
  38. #define _STARPU_FUT_SCC_KEY 0x105
  39. #define _STARPU_FUT_MPI_KEY 0x106
  40. #define _STARPU_FUT_WORKER_INIT_START 0x5100
  41. #define _STARPU_FUT_WORKER_INIT_END 0x5101
  42. #define _STARPU_FUT_START_CODELET_BODY 0x5102
  43. #define _STARPU_FUT_END_CODELET_BODY 0x5103
  44. #define _STARPU_FUT_JOB_PUSH 0x5104
  45. #define _STARPU_FUT_JOB_POP 0x5105
  46. #define _STARPU_FUT_UPDATE_TASK_CNT 0x5106
  47. #define _STARPU_FUT_START_FETCH_INPUT_ON_TID 0x5107
  48. #define _STARPU_FUT_END_FETCH_INPUT_ON_TID 0x5108
  49. #define _STARPU_FUT_START_PUSH_OUTPUT_ON_TID 0x5109
  50. #define _STARPU_FUT_END_PUSH_OUTPUT_ON_TID 0x5110
  51. #define _STARPU_FUT_TAG 0x5111
  52. #define _STARPU_FUT_TAG_DEPS 0x5112
  53. #define _STARPU_FUT_TASK_DEPS 0x5113
  54. #define _STARPU_FUT_DATA_COPY 0x5114
  55. #define _STARPU_FUT_WORK_STEALING 0x5115
  56. #define _STARPU_FUT_WORKER_DEINIT_START 0x5116
  57. #define _STARPU_FUT_WORKER_DEINIT_END 0x5117
  58. #define _STARPU_FUT_WORKER_SLEEP_START 0x5118
  59. #define _STARPU_FUT_WORKER_SLEEP_END 0x5119
  60. #define _STARPU_FUT_TASK_SUBMIT 0x511a
  61. #define _STARPU_FUT_CODELET_DATA_HANDLE 0x511b
  62. #define _STARPU_FUT_MODEL_NAME 0x511c
  63. #define _STARPU_FUT_DATA_NAME 0x511d
  64. #define _STARPU_FUT_DATA_COORDINATES 0x511e
  65. #define _STARPU_FUT_USER_DEFINED_START 0x5120
  66. #define _STARPU_FUT_USER_DEFINED_END 0x5121
  67. #define _STARPU_FUT_NEW_MEM_NODE 0x5122
  68. #define _STARPU_FUT_START_CALLBACK 0x5123
  69. #define _STARPU_FUT_END_CALLBACK 0x5124
  70. #define _STARPU_FUT_TASK_DONE 0x5125
  71. #define _STARPU_FUT_TAG_DONE 0x5126
  72. #define _STARPU_FUT_START_ALLOC 0x5127
  73. #define _STARPU_FUT_END_ALLOC 0x5128
  74. #define _STARPU_FUT_START_ALLOC_REUSE 0x5129
  75. #define _STARPU_FUT_END_ALLOC_REUSE 0x5130
  76. #define _STARPU_FUT_USED_MEM 0x512a
  77. #define _STARPU_FUT_START_MEMRECLAIM 0x5131
  78. #define _STARPU_FUT_END_MEMRECLAIM 0x5132
  79. #define _STARPU_FUT_START_DRIVER_COPY 0x5133
  80. #define _STARPU_FUT_END_DRIVER_COPY 0x5134
  81. #define _STARPU_FUT_START_DRIVER_COPY_ASYNC 0x5135
  82. #define _STARPU_FUT_END_DRIVER_COPY_ASYNC 0x5136
  83. #define _STARPU_FUT_START_PROGRESS_ON_TID 0x5137
  84. #define _STARPU_FUT_END_PROGRESS_ON_TID 0x5138
  85. #define _STARPU_FUT_USER_EVENT 0x5139
  86. #define _STARPU_FUT_SET_PROFILING 0x513a
  87. #define _STARPU_FUT_TASK_WAIT_FOR_ALL 0x513b
  88. #define _STARPU_FUT_EVENT 0x513c
  89. #define _STARPU_FUT_THREAD_EVENT 0x513d
  90. #define _STARPU_FUT_CODELET_DETAILS 0x513e
  91. #define _STARPU_FUT_CODELET_DATA 0x513f
  92. #define _STARPU_FUT_LOCKING_MUTEX 0x5140
  93. #define _STARPU_FUT_MUTEX_LOCKED 0x5141
  94. #define _STARPU_FUT_UNLOCKING_MUTEX 0x5142
  95. #define _STARPU_FUT_MUTEX_UNLOCKED 0x5143
  96. #define _STARPU_FUT_TRYLOCK_MUTEX 0x5144
  97. #define _STARPU_FUT_RDLOCKING_RWLOCK 0x5145
  98. #define _STARPU_FUT_RWLOCK_RDLOCKED 0x5146
  99. #define _STARPU_FUT_WRLOCKING_RWLOCK 0x5147
  100. #define _STARPU_FUT_RWLOCK_WRLOCKED 0x5148
  101. #define _STARPU_FUT_UNLOCKING_RWLOCK 0x5149
  102. #define _STARPU_FUT_RWLOCK_UNLOCKED 0x514a
  103. #define _STARPU_FUT_LOCKING_SPINLOCK 0x514b
  104. #define _STARPU_FUT_SPINLOCK_LOCKED 0x514c
  105. #define _STARPU_FUT_UNLOCKING_SPINLOCK 0x514d
  106. #define _STARPU_FUT_SPINLOCK_UNLOCKED 0x514e
  107. #define _STARPU_FUT_TRYLOCK_SPINLOCK 0x514f
  108. #define _STARPU_FUT_COND_WAIT_BEGIN 0x5150
  109. #define _STARPU_FUT_COND_WAIT_END 0x5151
  110. #define _STARPU_FUT_MEMORY_FULL 0x5152
  111. #define _STARPU_FUT_DATA_LOAD 0x5153
  112. #define _STARPU_FUT_START_UNPARTITION_ON_TID 0x5154
  113. #define _STARPU_FUT_END_UNPARTITION_ON_TID 0x5155
  114. #define _STARPU_FUT_START_FREE 0x5156
  115. #define _STARPU_FUT_END_FREE 0x5157
  116. #define _STARPU_FUT_START_WRITEBACK 0x5158
  117. #define _STARPU_FUT_END_WRITEBACK 0x5159
  118. #define _STARPU_FUT_SCHED_COMPONENT_PUSH_PRIO 0x515a
  119. #define _STARPU_FUT_SCHED_COMPONENT_POP_PRIO 0x515b
  120. #define _STARPU_FUT_START_WRITEBACK_ASYNC 0x515c
  121. #define _STARPU_FUT_END_WRITEBACK_ASYNC 0x515d
  122. #define _STARPU_FUT_HYPERVISOR_BEGIN 0x5160
  123. #define _STARPU_FUT_HYPERVISOR_END 0x5161
  124. #define _STARPU_FUT_BARRIER_WAIT_BEGIN 0x5162
  125. #define _STARPU_FUT_BARRIER_WAIT_END 0x5163
  126. #define _STARPU_FUT_WORKER_SCHEDULING_START 0x5164
  127. #define _STARPU_FUT_WORKER_SCHEDULING_END 0x5165
  128. #define _STARPU_FUT_WORKER_SCHEDULING_PUSH 0x5166
  129. #define _STARPU_FUT_WORKER_SCHEDULING_POP 0x5167
  130. #define _STARPU_FUT_START_EXECUTING 0x5168
  131. #define _STARPU_FUT_END_EXECUTING 0x5169
  132. #define _STARPU_FUT_SCHED_COMPONENT_NEW 0x516a
  133. #define _STARPU_FUT_SCHED_COMPONENT_CONNECT 0x516b
  134. #define _STARPU_FUT_SCHED_COMPONENT_PUSH 0x516c
  135. #define _STARPU_FUT_SCHED_COMPONENT_PULL 0x516d
  136. #define _STARPU_FUT_TASK_SUBMIT_START 0x516e
  137. #define _STARPU_FUT_TASK_SUBMIT_END 0x516f
  138. #define _STARPU_FUT_TASK_BUILD_START 0x5170
  139. #define _STARPU_FUT_TASK_BUILD_END 0x5171
  140. #define _STARPU_FUT_TASK_MPI_DECODE_START 0x5172
  141. #define _STARPU_FUT_TASK_MPI_DECODE_END 0x5173
  142. #define _STARPU_FUT_TASK_MPI_PRE_START 0x5174
  143. #define _STARPU_FUT_TASK_MPI_PRE_END 0x5175
  144. #define _STARPU_FUT_TASK_MPI_POST_START 0x5176
  145. #define _STARPU_FUT_TASK_MPI_POST_END 0x5177
  146. #define _STARPU_FUT_TASK_WAIT_START 0x5178
  147. #define _STARPU_FUT_TASK_WAIT_END 0x5179
  148. #define _STARPU_FUT_TASK_WAIT_FOR_ALL_START 0x517a
  149. #define _STARPU_FUT_TASK_WAIT_FOR_ALL_END 0x517b
  150. #define _STARPU_FUT_HANDLE_DATA_REGISTER 0x517c
  151. #define _STARPU_FUT_DATA_INVALIDATE 0x517d
  152. #define _STARPU_FUT_START_FETCH_INPUT 0x517e
  153. #define _STARPU_FUT_END_FETCH_INPUT 0x517f
  154. #define _STARPU_FUT_TASK_THROTTLE_START 0x5180
  155. #define _STARPU_FUT_TASK_THROTTLE_END 0x5181
  156. #ifdef STARPU_USE_FXT
  157. #include <fxt/fxt.h>
  158. #include <fxt/fut.h>
  159. /* Some versions of FxT do not include the declaration of the function */
  160. #ifdef HAVE_ENABLE_FUT_FLUSH
  161. #if !HAVE_DECL_ENABLE_FUT_FLUSH
  162. void enable_fut_flush();
  163. #endif
  164. #endif
  165. #ifdef HAVE_FUT_SET_FILENAME
  166. #if !HAVE_DECL_FUT_SET_FILENAME
  167. void fut_set_filename(char *filename);
  168. #endif
  169. #endif
  170. extern int _starpu_fxt_started;
  171. extern starpu_pthread_mutex_t _starpu_fxt_started_mutex;
  172. extern starpu_pthread_cond_t _starpu_fxt_started_cond;
  173. static inline void _starpu_fxt_wait_initialisation()
  174. {
  175. STARPU_PTHREAD_MUTEX_LOCK(&_starpu_fxt_started_mutex);
  176. while (!_starpu_fxt_started)
  177. STARPU_PTHREAD_COND_WAIT(&_starpu_fxt_started_cond, &_starpu_fxt_started_mutex);
  178. STARPU_PTHREAD_MUTEX_UNLOCK(&_starpu_fxt_started_mutex);
  179. }
  180. long _starpu_gettid(void);
  181. /* Initialize the FxT library. */
  182. void _starpu_fxt_init_profiling(unsigned trace_buffer_size);
  183. /* Stop the FxT library, and generate the trace file. */
  184. void _starpu_stop_fxt_profiling(void);
  185. /* Associate the current processing unit to the identifier of the LWP that runs
  186. * the worker. */
  187. void _starpu_fxt_register_thread(unsigned);
  188. #ifdef FUT_NEEDS_COMMIT
  189. #define _STARPU_FUT_COMMIT(size) fut_commitstampedbuffer(size)
  190. #else
  191. #define _STARPU_FUT_COMMIT(size) do { } while (0)
  192. #endif
  193. #ifdef FUT_DO_PROBE1STR
  194. #define _STARPU_FUT_DO_PROBE1STR(CODE, P1, str) FUT_DO_PROBE1STR(CODE, P1, str)
  195. #else
  196. /* Sometimes we need something a little more specific than the wrappers from
  197. * FxT: these macro permit to put add an event with 3 (or 4) numbers followed
  198. * by a string. */
  199. #define _STARPU_FUT_DO_PROBE1STR(CODE, P1, str) \
  200. do { \
  201. if(fut_active) { \
  202. /* No more than FXT_MAX_PARAMS args are allowed */ \
  203. /* we add a \0 just in case ... */ \
  204. size_t len = STARPU_MIN(strlen(str)+1, (FXT_MAX_PARAMS - 1)*sizeof(unsigned long));\
  205. unsigned nbargs_str = (len + sizeof(unsigned long) - 1)/(sizeof(unsigned long));\
  206. unsigned nbargs = 1 + nbargs_str; \
  207. size_t total_len = FUT_SIZE(nbargs); \
  208. unsigned long *futargs = \
  209. fut_getstampedbuffer(FUT_CODE(CODE, nbargs), total_len);\
  210. *(futargs++) = (unsigned long)(P1); \
  211. snprintf((char *)futargs, len, "%s", str); \
  212. ((char *)futargs)[len - 1] = '\0'; \
  213. _STARPU_FUT_COMMIT(total_len); \
  214. } \
  215. } while (0);
  216. #endif
  217. #ifdef FUT_DO_PROBE2STR
  218. #define _STARPU_FUT_DO_PROBE2STR(CODE, P1, P2, str) FUT_DO_PROBE2STR(CODE, P1, P2, str)
  219. #else
  220. /* Sometimes we need something a little more specific than the wrappers from
  221. * FxT: these macro permit to put add an event with 3 (or 4) numbers followed
  222. * by a string. */
  223. #define _STARPU_FUT_DO_PROBE2STR(CODE, P1, P2, str) \
  224. do { \
  225. if(fut_active) { \
  226. /* No more than FXT_MAX_PARAMS args are allowed */ \
  227. /* we add a \0 just in case ... */ \
  228. size_t len = STARPU_MIN(strlen(str)+1, (FXT_MAX_PARAMS - 2)*sizeof(unsigned long));\
  229. unsigned nbargs_str = (len + sizeof(unsigned long) - 1)/(sizeof(unsigned long));\
  230. unsigned nbargs = 2 + nbargs_str; \
  231. size_t total_len = FUT_SIZE(nbargs); \
  232. unsigned long *futargs = \
  233. fut_getstampedbuffer(FUT_CODE(CODE, nbargs), total_len);\
  234. *(futargs++) = (unsigned long)(P1); \
  235. *(futargs++) = (unsigned long)(P2); \
  236. snprintf((char *)futargs, len, "%s", str); \
  237. ((char *)futargs)[len - 1] = '\0'; \
  238. _STARPU_FUT_COMMIT(total_len); \
  239. } \
  240. } while (0);
  241. #endif
  242. #ifdef FUT_DO_PROBE3STR
  243. #define _STARPU_FUT_DO_PROBE3STR(CODE, P1, P2, P3, str) FUT_DO_PROBE3STR(CODE, P1, P2, P3, str)
  244. #else
  245. #define _STARPU_FUT_DO_PROBE3STR(CODE, P1, P2, P3, str) \
  246. do { \
  247. if(fut_active) { \
  248. /* No more than FXT_MAX_PARAMS args are allowed */ \
  249. /* we add a \0 just in case ... */ \
  250. size_t len = STARPU_MIN(strlen(str)+1, (FXT_MAX_PARAMS - 3)*sizeof(unsigned long));\
  251. unsigned nbargs_str = (len + sizeof(unsigned long) - 1)/(sizeof(unsigned long));\
  252. unsigned nbargs = 3 + nbargs_str; \
  253. size_t total_len = FUT_SIZE(nbargs); \
  254. unsigned long *futargs = \
  255. fut_getstampedbuffer(FUT_CODE(CODE, nbargs), total_len);\
  256. *(futargs++) = (unsigned long)(P1); \
  257. *(futargs++) = (unsigned long)(P2); \
  258. *(futargs++) = (unsigned long)(P3); \
  259. snprintf((char *)futargs, len, "%s", str); \
  260. ((char *)futargs)[len - 1] = '\0'; \
  261. _STARPU_FUT_COMMIT(total_len); \
  262. } \
  263. } while (0);
  264. #endif
  265. #ifdef FUT_DO_PROBE4STR
  266. #define _STARPU_FUT_DO_PROBE4STR(CODE, P1, P2, P3, P4, str) FUT_DO_PROBE4STR(CODE, P1, P2, P3, P4, str)
  267. #else
  268. #define _STARPU_FUT_DO_PROBE4STR(CODE, P1, P2, P3, P4, str) \
  269. do { \
  270. if(fut_active) { \
  271. /* No more than FXT_MAX_PARAMS args are allowed */ \
  272. /* we add a \0 just in case ... */ \
  273. size_t len = STARPU_MIN(strlen(str)+1, (FXT_MAX_PARAMS - 4)*sizeof(unsigned long));\
  274. unsigned nbargs_str = (len + sizeof(unsigned long) - 1)/(sizeof(unsigned long));\
  275. unsigned nbargs = 4 + nbargs_str; \
  276. size_t total_len = FUT_SIZE(nbargs); \
  277. unsigned long *futargs = \
  278. fut_getstampedbuffer(FUT_CODE(CODE, nbargs), total_len);\
  279. *(futargs++) = (unsigned long)(P1); \
  280. *(futargs++) = (unsigned long)(P2); \
  281. *(futargs++) = (unsigned long)(P3); \
  282. *(futargs++) = (unsigned long)(P4); \
  283. snprintf((char *)futargs, len, "%s", str); \
  284. ((char *)futargs)[len - 1] = '\0'; \
  285. _STARPU_FUT_COMMIT(total_len); \
  286. } \
  287. } while (0);
  288. #endif
  289. #ifdef FUT_DO_PROBE5STR
  290. #define _STARPU_FUT_DO_PROBE5STR(CODE, P1, P2, P3, P4, P5, str) FUT_DO_PROBE5STR(CODE, P1, P2, P3, P4, P5, str)
  291. #else
  292. #define _STARPU_FUT_DO_PROBE5STR(CODE, P1, P2, P3, P4, P5, str) \
  293. do { \
  294. if(fut_active) { \
  295. /* No more than FXT_MAX_PARAMS args are allowed */ \
  296. /* we add a \0 just in case ... */ \
  297. size_t len = STARPU_MIN(strlen(str)+1, (FXT_MAX_PARAMS - 5)*sizeof(unsigned long));\
  298. unsigned nbargs_str = (len + sizeof(unsigned long) - 1)/(sizeof(unsigned long));\
  299. unsigned nbargs = 5 + nbargs_str; \
  300. size_t total_len = FUT_SIZE(nbargs); \
  301. unsigned long *futargs = \
  302. fut_getstampedbuffer(FUT_CODE(CODE, nbargs), total_len);\
  303. *(futargs++) = (unsigned long)(P1); \
  304. *(futargs++) = (unsigned long)(P2); \
  305. *(futargs++) = (unsigned long)(P3); \
  306. *(futargs++) = (unsigned long)(P4); \
  307. *(futargs++) = (unsigned long)(P5); \
  308. snprintf((char *)futargs, len, "%s", str); \
  309. ((char *)futargs)[len - 1] = '\0'; \
  310. _STARPU_FUT_COMMIT(total_len); \
  311. } \
  312. } while (0);
  313. #endif
  314. #ifdef FUT_DO_PROBE6STR
  315. #define _STARPU_FUT_DO_PROBE6STR(CODE, P1, P2, P3, P4, P5, P6, str) FUT_DO_PROBE6STR(CODE, P1, P2, P3, P4, P5, P6, str)
  316. #else
  317. #define _STARPU_FUT_DO_PROBE6STR(CODE, P1, P2, P3, P4, P5, P6, str) \
  318. do { \
  319. if(fut_active) { \
  320. /* No more than FXT_MAX_PARAMS args are allowed */ \
  321. /* we add a \0 just in case ... */ \
  322. size_t len = STARPU_MIN(strlen(str)+1, (FXT_MAX_PARAMS - 6)*sizeof(unsigned long));\
  323. unsigned nbargs_str = (len + sizeof(unsigned long) - 1)/(sizeof(unsigned long));\
  324. unsigned nbargs = 6 + nbargs_str; \
  325. size_t total_len = FUT_SIZE(nbargs); \
  326. unsigned long *futargs = \
  327. fut_getstampedbuffer(FUT_CODE(CODE, nbargs), total_len);\
  328. *(futargs++) = (unsigned long)(P1); \
  329. *(futargs++) = (unsigned long)(P2); \
  330. *(futargs++) = (unsigned long)(P3); \
  331. *(futargs++) = (unsigned long)(P4); \
  332. *(futargs++) = (unsigned long)(P5); \
  333. *(futargs++) = (unsigned long)(P6); \
  334. snprintf((char *)futargs, len, "%s", str); \
  335. ((char *)futargs)[len - 1] = '\0'; \
  336. _STARPU_FUT_COMMIT(total_len); \
  337. } \
  338. } while (0);
  339. #endif
  340. #ifdef FUT_DO_PROBE7STR
  341. #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)
  342. #else
  343. #define _STARPU_FUT_DO_PROBE7STR(CODE, P1, P2, P3, P4, P5, P6, P7, str) \
  344. do { \
  345. if(fut_active) { \
  346. /* No more than FXT_MAX_PARAMS args are allowed */ \
  347. /* we add a \0 just in case ... */ \
  348. size_t len = STARPU_MIN(strlen(str)+1, (FXT_MAX_PARAMS - 7)*sizeof(unsigned long));\
  349. unsigned nbargs_str = (len + sizeof(unsigned long) - 1)/(sizeof(unsigned long));\
  350. unsigned nbargs = 7 + nbargs_str; \
  351. size_t total_len = FUT_SIZE(nbargs); \
  352. unsigned long *futargs = \
  353. fut_getstampedbuffer(FUT_CODE(CODE, nbargs), total_len);\
  354. *(futargs++) = (unsigned long)(P1); \
  355. *(futargs++) = (unsigned long)(P2); \
  356. *(futargs++) = (unsigned long)(P3); \
  357. *(futargs++) = (unsigned long)(P4); \
  358. *(futargs++) = (unsigned long)(P5); \
  359. *(futargs++) = (unsigned long)(P6); \
  360. *(futargs++) = (unsigned long)(P7); \
  361. snprintf((char *)futargs, len, "%s", str); \
  362. ((char *)futargs)[len - 1] = '\0'; \
  363. _STARPU_FUT_COMMIT(total_len); \
  364. } \
  365. } while (0);
  366. #endif
  367. #ifndef FUT_RAW_PROBE7
  368. #define FUT_RAW_PROBE7(CODE,P1,P2,P3,P4,P5,P6,P7) do { \
  369. if(fut_active) { \
  370. unsigned long *__args __attribute__((unused))= \
  371. fut_getstampedbuffer(CODE, \
  372. FUT_SIZE(7)); \
  373. *(__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); \
  374. _STARPU_FUT_COMMIT(FUT_SIZE(7)); \
  375. } \
  376. } while (0)
  377. #endif
  378. #ifndef FUT_DO_PROBE7
  379. #define FUT_DO_PROBE7(CODE,P1,P2,P3,P4,P5,P6,P7) do { \
  380. FUT_RAW_PROBE7(FUT_CODE(CODE, 7),P1,P2,P3,P4,P5,P6,P7); \
  381. } while (0)
  382. #endif
  383. #ifndef FUT_RAW_ALWAYS_PROBE2
  384. #define FUT_RAW_ALWAYS_PROBE2(CODE,P1,P2) do { \
  385. unsigned long *__args __attribute__((unused))= \
  386. fut_getstampedbuffer(CODE, \
  387. FUT_SIZE(2)); \
  388. *(__args++)=(unsigned long)(P1);*(__args++)=(unsigned long)(P2); \
  389. fut_commitstampedbuffer(FUT_SIZE(2)); \
  390. } while (0)
  391. #endif
  392. #define FUT_DO_ALWAYS_PROBE2(CODE,P1,P2) do { \
  393. FUT_RAW_ALWAYS_PROBE2(FUT_CODE(CODE, 2),P1,P2); \
  394. } while (0)
  395. #ifndef FUT_RAW_ALWAYS_PROBE3
  396. #define FUT_RAW_ALWAYS_PROBE3(CODE,P1,P2,P3) do { \
  397. unsigned long *__args __attribute__((unused))= \
  398. fut_getstampedbuffer(CODE, \
  399. FUT_SIZE(3)); \
  400. *(__args++)=(unsigned long)(P1);*(__args++)=(unsigned long)(P2);*(__args++)=(unsigned long)(P3); \
  401. fut_commitstampedbuffer(FUT_SIZE(3)); \
  402. } while (0)
  403. #endif
  404. #define FUT_DO_ALWAYS_PROBE3(CODE,P1,P2,P3) do { \
  405. FUT_RAW_ALWAYS_PROBE3(FUT_CODE(CODE, 3),P1,P2,P3); \
  406. } while (0)
  407. #ifndef FUT_RAW_ALWAYS_PROBE4
  408. #define FUT_RAW_ALWAYS_PROBE4(CODE,P1,P2,P3,P4) do { \
  409. unsigned long *__args __attribute__((unused))= \
  410. fut_getstampedbuffer(CODE, \
  411. FUT_SIZE(4)); \
  412. *(__args++)=(unsigned long)(P1);*(__args++)=(unsigned long)(P2);*(__args++)=(unsigned long)(P3);*(__args++)=(unsigned long)(P4); \
  413. fut_commitstampedbuffer(FUT_SIZE(4)); \
  414. } while (0)
  415. #endif
  416. #define FUT_DO_ALWAYS_PROBE4(CODE,P1,P2,P3,P4) do { \
  417. FUT_RAW_ALWAYS_PROBE4(FUT_CODE(CODE, 4),P1,P2,P3,P4); \
  418. } while (0)
  419. #ifndef FUT_RAW_ALWAYS_PROBE5
  420. #define FUT_RAW_ALWAYS_PROBE5(CODE,P1,P2,P3,P4,P5) do { \
  421. unsigned long *__args __attribute__((unused))= \
  422. fut_getstampedbuffer(CODE, \
  423. FUT_SIZE(5)); \
  424. *(__args++)=(unsigned long)(P1);*(__args++)=(unsigned long)(P2);*(__args++)=(unsigned long)(P3);*(__args++)=(unsigned long)(P4);*(__args++)=(unsigned long)(P5); \
  425. fut_commitstampedbuffer(FUT_SIZE(5)); \
  426. } while (0)
  427. #endif
  428. #define FUT_DO_ALWAYS_PROBE5(CODE,P1,P2,P3,P4,P5) do { \
  429. FUT_RAW_ALWAYS_PROBE5(FUT_CODE(CODE, 5),P1,P2,P3,P4,P5); \
  430. } while (0)
  431. #ifndef FUT_RAW_ALWAYS_PROBE6
  432. #define FUT_RAW_ALWAYS_PROBE6(CODE,P1,P2,P3,P4,P5,P6) do { \
  433. unsigned long *__args __attribute__((unused))= \
  434. fut_getstampedbuffer(CODE, \
  435. FUT_SIZE(6)); \
  436. *(__args++)=(unsigned long)(P1);*(__args++)=(unsigned long)(P2);*(__args++)=(unsigned long)(P3);*(__args++)=(unsigned long)(P4);*(__args++)=(unsigned long)(P5);*(__args++)=(unsigned long)(P6); \
  437. fut_commitstampedbuffer(FUT_SIZE(6)); \
  438. } while (0)
  439. #endif
  440. #define FUT_DO_ALWAYS_PROBE6(CODE,P1,P2,P3,P4,P5,P6) do { \
  441. FUT_RAW_ALWAYS_PROBE6(FUT_CODE(CODE, 6),P1,P2,P3,P4,P5,P6); \
  442. } while (0)
  443. #ifndef FUT_RAW_ALWAYS_PROBE7
  444. #define FUT_RAW_ALWAYS_PROBE7(CODE,P1,P2,P3,P4,P5,P6,P7) do { \
  445. unsigned long *__args __attribute__((unused))= \
  446. fut_getstampedbuffer(CODE, \
  447. FUT_SIZE(7)); \
  448. *(__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); \
  449. fut_commitstampedbuffer(FUT_SIZE(7)); \
  450. } while (0)
  451. #endif
  452. #define FUT_DO_ALWAYS_PROBE7(CODE,P1,P2,P3,P4,P5,P6,P7) do { \
  453. FUT_RAW_ALWAYS_PROBE7(FUT_CODE(CODE, 7),P1,P2,P3,P4,P5,P6,P7); \
  454. } while (0)
  455. /* workerkind = _STARPU_FUT_CPU_KEY for instance */
  456. #define _STARPU_TRACE_NEW_MEM_NODE(nodeid) \
  457. FUT_DO_ALWAYS_PROBE2(_STARPU_FUT_NEW_MEM_NODE, nodeid, _starpu_gettid());
  458. #define _STARPU_TRACE_WORKER_INIT_START(workerkind, workerid, devid, memnode, bindid, sync) \
  459. FUT_DO_PROBE7(_STARPU_FUT_WORKER_INIT_START, workerkind, workerid, devid, memnode, bindid, sync, _starpu_gettid());
  460. #define _STARPU_TRACE_WORKER_INIT_END(__workerid) \
  461. FUT_DO_PROBE2(_STARPU_FUT_WORKER_INIT_END, _starpu_gettid(), (__workerid));
  462. #define _STARPU_TRACE_START_CODELET_BODY(job, nimpl, perf_arch, workerid) \
  463. do { \
  464. const char *model_name = _starpu_job_get_model_name((job)), *name = _starpu_job_get_task_name((job)); \
  465. if (name) \
  466. { \
  467. /* we include the task name */ \
  468. _STARPU_FUT_DO_PROBE5STR(_STARPU_FUT_START_CODELET_BODY, (job)->job_id, ((job)->task)->sched_ctx, workerid, starpu_worker_get_memory_node(workerid), 1, name); \
  469. if (model_name && strcmp(model_name, name)) \
  470. _STARPU_FUT_DO_PROBE1STR(_STARPU_FUT_MODEL_NAME, (job)->job_id, model_name); \
  471. } \
  472. else { \
  473. FUT_DO_PROBE5(_STARPU_FUT_START_CODELET_BODY, (job)->job_id, ((job)->task)->sched_ctx, workerid, starpu_worker_get_memory_node(workerid), 0); \
  474. } \
  475. { \
  476. if ((job)->task->cl) \
  477. { \
  478. const int __nbuffers = STARPU_TASK_GET_NBUFFERS((job)->task); \
  479. char __buf[FXT_MAX_PARAMS*sizeof(long)]; \
  480. int __i; \
  481. for (__i = 0; __i < __nbuffers; __i++) \
  482. { \
  483. starpu_data_handle_t __handle = STARPU_TASK_GET_HANDLE((job)->task, __i); \
  484. void *__interface = _STARPU_TASK_GET_INTERFACES((job)->task)[__i]; \
  485. if (__handle->ops->describe) \
  486. { \
  487. __handle->ops->describe(__interface, __buf, sizeof(__buf)); \
  488. _STARPU_FUT_DO_PROBE1STR(_STARPU_FUT_CODELET_DATA, workerid, __buf); \
  489. } \
  490. FUT_DO_PROBE4(_STARPU_FUT_CODELET_DATA_HANDLE, (job)->job_id, (__handle), _starpu_data_get_size(__handle), STARPU_TASK_GET_MODE((job)->task, __i)); \
  491. } \
  492. } \
  493. const size_t __job_size = _starpu_job_get_data_size((job)->task->cl?(job)->task->cl->model:NULL, perf_arch, nimpl, (job)); \
  494. const uint32_t __job_hash = _starpu_compute_buffers_footprint((job)->task->cl?(job)->task->cl->model:NULL, perf_arch, nimpl, (job));\
  495. FUT_DO_PROBE7(_STARPU_FUT_CODELET_DETAILS, ((job)->task)->sched_ctx, __job_size, __job_hash, (job)->task->flops / 1000, (job)->task->tag_id, workerid, ((job)->job_id)); \
  496. } \
  497. } while(0);
  498. #define _STARPU_TRACE_END_CODELET_BODY(job, nimpl, perf_arch, workerid) \
  499. do { \
  500. const size_t job_size = _starpu_job_get_data_size((job)->task->cl?(job)->task->cl->model:NULL, perf_arch, nimpl, (job)); \
  501. const uint32_t job_hash = _starpu_compute_buffers_footprint((job)->task->cl?(job)->task->cl->model:NULL, perf_arch, nimpl, (job));\
  502. char _archname[32]=""; \
  503. starpu_perfmodel_get_arch_name(perf_arch, _archname, 32, 0); \
  504. _STARPU_FUT_DO_PROBE4STR(_STARPU_FUT_END_CODELET_BODY, (job)->job_id, (job_size), (job_hash), workerid, _archname); \
  505. } while(0);
  506. #define _STARPU_TRACE_START_EXECUTING() \
  507. FUT_DO_PROBE1(_STARPU_FUT_START_EXECUTING, _starpu_gettid());
  508. #define _STARPU_TRACE_END_EXECUTING() \
  509. FUT_DO_PROBE1(_STARPU_FUT_END_EXECUTING, _starpu_gettid());
  510. #define _STARPU_TRACE_START_CALLBACK(job) \
  511. FUT_DO_PROBE2(_STARPU_FUT_START_CALLBACK, job, _starpu_gettid());
  512. #define _STARPU_TRACE_END_CALLBACK(job) \
  513. FUT_DO_PROBE2(_STARPU_FUT_END_CALLBACK, job, _starpu_gettid());
  514. #define _STARPU_TRACE_JOB_PUSH(task, prio) \
  515. FUT_DO_PROBE3(_STARPU_FUT_JOB_PUSH, task, prio, _starpu_gettid());
  516. #define _STARPU_TRACE_JOB_POP(task, prio) \
  517. FUT_DO_PROBE3(_STARPU_FUT_JOB_POP, task, prio, _starpu_gettid());
  518. #define _STARPU_TRACE_UPDATE_TASK_CNT(counter) \
  519. FUT_DO_PROBE2(_STARPU_FUT_UPDATE_TASK_CNT, counter, _starpu_gettid())
  520. #define _STARPU_TRACE_START_FETCH_INPUT(job) \
  521. FUT_DO_PROBE2(_STARPU_FUT_START_FETCH_INPUT_ON_TID, job, _starpu_gettid());
  522. #define _STARPU_TRACE_END_FETCH_INPUT(job) \
  523. FUT_DO_PROBE2(_STARPU_FUT_END_FETCH_INPUT_ON_TID, job, _starpu_gettid());
  524. #define _STARPU_TRACE_START_PUSH_OUTPUT(job) \
  525. FUT_DO_PROBE2(_STARPU_FUT_START_PUSH_OUTPUT_ON_TID, job, _starpu_gettid());
  526. #define _STARPU_TRACE_END_PUSH_OUTPUT(job) \
  527. FUT_DO_PROBE2(_STARPU_FUT_END_PUSH_OUTPUT_ON_TID, job, _starpu_gettid());
  528. #define _STARPU_TRACE_WORKER_END_FETCH_INPUT(job, id) \
  529. FUT_DO_PROBE2(_STARPU_FUT_END_FETCH_INPUT, job, id);
  530. #define _STARPU_TRACE_WORKER_START_FETCH_INPUT(job, id) \
  531. FUT_DO_PROBE2(_STARPU_FUT_START_FETCH_INPUT, job, id);
  532. #define _STARPU_TRACE_TAG(tag, job) \
  533. FUT_DO_PROBE2(_STARPU_FUT_TAG, tag, (job)->job_id)
  534. #define _STARPU_TRACE_TAG_DEPS(tag_child, tag_father) \
  535. FUT_DO_PROBE2(_STARPU_FUT_TAG_DEPS, tag_child, tag_father)
  536. #define _STARPU_TRACE_TASK_DEPS(job_prev, job_succ) \
  537. FUT_DO_PROBE2(_STARPU_FUT_TASK_DEPS, (job_prev)->job_id, (job_succ)->job_id)
  538. #define _STARPU_TRACE_GHOST_TASK_DEPS(ghost_prev_id, job_succ_id) \
  539. FUT_DO_PROBE2(_STARPU_FUT_TASK_DEPS, (ghost_prev_id), (job_succ_id))
  540. #define _STARPU_TRACE_TASK_DONE(job) \
  541. do { \
  542. unsigned exclude_from_dag = (job)->exclude_from_dag; \
  543. const char *model_name = _starpu_job_get_task_name((job)); \
  544. if (model_name) \
  545. { \
  546. _STARPU_FUT_DO_PROBE4STR(_STARPU_FUT_TASK_DONE, (job)->job_id, _starpu_gettid(), (long unsigned)exclude_from_dag, 1, model_name);\
  547. } \
  548. else { \
  549. FUT_DO_PROBE4(_STARPU_FUT_TASK_DONE, (job)->job_id, _starpu_gettid(), (long unsigned)exclude_from_dag, 0);\
  550. } \
  551. } while(0);
  552. #define _STARPU_TRACE_TAG_DONE(tag) \
  553. do { \
  554. struct _starpu_job *job = (tag)->job; \
  555. const char *model_name = _starpu_job_get_task_name((job)); \
  556. if (model_name) \
  557. { \
  558. _STARPU_FUT_DO_PROBE3STR(_STARPU_FUT_TAG_DONE, (tag)->id, _starpu_gettid(), 1, model_name); \
  559. } \
  560. else { \
  561. FUT_DO_PROBE3(_STARPU_FUT_TAG_DONE, (tag)->id, _starpu_gettid(), 0);\
  562. } \
  563. } while(0);
  564. #define _STARPU_TRACE_DATA_NAME(handle, name) \
  565. _STARPU_FUT_DO_PROBE1STR(_STARPU_FUT_DATA_NAME, handle, name)
  566. #define _STARPU_TRACE_DATA_COORDINATES(handle, dim, v) \
  567. switch (dim) { \
  568. case 1: FUT_DO_ALWAYS_PROBE3(_STARPU_FUT_DATA_COORDINATES, handle, dim, v[0]); break; \
  569. case 2: FUT_DO_ALWAYS_PROBE4(_STARPU_FUT_DATA_COORDINATES, handle, dim, v[0], v[1]); break; \
  570. case 3: FUT_DO_ALWAYS_PROBE5(_STARPU_FUT_DATA_COORDINATES, handle, dim, v[0], v[1], v[2]); break; \
  571. case 4: FUT_DO_ALWAYS_PROBE6(_STARPU_FUT_DATA_COORDINATES, handle, dim, v[0], v[1], v[2], v[3]); break; \
  572. default: FUT_DO_ALWAYS_PROBE7(_STARPU_FUT_DATA_COORDINATES, handle, dim, v[0], v[1], v[2], v[3], v[4]); break; \
  573. }
  574. #define _STARPU_TRACE_DATA_COPY(src_node, dst_node, size) \
  575. FUT_DO_PROBE3(_STARPU_FUT_DATA_COPY, src_node, dst_node, size)
  576. #define _STARPU_TRACE_START_DRIVER_COPY(src_node, dst_node, size, com_id, prefetch, handle) \
  577. FUT_DO_PROBE6(_STARPU_FUT_START_DRIVER_COPY, src_node, dst_node, size, com_id, prefetch, handle)
  578. #define _STARPU_TRACE_END_DRIVER_COPY(src_node, dst_node, size, com_id, prefetch) \
  579. FUT_DO_PROBE5(_STARPU_FUT_END_DRIVER_COPY, src_node, dst_node, size, com_id, prefetch)
  580. #define _STARPU_TRACE_START_DRIVER_COPY_ASYNC(src_node, dst_node) \
  581. FUT_DO_PROBE2(_STARPU_FUT_START_DRIVER_COPY_ASYNC, src_node, dst_node)
  582. #define _STARPU_TRACE_END_DRIVER_COPY_ASYNC(src_node, dst_node) \
  583. FUT_DO_PROBE2(_STARPU_FUT_END_DRIVER_COPY_ASYNC, src_node, dst_node)
  584. #define _STARPU_TRACE_WORK_STEALING(empty_q, victim_q) \
  585. FUT_DO_PROBE2(_STARPU_FUT_WORK_STEALING, empty_q, victim_q)
  586. #define _STARPU_TRACE_WORKER_DEINIT_START \
  587. FUT_DO_PROBE1(_STARPU_FUT_WORKER_DEINIT_START, _starpu_gettid());
  588. #define _STARPU_TRACE_WORKER_DEINIT_END(workerkind) \
  589. FUT_DO_PROBE2(_STARPU_FUT_WORKER_DEINIT_END, workerkind, _starpu_gettid());
  590. #define _STARPU_TRACE_WORKER_SCHEDULING_START \
  591. FUT_DO_PROBE1(_STARPU_FUT_WORKER_SCHEDULING_START, _starpu_gettid());
  592. #define _STARPU_TRACE_WORKER_SCHEDULING_END \
  593. FUT_DO_PROBE1(_STARPU_FUT_WORKER_SCHEDULING_END, _starpu_gettid());
  594. #define _STARPU_TRACE_WORKER_SCHEDULING_PUSH \
  595. FUT_DO_PROBE1(_STARPU_FUT_WORKER_SCHEDULING_PUSH, _starpu_gettid());
  596. #define _STARPU_TRACE_WORKER_SCHEDULING_POP \
  597. FUT_DO_PROBE1(_STARPU_FUT_WORKER_SCHEDULING_POP, _starpu_gettid());
  598. #define _STARPU_TRACE_WORKER_SLEEP_START \
  599. FUT_DO_PROBE1(_STARPU_FUT_WORKER_SLEEP_START, _starpu_gettid());
  600. #define _STARPU_TRACE_WORKER_SLEEP_END \
  601. FUT_DO_PROBE1(_STARPU_FUT_WORKER_SLEEP_END, _starpu_gettid());
  602. #define _STARPU_TRACE_TASK_SUBMIT(job, iter, subiter) \
  603. FUT_DO_PROBE4(_STARPU_FUT_TASK_SUBMIT, (job)->job_id, iter, subiter, _starpu_gettid());
  604. #define _STARPU_TRACE_TASK_SUBMIT_START() \
  605. FUT_DO_PROBE1(_STARPU_FUT_TASK_SUBMIT_START, _starpu_gettid());
  606. #define _STARPU_TRACE_TASK_SUBMIT_END() \
  607. FUT_DO_PROBE1(_STARPU_FUT_TASK_SUBMIT_END, _starpu_gettid());
  608. #define _STARPU_TRACE_TASK_THROTTLE_START() \
  609. FUT_DO_PROBE1(_STARPU_FUT_TASK_THROTTLE_START, _starpu_gettid());
  610. #define _STARPU_TRACE_TASK_THROTTLE_END() \
  611. FUT_DO_PROBE1(_STARPU_FUT_TASK_THROTTLE_END, _starpu_gettid());
  612. #define _STARPU_TRACE_TASK_BUILD_START() \
  613. FUT_DO_PROBE1(_STARPU_FUT_TASK_BUILD_START, _starpu_gettid());
  614. #define _STARPU_TRACE_TASK_BUILD_END() \
  615. FUT_DO_PROBE1(_STARPU_FUT_TASK_BUILD_END, _starpu_gettid());
  616. #define _STARPU_TRACE_TASK_MPI_DECODE_START() \
  617. FUT_DO_PROBE1(_STARPU_FUT_TASK_MPI_DECODE_START, _starpu_gettid());
  618. #define _STARPU_TRACE_TASK_MPI_DECODE_END() \
  619. FUT_DO_PROBE1(_STARPU_FUT_TASK_MPI_DECODE_END, _starpu_gettid());
  620. #define _STARPU_TRACE_TASK_MPI_PRE_START() \
  621. FUT_DO_PROBE1(_STARPU_FUT_TASK_MPI_PRE_START, _starpu_gettid());
  622. #define _STARPU_TRACE_TASK_MPI_PRE_END() \
  623. FUT_DO_PROBE1(_STARPU_FUT_TASK_MPI_PRE_END, _starpu_gettid());
  624. #define _STARPU_TRACE_TASK_MPI_POST_START() \
  625. FUT_DO_PROBE1(_STARPU_FUT_TASK_MPI_POST_START, _starpu_gettid());
  626. #define _STARPU_TRACE_TASK_MPI_POST_END() \
  627. FUT_DO_PROBE1(_STARPU_FUT_TASK_MPI_POST_END, _starpu_gettid());
  628. #define _STARPU_TRACE_TASK_WAIT_START(job) \
  629. FUT_DO_PROBE2(_STARPU_FUT_TASK_WAIT_START, (job)->job_id, _starpu_gettid());
  630. #define _STARPU_TRACE_TASK_WAIT_END() \
  631. FUT_DO_PROBE1(_STARPU_FUT_TASK_WAIT_END, _starpu_gettid());
  632. #define _STARPU_TRACE_TASK_WAIT_FOR_ALL_START() \
  633. FUT_DO_PROBE1(_STARPU_FUT_TASK_WAIT_FOR_ALL_START, _starpu_gettid());
  634. #define _STARPU_TRACE_TASK_WAIT_FOR_ALL_END() \
  635. FUT_DO_PROBE1(_STARPU_FUT_TASK_WAIT_FOR_ALL_END, _starpu_gettid());
  636. #define _STARPU_TRACE_USER_DEFINED_START \
  637. FUT_DO_PROBE1(_STARPU_FUT_USER_DEFINED_START, _starpu_gettid());
  638. #define _STARPU_TRACE_USER_DEFINED_END \
  639. FUT_DO_PROBE1(_STARPU_FUT_USER_DEFINED_END, _starpu_gettid());
  640. #define _STARPU_TRACE_START_ALLOC(memnode, size) \
  641. FUT_DO_PROBE3(_STARPU_FUT_START_ALLOC, memnode, _starpu_gettid(), size);
  642. #define _STARPU_TRACE_END_ALLOC(memnode) \
  643. FUT_DO_PROBE2(_STARPU_FUT_END_ALLOC, memnode, _starpu_gettid());
  644. #define _STARPU_TRACE_START_ALLOC_REUSE(memnode, size) \
  645. FUT_DO_PROBE3(_STARPU_FUT_START_ALLOC_REUSE, memnode, _starpu_gettid(), size);
  646. #define _STARPU_TRACE_END_ALLOC_REUSE(memnode) \
  647. FUT_DO_PROBE2(_STARPU_FUT_END_ALLOC_REUSE, memnode, _starpu_gettid());
  648. #define _STARPU_TRACE_START_FREE(memnode, size) \
  649. FUT_DO_PROBE3(_STARPU_FUT_START_FREE, memnode, _starpu_gettid(), size);
  650. #define _STARPU_TRACE_END_FREE(memnode) \
  651. FUT_DO_PROBE2(_STARPU_FUT_END_FREE, memnode, _starpu_gettid());
  652. #define _STARPU_TRACE_START_WRITEBACK(memnode) \
  653. FUT_DO_PROBE2(_STARPU_FUT_START_WRITEBACK, memnode, _starpu_gettid());
  654. #define _STARPU_TRACE_END_WRITEBACK(memnode) \
  655. FUT_DO_PROBE2(_STARPU_FUT_END_WRITEBACK, memnode, _starpu_gettid());
  656. #define _STARPU_TRACE_USED_MEM(memnode,used) \
  657. FUT_DO_PROBE3(_STARPU_FUT_USED_MEM, memnode, used, _starpu_gettid());
  658. #define _STARPU_TRACE_START_MEMRECLAIM(memnode,is_prefetch) \
  659. FUT_DO_PROBE3(_STARPU_FUT_START_MEMRECLAIM, memnode, is_prefetch, _starpu_gettid());
  660. #define _STARPU_TRACE_END_MEMRECLAIM(memnode, is_prefetch) \
  661. FUT_DO_PROBE3(_STARPU_FUT_END_MEMRECLAIM, memnode, is_prefetch, _starpu_gettid());
  662. #define _STARPU_TRACE_START_WRITEBACK_ASYNC(memnode) \
  663. FUT_DO_PROBE2(_STARPU_FUT_START_WRITEBACK_ASYNC, memnode, _starpu_gettid());
  664. #define _STARPU_TRACE_END_WRITEBACK_ASYNC(memnode) \
  665. FUT_DO_PROBE2(_STARPU_FUT_END_WRITEBACK_ASYNC, memnode, _starpu_gettid());
  666. /* We skip these events becasue they are called so often that they cause FxT to
  667. * fail and make the overall trace unreadable anyway. */
  668. #define _STARPU_TRACE_START_PROGRESS(memnode) \
  669. FUT_DO_PROBE2(_STARPU_FUT_START_PROGRESS_ON_TID, memnode, _starpu_gettid());
  670. #define _STARPU_TRACE_END_PROGRESS(memnode) \
  671. FUT_DO_PROBE2(_STARPU_FUT_END_PROGRESS_ON_TID, memnode, _starpu_gettid());
  672. #define _STARPU_TRACE_USER_EVENT(code) \
  673. FUT_DO_PROBE2(_STARPU_FUT_USER_EVENT, code, _starpu_gettid());
  674. #define _STARPU_TRACE_SET_PROFILING(status) \
  675. FUT_DO_PROBE2(_STARPU_FUT_SET_PROFILING, status, _starpu_gettid());
  676. #define _STARPU_TRACE_TASK_WAIT_FOR_ALL \
  677. FUT_DO_PROBE0(_STARPU_FUT_TASK_WAIT_FOR_ALL)
  678. #define _STARPU_TRACE_EVENT(S) \
  679. FUT_DO_PROBESTR(_STARPU_FUT_EVENT,S)
  680. #define _STARPU_TRACE_THREAD_EVENT(S) \
  681. _STARPU_FUT_DO_PROBE1STR(_STARPU_FUT_THREAD_EVENT, _starpu_gettid(), S)
  682. #define _STARPU_TRACE_HYPERVISOR_BEGIN() \
  683. FUT_DO_PROBE1(_STARPU_FUT_HYPERVISOR_BEGIN, _starpu_gettid());
  684. #define _STARPU_TRACE_HYPERVISOR_END() \
  685. FUT_DO_PROBE1(_STARPU_FUT_HYPERVISOR_END, _starpu_gettid());
  686. #ifdef STARPU_FXT_LOCK_TRACES
  687. #define _STARPU_TRACE_LOCKING_MUTEX() do { \
  688. const char *file; \
  689. file = strrchr(__FILE__,'/') + 1; \
  690. _STARPU_FUT_DO_PROBE2STR(_STARPU_FUT_LOCKING_MUTEX,__LINE__,_starpu_gettid(),file); \
  691. } while (0)
  692. #define _STARPU_TRACE_MUTEX_LOCKED() do { \
  693. const char *file; \
  694. file = strrchr(__FILE__,'/') + 1; \
  695. _STARPU_FUT_DO_PROBE2STR(_STARPU_FUT_MUTEX_LOCKED,__LINE__,_starpu_gettid(),file); \
  696. } while(0)
  697. #define _STARPU_TRACE_UNLOCKING_MUTEX() do { \
  698. const char *file; \
  699. file = strrchr(__FILE__,'/') + 1; \
  700. _STARPU_FUT_DO_PROBE2STR(_STARPU_FUT_UNLOCKING_MUTEX,__LINE__,_starpu_gettid(),file); \
  701. } while(0)
  702. #define _STARPU_TRACE_MUTEX_UNLOCKED() do {\
  703. const char *file; \
  704. file = strrchr(__FILE__,'/') + 1; \
  705. _STARPU_FUT_DO_PROBE2STR(_STARPU_FUT_MUTEX_UNLOCKED,__LINE__,_starpu_gettid(),file); \
  706. } while(0)
  707. #define _STARPU_TRACE_TRYLOCK_MUTEX() do { \
  708. const char *file; \
  709. file = strrchr(__FILE__,'/') + 1; \
  710. _STARPU_FUT_DO_PROBE2STR(_STARPU_FUT_TRYLOCK_MUTEX,__LINE__,_starpu_gettid(),file); \
  711. } while(0)
  712. #define _STARPU_TRACE_RDLOCKING_RWLOCK() do { \
  713. const char *file; \
  714. file = strrchr(__FILE__,'/') + 1; \
  715. _STARPU_FUT_DO_PROBE2STR(_STARPU_FUT_RDLOCKING_RWLOCK,__LINE__,_starpu_gettid(),file); \
  716. } while(0)
  717. #define _STARPU_TRACE_RWLOCK_RDLOCKED() do { \
  718. const char *file; \
  719. file = strrchr(__FILE__,'/') + 1; \
  720. _STARPU_FUT_DO_PROBE2STR(_STARPU_FUT_RWLOCK_RDLOCKED,__LINE__,_starpu_gettid(),file); \
  721. } while(0)
  722. #define _STARPU_TRACE_WRLOCKING_RWLOCK() do { \
  723. const char *file; \
  724. file = strrchr(__FILE__,'/') + 1; \
  725. _STARPU_FUT_DO_PROBE2STR(_STARPU_FUT_WRLOCKING_RWLOCK,__LINE__,_starpu_gettid(),file); \
  726. } while(0)
  727. #define _STARPU_TRACE_RWLOCK_WRLOCKED() do { \
  728. const char *file; \
  729. file = strrchr(__FILE__,'/') + 1; \
  730. _STARPU_FUT_DO_PROBE2STR(_STARPU_FUT_RWLOCK_WRLOCKED,__LINE__,_starpu_gettid(),file); \
  731. } while(0)
  732. #define _STARPU_TRACE_UNLOCKING_RWLOCK() do { \
  733. const char *file; \
  734. file = strrchr(__FILE__,'/') + 1; \
  735. _STARPU_FUT_DO_PROBE2STR(_STARPU_FUT_UNLOCKING_RWLOCK,__LINE__,_starpu_gettid(),file); \
  736. } while(0)
  737. #define _STARPU_TRACE_RWLOCK_UNLOCKED() do { \
  738. const char *file; \
  739. file = strrchr(__FILE__,'/') + 1; \
  740. _STARPU_FUT_DO_PROBE2STR(_STARPU_FUT_RWLOCK_UNLOCKED,__LINE__,_starpu_gettid(),file); \
  741. } while(0)
  742. #define STARPU_TRACE_SPINLOCK_CONDITITION (starpu_worker_get_type(starpu_worker_get_id()) == STARPU_CUDA_WORKER)
  743. #define _STARPU_TRACE_LOCKING_SPINLOCK(file, line) do {\
  744. if (STARPU_TRACE_SPINLOCK_CONDITITION) { \
  745. const char *xfile; \
  746. xfile = strrchr(file,'/') + 1; \
  747. _STARPU_FUT_DO_PROBE2STR(_STARPU_FUT_LOCKING_SPINLOCK,line,_starpu_gettid(),xfile); \
  748. } \
  749. } while(0)
  750. #define _STARPU_TRACE_SPINLOCK_LOCKED(file, line) do { \
  751. if (STARPU_TRACE_SPINLOCK_CONDITITION) { \
  752. const char *xfile; \
  753. xfile = strrchr(file,'/') + 1; \
  754. _STARPU_FUT_DO_PROBE2STR(_STARPU_FUT_SPINLOCK_LOCKED,line,_starpu_gettid(),xfile); \
  755. } \
  756. } while(0)
  757. #define _STARPU_TRACE_UNLOCKING_SPINLOCK(file, line) do { \
  758. if (STARPU_TRACE_SPINLOCK_CONDITITION) { \
  759. const char *xfile; \
  760. xfile = strrchr(file,'/') + 1; \
  761. _STARPU_FUT_DO_PROBE2STR(_STARPU_FUT_UNLOCKING_SPINLOCK,line,_starpu_gettid(),xfile); \
  762. } \
  763. } while(0)
  764. #define _STARPU_TRACE_SPINLOCK_UNLOCKED(file, line) do { \
  765. if (STARPU_TRACE_SPINLOCK_CONDITITION) { \
  766. const char *xfile; \
  767. xfile = strrchr(file,'/') + 1; \
  768. _STARPU_FUT_DO_PROBE2STR(_STARPU_FUT_SPINLOCK_UNLOCKED,line,_starpu_gettid(),xfile); \
  769. } \
  770. } while(0)
  771. #define _STARPU_TRACE_TRYLOCK_SPINLOCK(file, line) do { \
  772. if (STARPU_TRACE_SPINLOCK_CONDITITION) { \
  773. const char *xfile; \
  774. xfile = strrchr(file,'/') + 1; \
  775. _STARPU_FUT_DO_PROBE2STR(_STARPU_FUT_TRYLOCK_SPINLOCK,line,_starpu_gettid(),xfile); \
  776. } \
  777. } while(0)
  778. #define _STARPU_TRACE_COND_WAIT_BEGIN() do { \
  779. const char *file; \
  780. file = strrchr(__FILE__,'/') + 1; \
  781. _STARPU_FUT_DO_PROBE2STR(_STARPU_FUT_COND_WAIT_BEGIN,__LINE__,_starpu_gettid(),file); \
  782. } while(0)
  783. #define _STARPU_TRACE_COND_WAIT_END() do { \
  784. const char *file; \
  785. file = strrchr(__FILE__,'/') + 1; \
  786. _STARPU_FUT_DO_PROBE2STR(_STARPU_FUT_COND_WAIT_END,__LINE__,_starpu_gettid(),file); \
  787. } while(0)
  788. #define _STARPU_TRACE_BARRIER_WAIT_BEGIN() do { \
  789. const char *file; \
  790. file = strrchr(__FILE__,'/') + 1; \
  791. _STARPU_FUT_DO_PROBE2STR(_STARPU_FUT_BARRIER_WAIT_BEGIN,__LINE__,_starpu_gettid(),file); \
  792. } while(0)
  793. #define _STARPU_TRACE_BARRIER_WAIT_END() do { \
  794. const char *file; \
  795. file = strrchr(__FILE__,'/') + 1; \
  796. _STARPU_FUT_DO_PROBE2STR(_STARPU_FUT_BARRIER_WAIT_END,__LINE__,_starpu_gettid(),file); \
  797. } while(0)
  798. #else // !STARPU_FXT_LOCK_TRACES
  799. #define _STARPU_TRACE_LOCKING_MUTEX() do {} while(0)
  800. #define _STARPU_TRACE_MUTEX_LOCKED() do {} while(0)
  801. #define _STARPU_TRACE_UNLOCKING_MUTEX() do {} while(0)
  802. #define _STARPU_TRACE_MUTEX_UNLOCKED() do {} while(0)
  803. #define _STARPU_TRACE_TRYLOCK_MUTEX() do {} while(0)
  804. #define _STARPU_TRACE_RDLOCKING_RWLOCK() do {} while(0)
  805. #define _STARPU_TRACE_RWLOCK_RDLOCKED() do {} while(0)
  806. #define _STARPU_TRACE_WRLOCKING_RWLOCK() do {} while(0)
  807. #define _STARPU_TRACE_RWLOCK_WRLOCKED() do {} while(0)
  808. #define _STARPU_TRACE_UNLOCKING_RWLOCK() do {} while(0)
  809. #define _STARPU_TRACE_RWLOCK_UNLOCKED() do {} while(0)
  810. #define _STARPU_TRACE_LOCKING_SPINLOCK(file, line) do {(void) file; (void)line;} while(0)
  811. #define _STARPU_TRACE_SPINLOCK_LOCKED(file, line) do {(void) file; (void)line;} while(0)
  812. #define _STARPU_TRACE_UNLOCKING_SPINLOCK(file, line) do {(void) file; (void)line;} while(0)
  813. #define _STARPU_TRACE_SPINLOCK_UNLOCKED(file, line) do {(void) file; (void)line;} while(0)
  814. #define _STARPU_TRACE_TRYLOCK_SPINLOCK(file, line) do {(void) file; (void)line;} while(0)
  815. #define _STARPU_TRACE_COND_WAIT_BEGIN() do {} while(0)
  816. #define _STARPU_TRACE_COND_WAIT_END() do {} while(0)
  817. #define _STARPU_TRACE_BARRIER_WAIT_BEGIN() do {} while(0)
  818. #define _STARPU_TRACE_BARRIER_WAIT_END() do {} while(0)
  819. #endif // STARPU_FXT_LOCK_TRACES
  820. #define _STARPU_TRACE_MEMORY_FULL(size) \
  821. FUT_DO_PROBE2(_STARPU_FUT_MEMORY_FULL,size,_starpu_gettid());
  822. #define _STARPU_TRACE_DATA_LOAD(workerid,size) \
  823. FUT_DO_PROBE2(_STARPU_FUT_DATA_LOAD, workerid, size);
  824. #define _STARPU_TRACE_START_UNPARTITION(handle, memnode) \
  825. FUT_DO_PROBE3(_STARPU_FUT_START_UNPARTITION_ON_TID, memnode, _starpu_gettid(), handle);
  826. #define _STARPU_TRACE_END_UNPARTITION(handle, memnode) \
  827. FUT_DO_PROBE3(_STARPU_FUT_END_UNPARTITION_ON_TID, memnode, _starpu_gettid(), handle);
  828. #define _STARPU_TRACE_SCHED_COMPONENT_PUSH_PRIO(workerid, ntasks, exp_len) \
  829. FUT_DO_PROBE4(_STARPU_FUT_SCHED_COMPONENT_PUSH_PRIO, _starpu_gettid(), workerid, ntasks, exp_len);
  830. #define _STARPU_TRACE_SCHED_COMPONENT_POP_PRIO(workerid, ntasks, exp_len) \
  831. FUT_DO_PROBE4(_STARPU_FUT_SCHED_COMPONENT_POP_PRIO, _starpu_gettid(), workerid, ntasks, exp_len);
  832. #define _STARPU_TRACE_SCHED_COMPONENT_NEW(component) \
  833. _STARPU_FUT_DO_PROBE1STR(_STARPU_FUT_SCHED_COMPONENT_NEW, component, (component)->name);
  834. #define _STARPU_TRACE_SCHED_COMPONENT_CONNECT(parent, child) \
  835. FUT_DO_PROBE2(_STARPU_FUT_SCHED_COMPONENT_CONNECT, parent, child);
  836. #define _STARPU_TRACE_SCHED_COMPONENT_PUSH(from, to, task) \
  837. FUT_DO_PROBE5(_STARPU_FUT_SCHED_COMPONENT_PUSH, _starpu_gettid(), from, to, task, (task)->priority);
  838. #define _STARPU_TRACE_SCHED_COMPONENT_PULL(from, to, task) \
  839. FUT_DO_PROBE5(_STARPU_FUT_SCHED_COMPONENT_PULL, _starpu_gettid(), from, to, task, (task)->priority);
  840. #define _STARPU_TRACE_HANDLE_DATA_REGISTER(handle) \
  841. FUT_DO_PROBE1(_STARPU_FUT_HANDLE_DATA_REGISTER, handle)
  842. #if 0
  843. #define _STARPU_TRACE_DATA_INVALIDATE(handle, node) \
  844. FUT_DO_PROBE2(_STARPU_FUT_DATA_INVALIDATE, handle, node)
  845. #else
  846. #define _STARPU_TRACE_DATA_INVALIDATE(handle, node) do {(void) handle; (void) node;} while (0)
  847. #endif
  848. #else // !STARPU_USE_FXT
  849. /* Dummy macros in case FxT is disabled */
  850. #define _STARPU_TRACE_NEW_MEM_NODE(nodeid) do {(void)(nodeid);} while(0)
  851. #define _STARPU_TRACE_WORKER_INIT_START(a,b,c,d,e,f) do {(void)(a); (void)(b); (void)(c); (void)(d); (void)(e); (void)(f);} while(0)
  852. #define _STARPU_TRACE_WORKER_INIT_END(workerid) do {(void)(workerid);} while(0)
  853. #define _STARPU_TRACE_START_CODELET_BODY(job, nimpl, perf_arch, workerid) do {(void)(job); (void)(nimpl); (void)(perf_arch); (void)(workerid);} while(0)
  854. #define _STARPU_TRACE_END_CODELET_BODY(job, nimpl, perf_arch, workerid) do {(void)(job); (void)(nimpl); (void)(perf_arch); (void)(workerid);} while(0)
  855. #define _STARPU_TRACE_START_EXECUTING() do {} while(0)
  856. #define _STARPU_TRACE_END_EXECUTING() do {} while(0)
  857. #define _STARPU_TRACE_START_CALLBACK(job) do {(void)(job);} while(0)
  858. #define _STARPU_TRACE_END_CALLBACK(job) do {(void)(job);} while(0)
  859. #define _STARPU_TRACE_JOB_PUSH(task, prio) do {(void)(task); (void)(prio);} while(0)
  860. #define _STARPU_TRACE_JOB_POP(task, prio) do {(void)(task); (void)(prio);} while(0)
  861. #define _STARPU_TRACE_UPDATE_TASK_CNT(counter) do {(void)(counter);} while(0)
  862. #define _STARPU_TRACE_START_FETCH_INPUT(job) do {(void)(job);} while(0)
  863. #define _STARPU_TRACE_END_FETCH_INPUT(job) do {(void)(job);} while(0)
  864. #define _STARPU_TRACE_START_PUSH_OUTPUT(job) do {(void)(job);} while(0)
  865. #define _STARPU_TRACE_END_PUSH_OUTPUT(job) do {(void)(job);} while(0)
  866. #define _STARPU_TRACE_TAG(tag, job) do {(void)(tag); (void)(job);} while(0)
  867. #define _STARPU_TRACE_TAG_DEPS(a, b) do {(void)(a); (void)(b);} while(0)
  868. #define _STARPU_TRACE_TASK_DEPS(a, b) do {(void)(a); (void)(b);} while(0)
  869. #define _STARPU_TRACE_GHOST_TASK_DEPS(a, b) do {(void)(a); (void)(b);} while(0)
  870. #define _STARPU_TRACE_TASK_DONE(a) do {(void)(a);} while(0)
  871. #define _STARPU_TRACE_TAG_DONE(a) do {(void)(a);} while(0)
  872. #define _STARPU_TRACE_DATA_NAME(a, b) do {(void)(a); (void)(b);} while(0)
  873. #define _STARPU_TRACE_DATA_COORDINATES(a, b, c) do {(void)(a); (void)(b); (void)(c);} while(0)
  874. #define _STARPU_TRACE_DATA_COPY(a, b, c) do {(void)(a); (void)(b); (void)(c);} while(0)
  875. #define _STARPU_TRACE_START_DRIVER_COPY(a,b,c,d,e,f) do {(void)(a); (void)(b); (void)(c); (void)(d); (void)(e); (void)(f);} while(0)
  876. #define _STARPU_TRACE_END_DRIVER_COPY(a,b,c,d,e) do {(void)(a); (void)(b); (void)(c); (void)(d); (void)(e);} while(0)
  877. #define _STARPU_TRACE_START_DRIVER_COPY_ASYNC(a,b) do {(void)(a); (void)(b);} while(0)
  878. #define _STARPU_TRACE_END_DRIVER_COPY_ASYNC(a,b) do {(void)(a); (void)(b);} while(0)
  879. #define _STARPU_TRACE_WORK_STEALING(a, b) do {(void)(a); (void)(b);} while(0)
  880. #define _STARPU_TRACE_WORKER_DEINIT_START do {} while(0)
  881. #define _STARPU_TRACE_WORKER_DEINIT_END(a) do {(void)(a);} while(0)
  882. #define _STARPU_TRACE_WORKER_SCHEDULING_START do {} while(0)
  883. #define _STARPU_TRACE_WORKER_SCHEDULING_END do {} while(0)
  884. #define _STARPU_TRACE_WORKER_SCHEDULING_PUSH do {} while(0)
  885. #define _STARPU_TRACE_WORKER_SCHEDULING_POP do {} while(0)
  886. #define _STARPU_TRACE_WORKER_SLEEP_START do {} while(0)
  887. #define _STARPU_TRACE_WORKER_SLEEP_END do {} while(0)
  888. #define _STARPU_TRACE_TASK_SUBMIT(job, a, b) do {(void)(job); (void)(a);(void)(b);} while(0)
  889. #define _STARPU_TRACE_TASK_SUBMIT_START() do {} while(0)
  890. #define _STARPU_TRACE_TASK_SUBMIT_END() do {} while(0)
  891. #define _STARPU_TRACE_TASK_THROTTLE_START() do {} while(0)
  892. #define _STARPU_TRACE_TASK_THROTTLE_END() do {} while(0)
  893. #define _STARPU_TRACE_TASK_BUILD_START() do {} while(0)
  894. #define _STARPU_TRACE_TASK_BUILD_END() do {} while(0)
  895. #define _STARPU_TRACE_TASK_MPI_DECODE_START() do {} while(0)
  896. #define _STARPU_TRACE_TASK_MPI_DECODE_END() do {} while(0)
  897. #define _STARPU_TRACE_TASK_MPI_PRE_START() do {} while(0)
  898. #define _STARPU_TRACE_TASK_MPI_PRE_END() do {} while(0)
  899. #define _STARPU_TRACE_TASK_MPI_POST_START() do {} while(0)
  900. #define _STARPU_TRACE_TASK_MPI_POST_END() do {} while(0)
  901. #define _STARPU_TRACE_TASK_WAIT_START(job) do {(void)(job);} while(0)
  902. #define _STARPU_TRACE_TASK_WAIT_END() do {} while(0)
  903. #define _STARPU_TRACE_TASK_WAIT_FOR_ALL_START() do {} while(0)
  904. #define _STARPU_TRACE_TASK_WAIT_FOR_ALL_END() do {} while(0)
  905. #define _STARPU_TRACE_USER_DEFINED_START() do {} while(0)
  906. #define _STARPU_TRACE_USER_DEFINED_END() do {} while(0)
  907. #define _STARPU_TRACE_START_ALLOC(memnode, size) do {(void)(memnode); (void)(size);} while(0)
  908. #define _STARPU_TRACE_END_ALLOC(memnode) do {(void)(memnode);} while(0)
  909. #define _STARPU_TRACE_START_ALLOC_REUSE(a, size) do {(void)(a); (void)(size);} while(0)
  910. #define _STARPU_TRACE_END_ALLOC_REUSE(a) do {(void)(a);} while(0)
  911. #define _STARPU_TRACE_START_FREE(memnode, size) do {(void)(memnode); (void)(size);} while(0)
  912. #define _STARPU_TRACE_END_FREE(memnode) do {(void)(memnode);} while(0)
  913. #define _STARPU_TRACE_START_WRITEBACK(memnode) do {(void)(memnode);} while(0)
  914. #define _STARPU_TRACE_END_WRITEBACK(memnode) do {(void)(memnode);} while(0)
  915. #define _STARPU_TRACE_USED_MEM(memnode,used) do {(void)(memnode); (void)(used);} while (0)
  916. #define _STARPU_TRACE_START_MEMRECLAIM(memnode,is_prefetch) do {(void)(memnode); (void)(is_prefetch);} while(0)
  917. #define _STARPU_TRACE_END_MEMRECLAIM(memnode,is_prefetch) do {(void)(memnode); (void)(is_prefetch);} while(0)
  918. #define _STARPU_TRACE_START_WRITEBACK_ASYNC(memnode) do {(void)(memnode);} while(0)
  919. #define _STARPU_TRACE_END_WRITEBACK_ASYNC(memnode) do {(void)(memnode);} while(0)
  920. #define _STARPU_TRACE_START_PROGRESS(memnode) do {(void)( memnode);} while(0)
  921. #define _STARPU_TRACE_END_PROGRESS(memnode) do {(void)( memnode);} while(0)
  922. #define _STARPU_TRACE_USER_EVENT(code) do {(void)(code);} while(0)
  923. #define _STARPU_TRACE_SET_PROFILING(status) do {(void)(status);} while(0)
  924. #define _STARPU_TRACE_TASK_WAIT_FOR_ALL() do {} while(0)
  925. #define _STARPU_TRACE_EVENT(S) do {(void)(S);} while(0)
  926. #define _STARPU_TRACE_THREAD_EVENT(S) do {(void)(S);} while(0)
  927. #define _STARPU_TRACE_LOCKING_MUTEX() do {} while(0)
  928. #define _STARPU_TRACE_MUTEX_LOCKED() do {} while(0)
  929. #define _STARPU_TRACE_UNLOCKING_MUTEX() do {} while(0)
  930. #define _STARPU_TRACE_MUTEX_UNLOCKED() do {} while(0)
  931. #define _STARPU_TRACE_TRYLOCK_MUTEX() do {} while(0)
  932. #define _STARPU_TRACE_RDLOCKING_RWLOCK() do {} while(0)
  933. #define _STARPU_TRACE_RWLOCK_RDLOCKED() do {} while(0)
  934. #define _STARPU_TRACE_WRLOCKING_RWLOCK() do {} while(0)
  935. #define _STARPU_TRACE_RWLOCK_WRLOCKED() do {} while(0)
  936. #define _STARPU_TRACE_UNLOCKING_RWLOCK() do {} while(0)
  937. #define _STARPU_TRACE_RWLOCK_UNLOCKED() do {} while(0)
  938. #define _STARPU_TRACE_LOCKING_SPINLOCK(file, line) do {(void)(file); (void)(line);} while(0)
  939. #define _STARPU_TRACE_SPINLOCK_LOCKED(file, line) do {(void)(file); (void)(line);} while(0)
  940. #define _STARPU_TRACE_UNLOCKING_SPINLOCK(file, line) do {(void)(file); (void)(line);} while(0)
  941. #define _STARPU_TRACE_SPINLOCK_UNLOCKED(file, line) do {(void)(file); (void)(line);} while(0)
  942. #define _STARPU_TRACE_TRYLOCK_SPINLOCK(file, line) do {(void)(file); (void)(line);} while(0)
  943. #define _STARPU_TRACE_COND_WAIT_BEGIN() do {} while(0)
  944. #define _STARPU_TRACE_COND_WAIT_END() do {} while(0)
  945. #define _STARPU_TRACE_BARRIER_WAIT_BEGIN() do {} while(0)
  946. #define _STARPU_TRACE_BARRIER_WAIT_END() do {} while(0)
  947. #define _STARPU_TRACE_MEMORY_FULL(size) do {(void)(size);} while(0)
  948. #define _STARPU_TRACE_DATA_LOAD(workerid,size) do {(void)(workerid); (void)(size);} while(0)
  949. #define _STARPU_TRACE_START_UNPARTITION(handle, memnode) do {(void)(handle); (void)(memnode);} while(0)
  950. #define _STARPU_TRACE_END_UNPARTITION(handle, memnode) do {(void)(handle); (void)(memnode);} while(0)
  951. #define _STARPU_TRACE_SCHED_COMPONENT_PUSH_PRIO(workerid, ntasks, exp_len) do {(void)(workerid); (void)(ntasks); (void)(exp_len);} while(0)
  952. #define _STARPU_TRACE_SCHED_COMPONENT_POP_PRIO(workerid, ntasks, exp_len) do {(void)(workerid); (void)(ntasks); (void)(exp_len);} while(0)
  953. #define _STARPU_TRACE_HYPERVISOR_BEGIN() do {} while(0)
  954. #define _STARPU_TRACE_HYPERVISOR_END() do {} while(0)
  955. #define _STARPU_TRACE_SCHED_COMPONENT_NEW(component) do {(void)(component);} while (0)
  956. #define _STARPU_TRACE_SCHED_COMPONENT_CONNECT(parent, child) do {(void)(parent); (void)(child);} while (0)
  957. #define _STARPU_TRACE_SCHED_COMPONENT_PUSH(from, to, task) do {(void)(from); (void)(to); (void)(task);} while (0)
  958. #define _STARPU_TRACE_SCHED_COMPONENT_PULL(from, to, task) do {(void)(from); (void)(to); (void)(task);} while (0)
  959. #define _STARPU_TRACE_HANDLE_DATA_REGISTER(handle) do {(void)(handle);} while (0)
  960. #define _STARPU_TRACE_DATA_INVALIDATE(handle, node) do {(void)(handle); (void)(node);} while (0)
  961. #define _STARPU_TRACE_WORKER_START_FETCH_INPUT(job, id) do {(void)(job); (void)(id);} while(0)
  962. #define _STARPU_TRACE_WORKER_END_FETCH_INPUT(job, id) do {(void)(job); (void)(id);} while(0)
  963. #endif // STARPU_USE_FXT
  964. #endif // __FXT_H__