Browse Source

src: make sure the task name is recorded early enough in the trace

Nathalie Furmento 3 years ago
parent
commit
c98f09d419
3 changed files with 10 additions and 4 deletions
  1. 8 0
      src/common/fxt.h
  2. 0 2
      src/core/task.c
  3. 2 2
      src/drivers/driver_common/driver_common.c

+ 8 - 0
src/common/fxt.h

@@ -869,6 +869,13 @@ do {									\
 	FUT_FULL_PROBE2(_STARPU_FUT_KEYMASK_TASK, _STARPU_FUT_TASK_EXCLUDE_FROM_DAG, (job)->job_id, (long unsigned)exclude_from_dag); \
 } while(0)
 
+#define _STARPU_TRACE_TASK_NAME_LINE_COLOR(job)				\
+	do {								\
+		_STARPU_TRACE_TASK_NAME(job);				\
+		_STARPU_TRACE_TASK_LINE(job);				\
+		_STARPU_TRACE_TASK_COLOR(job);				\
+	} while(0)
+
 #define _STARPU_TRACE_TASK_LINE(job)					\
 	do {								\
 		if ((job)->task->file)					\
@@ -1371,6 +1378,7 @@ do {										\
 #define _STARPU_TRACE_TASK_END_DEP(a, b)	do {(void)(a); (void)(b);} while(0)
 #define _STARPU_TRACE_GHOST_TASK_DEPS(a, b)	do {(void)(a); (void)(b);} while(0)
 #define _STARPU_TRACE_TASK_EXCLUDE_FROM_DAG(a)	do {(void)(a);} while(0)
+#define _STARPU_TRACE_TASK_NAME_LINE_COLOR(a)   do {(void)(a);} while(0)
 #define _STARPU_TRACE_TASK_NAME(a)		do {(void)(a);} while(0)
 #define _STARPU_TRACE_TASK_LINE(a)		do {(void)(a);} while(0)
 #define _STARPU_TRACE_TASK_COLOR(a)		do {(void)(a);} while(0)

+ 0 - 2
src/core/task.c

@@ -912,8 +912,6 @@ int _starpu_task_submit(struct starpu_task *task, int nodeps)
 		_STARPU_TRACE_TASK_SUBMIT(j,
 			_starpu_get_sched_ctx_struct(task->sched_ctx)->iterations[0],
 			_starpu_get_sched_ctx_struct(task->sched_ctx)->iterations[1]);
-		_STARPU_TRACE_TASK_NAME(j);
-		_STARPU_TRACE_TASK_LINE(j);
 	}
 
 	/* If this is a continuation, we don't modify the implicit data dependencies detected earlier. */

+ 2 - 2
src/drivers/driver_common/driver_common.c

@@ -114,12 +114,12 @@ void _starpu_driver_start_job(struct _starpu_worker *worker, struct _starpu_job
 				}
 			}
 		}
-		_STARPU_TRACE_TASK_COLOR(j);
+		_STARPU_TRACE_TASK_NAME_LINE_COLOR(j);
 		_STARPU_TRACE_START_CODELET_BODY(j, j->nimpl, &sched_ctx->perf_arch, workerid);
 	}
 	else
 	{
-		_STARPU_TRACE_TASK_COLOR(j);
+		_STARPU_TRACE_TASK_NAME_LINE_COLOR(j);
 		_STARPU_TRACE_START_CODELET_BODY(j, j->nimpl, perf_arch, workerid);
 	}
 	_starpu_sched_ctx_unlock_read(sched_ctx->id);