浏览代码

fix starpu-print-job when fxt is not compiled in

Samuel Thibault 14 年之前
父节点
当前提交
c4c2751801
共有 3 个文件被更改,包括 18 次插入7 次删除
  1. 7 1
      src/core/debug.c
  2. 4 1
      src/core/debug.h
  3. 7 5
      tools/gdbinit

+ 7 - 1
src/core/debug.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2009, 2010  Université de Bordeaux 1
+ * Copyright (C) 2009-2011  Université de Bordeaux 1
  * Copyright (C) 2010, 2011  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -25,6 +25,12 @@ static pthread_mutex_t logfile_mutex = PTHREAD_MUTEX_INITIALIZER;
 static FILE *logfile;
 #endif
 
+int _starpu_use_fxt
+#ifdef STARPU_USE_FXT
+	= 1
+#endif
+	;
+
 void _starpu_open_debug_logfile(void)
 {
 #ifdef STARPU_VERBOSE

+ 4 - 1
src/core/debug.h

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2009, 2010  Université de Bordeaux 1
+ * Copyright (C) 2009-2011  Université de Bordeaux 1
  * Copyright (C) 2010  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -34,4 +34,7 @@ void _starpu_close_debug_logfile(void);
 /* Write into StarPU's log file */
 void _starpu_print_to_logfile(const char *format, ...);
 
+/* Tell gdb whether FXT is compiled in or not */
+extern int _starpu_use_fxt;
+
 #endif // __DEBUG_H__

+ 7 - 5
tools/gdbinit

@@ -7,7 +7,9 @@ define starpu-print-job
   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
+  if _starpu_use_fxt == 1
+    printf "\tmodel_name:\t\t\t<%s>\n", $job->model_name
+  end
 end
 
 document starpu-print-job
@@ -44,9 +46,6 @@ define starpu-print-task
   end
 
   printf "StarPU Task (%p)\n", $task
-  if $job && $job->model_name
-    printf "\tname:\t\t\t<%s>\n", $job->model_name
-  end
   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
@@ -58,7 +57,10 @@ define starpu-print-task
   printf "\tstatus:\t\t\t\t<%s>\n", $status
   printf "\tjob:\t\t\t\t<%p>\n", $job
   printf "\tndeps:\t\t\t\t<%p>\n", $job->job_successors->ndeps
-  printf "\tndeps_completed:\t\t\t\t<%p>\n", $job->job_successors->ndeps_completed
+  printf "\tndeps_completed:\t\t<%p>\n", $job->job_successors->ndeps_completed
+  if $job
+    starpu-print-job $job
+  end
 end
 
 document starpu-print-task