diff --git a/include/starpu.h b/include/starpu.h index 8621649be..4f52f0de9 100644 --- a/include/starpu.h +++ b/include/starpu.h @@ -406,7 +406,7 @@ struct starpu_conf to specify a bigger value to avoid any flushing (which would disturb the trace). */ - unsigned trace_buffer_size; + uint64_t trace_buffer_size; int global_sched_ctx_min_priority; int global_sched_ctx_max_priority; diff --git a/src/common/fxt.c b/src/common/fxt.c index 033026d1c..9372e011b 100644 --- a/src/common/fxt.c +++ b/src/common/fxt.c @@ -159,7 +159,14 @@ int starpu_fxt_is_enabled() return starpu_get_env_number_default("STARPU_FXT_TRACE", 1); } -void _starpu_fxt_init_profiling(unsigned trace_buffer_size) +void _starpu_fxt_flush_callback() +{ + _STARPU_MSG("FxT is flushing trace to disk !\n"); + + starpu_fxt_trace_user_event_string("fxt flush"); +} + +void _starpu_fxt_init_profiling(uint64_t trace_buffer_size) { unsigned threadid; @@ -191,7 +198,7 @@ void _starpu_fxt_init_profiling(unsigned trace_buffer_size) threadid = _starpu_gettid(); - if (fut_setup(trace_buffer_size / sizeof(unsigned long), initial_key_mask, threadid) < 0) + if (fut_setup(trace_buffer_size / sizeof(unsigned long), initial_key_mask, threadid, &_starpu_fxt_flush_callback) < 0) { perror("fut_setup"); STARPU_ABORT(); diff --git a/src/common/fxt.h b/src/common/fxt.h index 808af77fa..ab2408968 100644 --- a/src/common/fxt.h +++ b/src/common/fxt.h @@ -313,7 +313,7 @@ static inline unsigned long _starpu_fxt_get_submit_order(void) long _starpu_gettid(void); /* Initialize the FxT library. */ -void _starpu_fxt_init_profiling(unsigned trace_buffer_size); +void _starpu_fxt_init_profiling(uint64_t trace_buffer_size); /* Stop the FxT library, and generate the trace file. */ void _starpu_stop_fxt_profiling(void); diff --git a/src/core/workers.c b/src/core/workers.c index 967755933..fb6cee3e3 100644 --- a/src/core/workers.c +++ b/src/core/workers.c @@ -1142,7 +1142,8 @@ int starpu_conf_init(struct starpu_conf *conf) #endif /* 64MiB by default */ - conf->trace_buffer_size = starpu_get_env_number_default("STARPU_TRACE_BUFFER_SIZE", 64) << 20; + conf->trace_buffer_size = ((uint64_t) starpu_get_env_number_default("STARPU_TRACE_BUFFER_SIZE", 64)) << 20; + printf("used trace_buffer_size: %lu\n", conf->trace_buffer_size); /* Do not start performance counter collection by default */ conf->start_perf_counter_collection = 0;