瀏覽代碼

tools/gdbinit: new functions to print tags

Nathalie Furmento 8 年之前
父節點
當前提交
c97b42435e
共有 1 個文件被更改,包括 29 次插入13 次删除
  1. 29 13
      tools/gdbinit

+ 29 - 13
tools/gdbinit

@@ -2,7 +2,7 @@
 # StarPU --- Runtime system for heterogeneous multicore architectures.
 #
 # Copyright (C) 2010-2016  Université de Bordeaux
-# Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015  CNRS
+# Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015, 2016  CNRS
 #
 # StarPU is free software; you can redistribute it and/or modify
 # it under the terms of the GNU Lesser General Public License as published by
@@ -36,10 +36,6 @@ define starpu-print-job
   end
 end
 
-document starpu-print-job
-Prints a StarPU job
-end
-
 define starpu-print-task
   set language c
   set $task = (struct starpu_task *)$arg0
@@ -122,10 +118,6 @@ define starpu-print-task-and-successor
   end
 end
 
-document starpu-print-task
-Prints a StarPU task
-end
-
 define starpu-tasks-on-worker
   set language c
   set $worker=_starpu_config->workers[$arg0]
@@ -182,13 +174,35 @@ define starpu-workers
   end
 end
 
-document starpu-workers
-Prints a list of the StarPU workers
+define starpu-print-tag
+  set language c
+  set $tag_struct = (struct _starpu_tag *)gettag_struct($arg0)
+  if $tag_struct->state == STARPU_INVALID_STATE
+     set $status="STARPU_INVALID_STATE"
+  end
+  if $tag_struct->state == STARPU_ASSOCIATED
+     set $status="STARPU_ASSOCIATED"
+  end
+  if $tag_struct->state == STARPU_BLOCKED
+     set $status="STARPU_BLOCKED"
+  end
+  if $tag_struct->state == STARPU_READY
+     set $status="STARPU_READY"
+  end
+  if $tag_struct->state == STARPU_DONE
+     set $status="STARPU_DONE"
+  end
+  printf "tag %d state %s\n", $arg0, $status
 end
 
 define starpu-tags
+  set language c
   printf "tags htbl %p\n", tag_htbl
-  printf "TODO\n"
+  set $tags = tag_htbl
+  while $tags
+    starpu-print-tag $tags->id
+    set $tags = (struct _starpu_tag_table *) $tags.hh.next
+  end
 end
 
 define starpu-tasks
@@ -243,7 +257,8 @@ define starpu-all-tasks
   set $l = all_jobs_list->next
   while $l != &all_jobs_list
     set $j = (struct _starpu_job*) (((unsigned long) $l) - ((unsigned long) &((struct _starpu_job *)0)->all_submitted))
-    printf "task %p\n", $j->task
+    set $task = $j->task
+    printf "task %p %s %s\n", $task, $j->task->name
     set $l = $l->next
   end
 end
@@ -830,6 +845,7 @@ starpu-print-irequests             prints all queued StarPU idle data requests
 starpu-tasks                       prints a summary of the tasks flowing in StarPU
 starpu-all-tasks                   prints a list of all the tasks flowing in StarPU
 starpu-tags                        prints a list of the tags known to StarPU
+starpu-print-tag                   prints a given tag
 starpu-memusage                    prints the memory node usage
 starpu-print-archs                 prints all known arch combinations
 starpu-print-arch                  prints a given arch combination