|
@@ -330,11 +330,12 @@ void _starpu_fxt_dump_file(void);
|
|
|
#define _STARPU_FUT_COMMIT(size) do { } while (0)
|
|
|
#endif
|
|
|
|
|
|
-#ifdef FUT_ALWAYS_PROBE1STR
|
|
|
+#ifdef FUT_RAW_ALWAYS_PROBE1STR
|
|
|
#define _STARPU_FUT_ALWAYS_PROBE1STR(CODE, P1, str) FUT_RAW_ALWAYS_PROBE1STR(CODE, P1, str)
|
|
|
#else
|
|
|
#define _STARPU_FUT_ALWAYS_PROBE1STR(CODE, P1, str) \
|
|
|
do { \
|
|
|
+ if( STARPU_UNLIKELY(fut_active) ) { \
|
|
|
/* No more than FXT_MAX_PARAMS args are allowed */ \
|
|
|
/* we add a \0 just in case ... */ \
|
|
|
size_t len = STARPU_MIN(strlen(str)+1, (FXT_MAX_PARAMS - 1)*sizeof(unsigned long));\
|
|
@@ -347,7 +348,7 @@ do { \
|
|
|
snprintf((char *)futargs, len, "%s", str); \
|
|
|
((char *)futargs)[len - 1] = '\0'; \
|
|
|
_STARPU_FUT_COMMIT(total_len); \
|
|
|
-} while (0)
|
|
|
+ }} while (0)
|
|
|
#endif
|
|
|
|
|
|
#ifdef FUT_FULL_PROBE1STR
|
|
@@ -358,7 +359,7 @@ do { \
|
|
|
* by a string. */
|
|
|
#define _STARPU_FUT_FULL_PROBE1STR(KEYMASK, CODE, P1, str) \
|
|
|
do { \
|
|
|
- if(KEYMASK & fut_active) { \
|
|
|
+ if (STARPU_UNLIKELY(KEYMASK & fut_active)) { \
|
|
|
_STARPU_FUT_ALWAYS_PROBE1STR(CODE, P1, str); \
|
|
|
} \
|
|
|
} while (0)
|
|
@@ -390,7 +391,7 @@ do { \
|
|
|
#else
|
|
|
#define _STARPU_FUT_FULL_PROBE2STR(KEYMASK, CODE, P1, P2, str) \
|
|
|
do { \
|
|
|
- if(KEYMASK & fut_active) { \
|
|
|
+ if (STARPU_UNLIKELY(KEYMASK & fut_active)) { \
|
|
|
_STARPU_FUT_ALWAYS_PROBE2STR(CODE, P1, P2, str); \
|
|
|
} \
|
|
|
} while (0)
|
|
@@ -423,7 +424,7 @@ do { \
|
|
|
#else
|
|
|
#define _STARPU_FUT_FULL_PROBE3STR(KEYMASK, CODE, P1, P2, P3, str) \
|
|
|
do { \
|
|
|
- if(KEYMASK & fut_active) { \
|
|
|
+ if (STARPU_UNLIKELY(KEYMASK & fut_active)) { \
|
|
|
_STARPU_FUT_ALWAYS_PROBE3STR(CODE, P1, P2, P3, str); \
|
|
|
} \
|
|
|
} while (0)
|
|
@@ -457,7 +458,7 @@ do { \
|
|
|
#else
|
|
|
#define _STARPU_FUT_FULL_PROBE4STR(KEYMASK, CODE, P1, P2, P3, P4, str) \
|
|
|
do { \
|
|
|
- if(KEYMASK & fut_active) { \
|
|
|
+ if (STARPU_UNLIKELY(KEYMASK & fut_active)) { \
|
|
|
_STARPU_FUT_ALWAYS_PROBE4STR(CODE, P1, P2, P3, P4, str); \
|
|
|
} \
|
|
|
} while (0)
|
|
@@ -492,7 +493,7 @@ do { \
|
|
|
#else
|
|
|
#define _STARPU_FUT_FULL_PROBE5STR(KEYMASK, CODE, P1, P2, P3, P4, P5, str) \
|
|
|
do { \
|
|
|
- if(KEYMASK & fut_active) { \
|
|
|
+ if (STARPU_UNLIKELY(KEYMASK & fut_active)) { \
|
|
|
_STARPU_FUT_ALWAYS_PROBE5STR(CODE, P1, P2, P3, P4, P5, str); \
|
|
|
} \
|
|
|
} while (0)
|
|
@@ -528,7 +529,7 @@ do { \
|
|
|
#else
|
|
|
#define _STARPU_FUT_FULL_PROBE6STR(KEYMASK, CODE, P1, P2, P3, P4, P5, P6, str) \
|
|
|
do { \
|
|
|
- if(KEYMASK & fut_active) { \
|
|
|
+ if (STARPU_UNLIKELY(KEYMASK & fut_active)) { \
|
|
|
_STARPU_FUT_ALWAYS_PROBE6STR(CODE, P1, P2, P3, P4, P5, P6, str); \
|
|
|
} \
|
|
|
} while (0)
|
|
@@ -565,7 +566,7 @@ do { \
|
|
|
#else
|
|
|
#define _STARPU_FUT_FULL_PROBE7STR(KEYMASK, CODE, P1, P2, P3, P4, P5, P6, P7, str) \
|
|
|
do { \
|
|
|
- if(KEYMASK & fut_active) { \
|
|
|
+ if (STARPU_UNLIKELY(KEYMASK & fut_active)) { \
|
|
|
_STARPU_FUT_ALWAYS_PROBE7STR(CODE, P1, P2, P3, P4, P5, P6, P7, str); \
|
|
|
} \
|
|
|
} while (0)
|
|
@@ -573,7 +574,7 @@ do { \
|
|
|
|
|
|
#ifndef FUT_RAW_PROBE7
|
|
|
#define FUT_RAW_PROBE7(CODE,P1,P2,P3,P4,P5,P6,P7) do { \
|
|
|
- if(fut_active) { \
|
|
|
+ if(STARPU_UNLIKELY(fut_active)) { \
|
|
|
unsigned long *__args __attribute__((unused))= \
|
|
|
fut_getstampedbuffer(CODE, \
|
|
|
FUT_SIZE(7)); \
|
|
@@ -677,7 +678,7 @@ do { \
|
|
|
/* full probes */
|
|
|
#ifndef FUT_FULL_PROBE0
|
|
|
#define FUT_FULL_PROBE0(KEYMASK,CODE) do { \
|
|
|
- if( KEYMASK & fut_active ) { \
|
|
|
+ if (STARPU_UNLIKELY(KEYMASK & fut_active)) { \
|
|
|
FUT_RAW_ALWAYS_PROBE0(FUT_CODE(CODE, 0)); \
|
|
|
} \
|
|
|
} while(0)
|
|
@@ -685,7 +686,7 @@ do { \
|
|
|
|
|
|
#ifndef FUT_FULL_PROBE1
|
|
|
#define FUT_FULL_PROBE1(KEYMASK,CODE,P1) do { \
|
|
|
- if( KEYMASK & fut_active ) { \
|
|
|
+ if (STARPU_UNLIKELY(KEYMASK & fut_active)) { \
|
|
|
FUT_RAW_ALWAYS_PROBE1(FUT_CODE(CODE, 1),P1); \
|
|
|
} \
|
|
|
} while(0)
|
|
@@ -693,7 +694,7 @@ do { \
|
|
|
|
|
|
#ifndef FUT_FULL_PROBE2
|
|
|
#define FUT_FULL_PROBE2(KEYMASK,CODE,P1,P2) do { \
|
|
|
- if( KEYMASK & fut_active ) { \
|
|
|
+ if (STARPU_UNLIKELY(KEYMASK & fut_active)) { \
|
|
|
FUT_RAW_ALWAYS_PROBE2(FUT_CODE(CODE, 2),P1,P2); \
|
|
|
} \
|
|
|
} while(0)
|
|
@@ -701,7 +702,7 @@ do { \
|
|
|
|
|
|
#ifndef FUT_FULL_PROBE3
|
|
|
#define FUT_FULL_PROBE3(KEYMASK,CODE,P1,P2,P3) do { \
|
|
|
- if( KEYMASK & fut_active ) { \
|
|
|
+ if (STARPU_UNLIKELY(KEYMASK & fut_active)) { \
|
|
|
FUT_RAW_ALWAYS_PROBE3(FUT_CODE(CODE, 3),P1,P2,P3); \
|
|
|
} \
|
|
|
} while(0)
|
|
@@ -709,7 +710,7 @@ do { \
|
|
|
|
|
|
#ifndef FUT_FULL_PROBE4
|
|
|
#define FUT_FULL_PROBE4(KEYMASK,CODE,P1,P2,P3,P4) do { \
|
|
|
- if( KEYMASK & fut_active ) { \
|
|
|
+ if (STARPU_UNLIKELY(KEYMASK & fut_active)) { \
|
|
|
FUT_RAW_ALWAYS_PROBE4(FUT_CODE(CODE, 4),P1,P2,P3,P4); \
|
|
|
} \
|
|
|
} while(0)
|
|
@@ -717,7 +718,7 @@ do { \
|
|
|
|
|
|
#ifndef FUT_FULL_PROBE5
|
|
|
#define FUT_FULL_PROBE5(KEYMASK,CODE,P1,P2,P3,P4,P5) do { \
|
|
|
- if( KEYMASK & fut_active ) { \
|
|
|
+ if (STARPU_UNLIKELY(KEYMASK & fut_active)) { \
|
|
|
FUT_RAW_ALWAYS_PROBE5(FUT_CODE(CODE, 5),P1,P2,P3,P4,P5); \
|
|
|
} \
|
|
|
} while(0)
|
|
@@ -725,7 +726,7 @@ do { \
|
|
|
|
|
|
#ifndef FUT_FULL_PROBE6
|
|
|
#define FUT_FULL_PROBE6(KEYMASK,CODE,P1,P2,P3,P4,P5,P6) do { \
|
|
|
- if( KEYMASK & fut_active ) { \
|
|
|
+ if (STARPU_UNLIKELY(KEYMASK & fut_active)) { \
|
|
|
FUT_RAW_ALWAYS_PROBE6(FUT_CODE(CODE, 6),P1,P2,P3,P4,P5,P6); \
|
|
|
} \
|
|
|
} while(0)
|
|
@@ -733,7 +734,7 @@ do { \
|
|
|
|
|
|
#ifndef FUT_FULL_PROBE7
|
|
|
#define FUT_FULL_PROBE7(KEYMASK,CODE,P1,P2,P3,P4,P5,P6,P7) do { \
|
|
|
- if( KEYMASK & fut_active ) { \
|
|
|
+ if (STARPU_UNLIKELY(KEYMASK & fut_active)) { \
|
|
|
FUT_RAW_ALWAYS_PROBE7(FUT_CODE(CODE, 7),P1,P2,P3,P4,P5,P6,P7); \
|
|
|
} \
|
|
|
} while(0)
|
|
@@ -769,6 +770,7 @@ do { \
|
|
|
|
|
|
#define _STARPU_TRACE_START_CODELET_BODY(job, nimpl, perf_arch, workerid) \
|
|
|
do { \
|
|
|
+ if( STARPU_UNLIKELY((_STARPU_FUT_KEYMASK_TASK|_STARPU_FUT_KEYMASK_TASK_VERBOSE|_STARPU_FUT_KEYMASK_DATA) & fut_active) ) { \
|
|
|
FUT_FULL_PROBE4(_STARPU_FUT_KEYMASK_TASK, _STARPU_FUT_START_CODELET_BODY, (job)->job_id, ((job)->task)->sched_ctx, workerid, starpu_worker_get_memory_node(workerid)); \
|
|
|
{ \
|
|
|
if ((job)->task->cl) \
|
|
@@ -792,15 +794,18 @@ do { \
|
|
|
const uint32_t __job_hash = _starpu_compute_buffers_footprint((job)->task->cl?(job)->task->cl->model:NULL, perf_arch, nimpl, (job));\
|
|
|
FUT_FULL_PROBE7(_STARPU_FUT_KEYMASK_TASK_VERBOSE, _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)); \
|
|
|
} \
|
|
|
+ } \
|
|
|
} while(0)
|
|
|
|
|
|
#define _STARPU_TRACE_END_CODELET_BODY(job, nimpl, perf_arch, workerid) \
|
|
|
do { \
|
|
|
+ if( STARPU_UNLIKELY((_STARPU_FUT_KEYMASK_TASK) & fut_active) ) { \
|
|
|
const size_t job_size = _starpu_job_get_data_size((job)->task->cl?(job)->task->cl->model:NULL, perf_arch, nimpl, (job)); \
|
|
|
const uint32_t job_hash = _starpu_compute_buffers_footprint((job)->task->cl?(job)->task->cl->model:NULL, perf_arch, nimpl, (job));\
|
|
|
char _archname[32]=""; \
|
|
|
starpu_perfmodel_get_arch_name(perf_arch, _archname, 32, 0); \
|
|
|
_STARPU_FUT_FULL_PROBE5STR(_STARPU_FUT_KEYMASK_TASK, _STARPU_FUT_END_CODELET_BODY, (job)->job_id, (job_size), (job_hash), workerid, _starpu_gettid(), _archname); \
|
|
|
+ } \
|
|
|
} while(0)
|
|
|
|
|
|
#define _STARPU_TRACE_START_EXECUTING() \
|
|
@@ -867,7 +872,8 @@ do { \
|
|
|
} while(0)
|
|
|
|
|
|
#define _STARPU_TRACE_TASK_NAME(job) \
|
|
|
- do { \
|
|
|
+do { \
|
|
|
+ if( STARPU_UNLIKELY((_STARPU_FUT_KEYMASK_TASK) & fut_active) ) { \
|
|
|
const char *model_name = _starpu_job_get_model_name((job)); \
|
|
|
const char *name = _starpu_job_get_task_name((job)); \
|
|
|
if (name) \
|
|
@@ -879,14 +885,17 @@ do { \
|
|
|
} \
|
|
|
if (model_name) \
|
|
|
_STARPU_FUT_FULL_PROBE2STR(_STARPU_FUT_KEYMASK_TASK, _STARPU_FUT_MODEL_NAME, (job)->job_id, _starpu_gettid(), model_name); \
|
|
|
+ } \
|
|
|
} while(0)
|
|
|
|
|
|
#define _STARPU_TRACE_TASK_COLOR(job) \
|
|
|
do { \
|
|
|
+ if( STARPU_UNLIKELY((_STARPU_FUT_KEYMASK_TASK) & fut_active) ) { \
|
|
|
if ((job)->task->color != 0) \
|
|
|
FUT_FULL_PROBE2(_STARPU_FUT_KEYMASK_TASK, _STARPU_FUT_TASK_COLOR, (job)->job_id, (job)->task->color); \
|
|
|
else if ((job)->task->cl && (job)->task->cl->color != 0) \
|
|
|
FUT_FULL_PROBE2(_STARPU_FUT_KEYMASK_TASK, _STARPU_FUT_TASK_COLOR, (job)->job_id, (job)->task->cl->color); \
|
|
|
+ } \
|
|
|
} while(0)
|
|
|
|
|
|
#define _STARPU_TRACE_TASK_DONE(job) \
|
|
@@ -894,6 +903,7 @@ do { \
|
|
|
|
|
|
#define _STARPU_TRACE_TAG_DONE(tag) \
|
|
|
do { \
|
|
|
+ if( STARPU_UNLIKELY((_STARPU_FUT_KEYMASK_TASK) & fut_active) ) { \
|
|
|
struct _starpu_job *job = (tag)->job; \
|
|
|
const char *model_name = _starpu_job_get_task_name((job)); \
|
|
|
if (model_name) \
|
|
@@ -903,6 +913,7 @@ do { \
|
|
|
else { \
|
|
|
FUT_FULL_PROBE3(_STARPU_FUT_KEYMASK_TASK, _STARPU_FUT_TAG_DONE, (tag)->id, _starpu_gettid(), 0);\
|
|
|
} \
|
|
|
+ } \
|
|
|
} while(0)
|
|
|
|
|
|
#define _STARPU_TRACE_DATA_NAME(handle, name) \
|
|
@@ -1288,10 +1299,10 @@ do { \
|
|
|
FUT_FULL_PROBE4(_STARPU_FUT_KEYMASK_SCHED, _STARPU_FUT_SCHED_COMPONENT_POP_PRIO, _starpu_gettid(), workerid, ntasks, exp_len);
|
|
|
|
|
|
#define _STARPU_TRACE_SCHED_COMPONENT_NEW(component) \
|
|
|
- _STARPU_FUT_ALWAYS_PROBE1STR(_STARPU_FUT_SCHED_COMPONENT_NEW, component, (component)->name);
|
|
|
+ if (STARPU_UNLIKELY(fut_active)) _STARPU_FUT_ALWAYS_PROBE1STR(_STARPU_FUT_SCHED_COMPONENT_NEW, component, (component)->name);
|
|
|
|
|
|
#define _STARPU_TRACE_SCHED_COMPONENT_CONNECT(parent, child) \
|
|
|
- FUT_RAW_ALWAYS_PROBE2(FUT_CODE(_STARPU_FUT_SCHED_COMPONENT_CONNECT,2), parent, child);
|
|
|
+ if (STARPU_UNLIKELY(fut_active)) FUT_RAW_ALWAYS_PROBE2(FUT_CODE(_STARPU_FUT_SCHED_COMPONENT_CONNECT,2), parent, child);
|
|
|
|
|
|
#define _STARPU_TRACE_SCHED_COMPONENT_PUSH(from, to, task, prio) \
|
|
|
FUT_FULL_PROBE5(_STARPU_FUT_KEYMASK_SCHED, _STARPU_FUT_SCHED_COMPONENT_PUSH, _starpu_gettid(), from, to, task, prio);
|
|
@@ -1300,6 +1311,7 @@ do { \
|
|
|
FUT_FULL_PROBE5(_STARPU_FUT_KEYMASK_SCHED, _STARPU_FUT_SCHED_COMPONENT_PULL, _starpu_gettid(), from, to, task, (task)->priority);
|
|
|
|
|
|
#define _STARPU_TRACE_HANDLE_DATA_REGISTER(handle) do { \
|
|
|
+ if( STARPU_UNLIKELY((_STARPU_FUT_KEYMASK_META) & fut_active) ) { \
|
|
|
const size_t __data_size = handle->ops->get_size(handle); \
|
|
|
const starpu_ssize_t __max_data_size = _starpu_data_get_max_size(handle); \
|
|
|
char __buf[(FXT_MAX_PARAMS-4)*sizeof(long)]; \
|
|
@@ -1309,6 +1321,7 @@ do { \
|
|
|
else \
|
|
|
__buf[0] = 0; \
|
|
|
_STARPU_FUT_FULL_PROBE4STR(_STARPU_FUT_KEYMASK_META, _STARPU_FUT_HANDLE_DATA_REGISTER, handle, __data_size, __max_data_size, handle->home_node, __buf); \
|
|
|
+ } \
|
|
|
} while (0)
|
|
|
|
|
|
#define _STARPU_TRACE_HANDLE_DATA_UNREGISTER(handle) \
|