Просмотр исходного кода

gdbinit: new functions to print job and task objects

Nathalie Furmento лет назад: 14
Родитель
Сommit
dbf5e61ccf
1 измененных файлов с 63 добавлено и 0 удалено
  1. 63 0
      tools/gdbinit

+ 63 - 0
tools/gdbinit

@@ -1,3 +1,64 @@
+define starpu-print-job
+  set language c
+  set $job = (struct starpu_job_s *)$arg0
+
+  printf "StarPU Job (%p)\n", $job
+  printf "\ttask:\t\t\t\t<%p>\n", $job->task
+  printf "\tsubmitted:\t\t\t<%d>\n", $job->submitted
+  printf "\tterminated:\t\t\t<%d>\n", $job->terminated
+  printf "\tjob_id:\t\t\t\t<%d>\n", $job->job_id
+  printf "\tmodel_name:\t\t\t<%s>\n", $job->model_name
+end
+
+document starpu-print-job
+Prints a StarPU job
+end
+
+define starpu-print-task
+  set language c
+  set $task = (struct starpu_task *)$arg0
+  set $job = (struct starpu_job_s *)$task->starpu_private
+  if $task->status == 0
+    set $status="STARPU_TASK_INVALID"
+  end
+  if $task->status == 1
+    set $status="STARPU_TASK_BLOCKED"
+  end
+  if $task->status == 2
+    set $status="STARPU_TASK_READY"
+  end
+  if $task->status == 3
+    set $status="STARPU_TASK_RUNNING"
+  end
+  if $task->status == 4
+    set $status="STARPU_TASK_FINISHED"
+  end
+  if $task->status == 5
+    set $status="STARPU_TASK_BLOCKED_ON_TAG"
+  end
+  if $task->status == 6
+    set $status="STARPU_TASK_BLOCKED_ON_TASK"
+  end
+  if $task->status == 7
+    set $status="STARPU_TASK_BLOCKED_ON_JOB"
+  end
+
+  printf "StarPU Task (%p)\n", $task
+  printf "\tcodelet:\t\t\t<%p>\n", $task->cl
+  printf "\tcallback:\t\t\t<%p>\n", $task->callback_func
+  printf "\tsynchronous:\t\t\t<%d>\n", $task->synchronous
+  printf "\texecute_on_a_specific_worker:\t<%d>\n", $task->execute_on_a_specific_worker
+  printf "\tworkerid:\t\t\t<%d>\n", $task->workerid
+  printf "\tdetach:\t\t\t\t<%d>\n", $task->detach
+  printf "\tdestroy:\t\t\t<%d>\n", $task->destroy
+  printf "\tregenerate:\t\t\t<%d>\n", $task->regenerate
+  printf "\tstatus:\t\t\t\t<%s>\n", $status
+  printf "\tjob:\t\t\t\t<%p>\n", $job
+end
+
+document starpu-print-task
+Prints a StarPU task
+end
 
 define starpu-jobs-on-worker
   set language c
@@ -39,4 +100,6 @@ document starpu
 List of StarPU-specific gdb functions:
 starpu-workers		prints a list of the StarPU workers
 starpu-jobs-on-worker   prints a list of the jobs running on the given worker
+starpu-print-job        prints a StarPU job
+starpu-print-task       prints a StarPU task
 end