/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
+/** @addtogroup MSG_examples
+ *
+ * - <b>tracing/user_variables.c</b>: This program demonstrates how to
+ * trace user variables associated to the hosts of the platform file.
+ * You might want to run this program with the following parameters:
+ * --cfg=tracing:1
+ * --cfg=tracing/platform:1
+ * (See \ref tracing_tracing_options for details)
+ */
+
#include <stdio.h>
#include "msg/msg.h"
#include "xbt/sysdep.h" /* calloc, printf */
MSG_launch_application(deployment_file);
MSG_main();
+
+ //get user declared variables
+ unsigned int cursor;
+ char *variable;
+ xbt_dynar_t host_variables = TRACE_get_host_variables ();
+ if (host_variables){
+ XBT_INFO ("Declared host variables:");
+ xbt_dynar_foreach (host_variables, cursor, variable){
+ XBT_INFO ("%s", variable);
+ }
+ xbt_dynar_free (&host_variables);
+ }
+ xbt_dynar_t link_variables = TRACE_get_link_variables ();
+ if (link_variables){
+ XBT_INFO ("Declared link variables:");
+ xbt_dynar_foreach (link_variables, cursor, variable){
+ XBT_INFO ("%s", variable);
+ }
+ xbt_dynar_free (&link_variables);
+ }
+
MSG_clean();
return 0;
}