瀏覽代碼

FxT: Allow larger event buffer

  when the event buffer is full, fxt stops recording events. The trace may thus be incomplete.
  Enable the fut_flush function which is called when the fxt event buffer is full to flush
  the buffer to disk, therefore allowing to record the remaining events.

  configure.ac: check the availability and the declaration of the function enable_fut_flush()
  fxt.h: declare the function if it is not done by FxT
  fxt.c: call the function if it is available
Nathalie Furmento 12 年之前
父節點
當前提交
a1f1ddf4be
共有 3 個文件被更改,包括 20 次插入2 次删除
  1. 2 0
      configure.ac
  2. 10 1
      src/common/fxt.c
  3. 8 1
      src/common/fxt.h

+ 2 - 0
configure.ac

@@ -863,6 +863,8 @@ AC_SUBST(STARPU_USE_FXT, $use_fxt)
 AM_CONDITIONAL(STARPU_USE_FXT, test x$use_fxt = xyes)
 
 if test x$use_fxt = xyes; then
+   	AC_CHECK_FUNCS([enable_fut_flush])
+	AC_CHECK_DECLS([enable_fut_flush])
 	AC_DEFINE(STARPU_USE_FXT, [1], [enable FxT traces])
 	AC_DEFINE(CONFIG_FUT, [1], [enable FUT traces])
 

+ 10 - 1
src/common/fxt.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009, 2010-2011  Université de Bordeaux 1
- * Copyright (C) 2010, 2011  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
  *
  * 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
@@ -97,6 +97,15 @@ void _starpu_start_fxt_profiling(void)
 		_starpu_profile_set_tracefile(NULL);
 	}
 
+#ifdef HAVE_ENABLE_FUT_FLUSH
+	// when the event buffer is full, fxt stops recording events.
+	// The trace may thus be incomplete.
+	// Enable the fut_flush function which is called when the
+	// fxt event buffer is full to flush the buffer to disk,
+	// therefore allowing to record the remaining events.
+	enable_fut_flush();
+#endif
+
 	threadid = _starpu_gettid();
 
 	atexit(_starpu_stop_fxt_profiling);

+ 8 - 1
src/common/fxt.h

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009-2011  Université de Bordeaux 1
- * Copyright (C) 2010, 2011  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
  *
  * 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
@@ -106,6 +106,13 @@
 #include <fxt/fxt.h>
 #include <fxt/fut.h>
 
+/* Some versions of FxT do not include the declaration of the function */
+#ifdef HAVE_ENABLE_FUT_FLUSH
+#if !HAVE_DECL_ENABLE_FUT_FLUSH 0
+void enable_fut_flush();
+#endif
+#endif
+
 long _starpu_gettid(void);
 
 /* Initialize the FxT library. */