Selaa lähdekoodia

fxt: release libfxt data

Samuel Thibault 4 vuotta sitten
vanhempi
commit
3403314615
2 muutettua tiedostoa jossa 21 lisäystä ja 0 poistoa
  1. 1 0
      configure.ac
  2. 20 0
      src/debug/traces/starpu_fxt.c

+ 1 - 0
configure.ac

@@ -2086,6 +2086,7 @@ if test x$use_fxt = xyes; then
 	save_LDFLAGS="$LDFLAGS"
 	LDFLAGS="$LDFLAGS $FXT_LDFLAGS"
 	AC_CHECK_FUNCS([fxt_close])
+	AC_CHECK_FUNCS([fxt_blockev_leave])
 	AC_CHECK_FUNCS([enable_fut_flush])
 	AC_CHECK_FUNCS([fut_set_filename])
 	AC_CHECK_FUNCS([fut_setup_flush_callback])

+ 20 - 0
src/debug/traces/starpu_fxt.c

@@ -4251,12 +4251,20 @@ void _starpu_fxt_parse_new_file(char *filename_in, struct starpu_fxt_options *op
 	for (i = 0; i < STARPU_NMAXWORKERS; i++)
 		free(options->worker_archtypes[i].devices);
 
+#ifdef HAVE_FXT_BLOCKEV_LEAVE
+	fxt_blockev_leave(block);
+#endif
+
 	/* Close the trace file */
+#ifdef HAVE_FXT_CLOSE
+	fxt_close(fut);
+#else
 	if (close(fd_in))
 	{
 	        perror("close failed :");
 	        exit(-1);
 	}
+#endif
 }
 
 /* Initialize FxT options to default values */
@@ -4674,12 +4682,20 @@ uint64_t _starpu_fxt_find_start_time(char *filename_in)
 	int ret = fxt_next_ev(block, FXT_EV_TYPE_64, (struct fxt_ev *)&ev);
 	STARPU_ASSERT (ret == FXT_EV_OK);
 
+#ifdef HAVE_FXT_BLOCKEV_LEAVE
+	fxt_blockev_leave(block);
+#endif
+
 	/* Close the trace file */
+#ifdef HAVE_FXT_CLOSE
+	fxt_close(fut);
+#else
 	if (close(fd_in))
 	{
 	        perror("close failed :");
 	        exit(-1);
 	}
+#endif
 	return (ev.time);
 }
 
@@ -4966,6 +4982,10 @@ void starpu_fxt_write_data_trace_in_dir(char *filename_in, char *dir)
 		}
 	}
 
+#ifdef HAVE_FXT_BLOCKEV_LEAVE
+	fxt_blockev_leave(block);
+#endif
+
 #ifdef HAVE_FXT_CLOSE
 	fxt_close(fut);
 #else