From: schnorr Date: Tue, 23 Nov 2010 14:42:08 +0000 (+0000) Subject: TRACE_start and TRACE_end should no longer be called by user-code X-Git-Tag: v3_5~212 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/3bf26d5f8bcf8154aff251b7dca4174468e0971e TRACE_start and TRACE_end should no longer be called by user-code details: - MSG_global_init and MSG_clean do the job for the user if tracing is set to on in cmake git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@8618 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/examples/msg/tracing/categories.c b/examples/msg/tracing/categories.c index ecc22fb2fc..07d03f6218 100644 --- a/examples/msg/tracing/categories.c +++ b/examples/msg/tracing/categories.c @@ -106,8 +106,6 @@ int main(int argc, char *argv[]) printf("example: %s msg_platform.xml msg_deployment.xml\n", argv[0]); exit(1); } - //starting the simulation tracing - TRACE_start(); //declaring user categories TRACE_category("compute"); @@ -118,9 +116,6 @@ int main(int argc, char *argv[]) res = test_all(argv[1], argv[2]); MSG_clean(); - //ending the simulation tracing - TRACE_end(); - if (res == MSG_OK) return 0; else diff --git a/examples/msg/tracing/ms.c b/examples/msg/tracing/ms.c index 1f7a16871e..179e1c5fcf 100644 --- a/examples/msg/tracing/ms.c +++ b/examples/msg/tracing/ms.c @@ -113,8 +113,6 @@ int main(int argc, char *argv[]) printf("example: %s msg_platform.xml msg_deployment.xml\n", argv[0]); exit(1); } - //starting the simulation tracing - TRACE_start(); //declaring user variables TRACE_host_variable_declare("is_slave"); @@ -132,9 +130,6 @@ int main(int argc, char *argv[]) res = test_all(argv[1], argv[2]); MSG_clean(); - //ending the simulation tracing - TRACE_end(); - if (res == MSG_OK) return 0; else diff --git a/examples/msg/tracing/procmig.c b/examples/msg/tracing/procmig.c index e45aab6985..2a22680368 100644 --- a/examples/msg/tracing/procmig.c +++ b/examples/msg/tracing/procmig.c @@ -50,8 +50,6 @@ int main(int argc, char *argv[]) argv[0]); exit(1); } - //starting the simulation trace - TRACE_start(); TRACE_category("emigrant"); /* Simulation setting */ @@ -67,9 +65,6 @@ int main(int argc, char *argv[]) if (res == MSG_OK) res = MSG_clean(); - //ending the simulation trace - TRACE_end(); - if (res == MSG_OK) return 0; else diff --git a/examples/msg/tracing/tasks.c b/examples/msg/tracing/tasks.c index ca955ee6b5..8cac0f8086 100644 --- a/examples/msg/tracing/tasks.c +++ b/examples/msg/tracing/tasks.c @@ -110,8 +110,6 @@ int main(int argc, char *argv[]) printf("example: %s msg_platform.xml msg_deployment.xml\n", argv[0]); exit(1); } - //starting the simulation tracing - TRACE_start(); //declaring user categories TRACE_category("compute"); @@ -120,9 +118,6 @@ int main(int argc, char *argv[]) res = test_all(argv[1], argv[2]); MSG_clean(); - //ending the simulation tracing - TRACE_end(); - if (res == MSG_OK) return 0; else diff --git a/examples/msg/tracing/volume.c b/examples/msg/tracing/volume.c index 7210fc5281..da850697a4 100644 --- a/examples/msg/tracing/volume.c +++ b/examples/msg/tracing/volume.c @@ -117,7 +117,6 @@ int main(int argc, char *argv[]) // - the communication volume among processes expects that: // - the processes involved have a category // - the tasks sent have a category - TRACE_start(); //declaring user categories (for tasks) TRACE_category("compute"); @@ -132,9 +131,6 @@ int main(int argc, char *argv[]) res = test_all(argv[1], argv[2]); MSG_clean(); - //ending the simulation tracing - TRACE_end(); - if (res == MSG_OK) return 0; else diff --git a/src/msg/global.c b/src/msg/global.c index bee130881d..7629d66454 100644 --- a/src/msg/global.c +++ b/src/msg/global.c @@ -80,6 +80,9 @@ void MSG_global_init(int *argc, char **argv) SIMIX_function_register_process_cleanup(__MSG_process_cleanup); SIMIX_function_register_process_kill(_MSG_process_kill_from_SIMIX); } +#ifdef HAVE_TRACING + TRACE_start(); +#endif } /** \defgroup m_channel_management Understanding channels @@ -214,6 +217,10 @@ MSG_error_t MSG_clean(void) SIMIX_clean(); +#ifdef HAVE_TRACING + TRACE_end(); +#endif + return MSG_OK; }