X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/45d5c1bb8e65df9d0fbaa259ffeabdf49cf9fbe4..b75818ac32c18c4a2c6d5a28dd3da7f2ca19a5c1:/src/instr/instr_config.c diff --git a/src/instr/instr_config.c b/src/instr/instr_config.c index 44b1f3fdb9..3c37551979 100644 --- a/src/instr/instr_config.c +++ b/src/instr/instr_config.c @@ -634,16 +634,35 @@ void TRACE_generate_viva_cat_conf (void) generate_cat_configuration (TRACE_get_viva_cat_conf(), "viva", 0); } +static int previous_trace_state = -1; + void instr_pause_tracing (void) { + previous_trace_state = trace_enabled; + if (!TRACE_is_enabled()){ + XBT_DEBUG ("Tracing is already paused, therefore do nothing."); + }else{ + XBT_DEBUG ("Tracing is being paused."); + } trace_enabled = 0; XBT_DEBUG ("Tracing is paused."); } void instr_resume_tracing (void) { - trace_enabled = 1; + if (TRACE_is_enabled()){ + XBT_DEBUG ("Tracing is already running while trying to resume, therefore do nothing."); + }else{ + XBT_DEBUG ("Tracing is being resumed."); + } + + if (previous_trace_state != -1){ + trace_enabled = previous_trace_state; + }else{ + trace_enabled = 1; + } XBT_DEBUG ("Tracing is resumed."); + previous_trace_state = -1; } #undef OPT_TRACING