fxt.h 53 KB

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