|
@@ -146,7 +146,25 @@ int starpu_fxt_is_enabled()
|
|
|
return starpu_get_env_number_default("STARPU_FXT_TRACE", 1);
|
|
|
}
|
|
|
|
|
|
+#ifdef HAVE_FUT_SETUP_FLUSH_CALLBACK
|
|
|
+void _starpu_fxt_flush_callback()
|
|
|
+{
|
|
|
+ _STARPU_MSG("FxT is flushing trace to disk ! This can impact performance.\n");
|
|
|
+ _STARPU_MSG("Maybe you should increase the value of STARPU_TRACE_BUFFER_SIZE ?\n");
|
|
|
+
|
|
|
+ starpu_fxt_trace_user_event_string("fxt flush");
|
|
|
+}
|
|
|
+#endif
|
|
|
+
|
|
|
+#ifdef HAVE_FUT_SETUP_FLUSH_CALLBACK
|
|
|
+/**
|
|
|
+ * Support for buffer size > 2 GB was added in FxT at the same
|
|
|
+ * time than fut_setup_flush_callback()
|
|
|
+ */
|
|
|
+void _starpu_fxt_init_profiling(uint64_t trace_buffer_size)
|
|
|
+#else
|
|
|
void _starpu_fxt_init_profiling(unsigned trace_buffer_size)
|
|
|
+#endif
|
|
|
{
|
|
|
unsigned threadid;
|
|
|
|
|
@@ -178,7 +196,11 @@ void _starpu_fxt_init_profiling(unsigned trace_buffer_size)
|
|
|
|
|
|
threadid = _starpu_gettid();
|
|
|
|
|
|
+#ifdef HAVE_FUT_SETUP_FLUSH_CALLBACK
|
|
|
+ if (fut_setup_flush_callback(trace_buffer_size / sizeof(unsigned long), initial_key_mask, threadid, &_starpu_fxt_flush_callback) < 0)
|
|
|
+#else
|
|
|
if (fut_setup(trace_buffer_size / sizeof(unsigned long), initial_key_mask, threadid) < 0)
|
|
|
+#endif
|
|
|
{
|
|
|
perror("fut_setup");
|
|
|
STARPU_ABORT();
|