Explorar el Código

fix enable_fut_flush detection, add fut_set_filename call

Samuel Thibault hace 12 años
padre
commit
c807ac1eda
Se han modificado 3 ficheros con 27 adiciones y 7 borrados
  1. 16 4
      configure.ac
  2. 4 1
      src/common/fxt.c
  3. 7 2
      src/common/fxt.h

+ 16 - 4
configure.ac

@@ -907,17 +907,29 @@ AC_SUBST(STARPU_USE_FXT, $use_fxt)
 AM_CONDITIONAL(STARPU_USE_FXT, test x$use_fxt = xyes)
 AM_CONDITIONAL(STARPU_USE_FXT, test x$use_fxt = xyes)
 
 
 if test x$use_fxt = xyes; then
 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(STARPU_USE_FXT, [1], [enable FxT traces])
 	AC_DEFINE(CONFIG_FUT, [1], [enable FUT traces])
 	AC_DEFINE(CONFIG_FUT, [1], [enable FUT traces])
 
 
 	if test x$use_fxt_from_system = xno; then
 	if test x$use_fxt_from_system = xno; then
-		CPPFLAGS="${CPPFLAGS} -I$fxtdir/include/ "
-		LDFLAGS="${LDFLAGS} -L$fxtdir/lib/ -lfxt"
+		FXT_CFLAGS="-I$fxtdir/include/ "
+		FXT_LDFLAGS="-L$fxtdir/lib/"
+		FXT_LIBS="-lfxt"
 	else
 	else
 	    PKG_CHECK_MODULES([FXT],  [fxt])
 	    PKG_CHECK_MODULES([FXT],  [fxt])
 	fi
 	fi
+	save_LIBS="$LIBS"
+	LIBS="$LIBS $FXT_LIBS"
+	save_LDFLAGS="$LDFLAGS"
+	LDFLAGS="$LDFLAGS $FXT_LDFLAGS"
+   	AC_CHECK_FUNCS([enable_fut_flush])
+   	AC_CHECK_FUNCS([fut_set_filename])
+	LDFLAGS="$save_LDFLAGS"
+	LIBS="$save_LIBS"
+	save_CFLAGS="$CFLAGS"
+	CFLAGS="$CFLAGS $FXT_CFLAGS"
+	AC_CHECK_DECLS([enable_fut_flush])
+	AC_CHECK_DECLS([fut_set_filename])
+	CFLAGS="$save_CFLAGS"
 fi
 fi
 
 
 AC_MSG_CHECKING(whether performance debugging should be enabled)
 AC_MSG_CHECKING(whether performance debugging should be enabled)

+ 4 - 1
src/common/fxt.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  *
- * Copyright (C) 2009, 2010-2011  Université de Bordeaux 1
+ * Copyright (C) 2009-2012  Université de Bordeaux 1
  * Copyright (C) 2010, 2011, 2012  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
  * StarPU is free software; you can redistribute it and/or modify
@@ -97,6 +97,9 @@ void _starpu_start_fxt_profiling(void)
 		_starpu_profile_set_tracefile(NULL);
 		_starpu_profile_set_tracefile(NULL);
 	}
 	}
 
 
+#ifdef HAVE_FUT_SET_FILENAME
+	fut_set_filename(_STARPU_PROF_FILE_USER);
+#endif
 #ifdef HAVE_ENABLE_FUT_FLUSH
 #ifdef HAVE_ENABLE_FUT_FLUSH
 	// when the event buffer is full, fxt stops recording events.
 	// when the event buffer is full, fxt stops recording events.
 	// The trace may thus be incomplete.
 	// The trace may thus be incomplete.

+ 7 - 2
src/common/fxt.h

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  *
- * Copyright (C) 2009-2011  Université de Bordeaux 1
+ * Copyright (C) 2009-2012  Université de Bordeaux 1
  * Copyright (C) 2010, 2011, 2012  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
  * StarPU is free software; you can redistribute it and/or modify
@@ -108,10 +108,15 @@
 
 
 /* Some versions of FxT do not include the declaration of the function */
 /* Some versions of FxT do not include the declaration of the function */
 #ifdef HAVE_ENABLE_FUT_FLUSH
 #ifdef HAVE_ENABLE_FUT_FLUSH
-#if !HAVE_DECL_ENABLE_FUT_FLUSH 0
+#if !HAVE_DECL_ENABLE_FUT_FLUSH
 void enable_fut_flush();
 void enable_fut_flush();
 #endif
 #endif
 #endif
 #endif
+#ifdef HAVE_FUT_SET_FILENAME
+#if !HAVE_DECL_FUT_SET_FILENAME
+void fut_set_filename(char *filename);
+#endif
+#endif
 
 
 long _starpu_gettid(void);
 long _starpu_gettid(void);