fxt.h 51 KB

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