#ifdef HAVE_TRACING
-extern routing_t used_routing;
+extern routing_global_t global_routing;
-void __TRACE_link_variable (double time, const char *src, const char *dst, const char *variable, double value, const char *what)
+void TRACE_user_link_variable(double time, const char *src,
+ const char *dst, const char *variable,
+ double value, const char *what)
{
- if (!IS_TRACING || !IS_TRACING_PLATFORM) return;
+ if (!IS_TRACING || !IS_TRACING_PLATFORM)
+ return;
char valuestr[100];
- snprintf (valuestr, 100, "%g", value);
+ snprintf(valuestr, 100, "%g", value);
- if (strcmp (what, "declare") == 0){
- pajeDefineVariableType (variable, "LINK", variable);
- return;
+ if (strcmp(what, "declare") == 0) {
+ pajeDefineVariableType(variable, "LINK", variable);
+ return;
}
- if (!used_routing) return;
-
- int src_id, dst_id;
- src_id = *(int*)xbt_dict_get(used_routing->host_id,src);
- dst_id = *(int*)xbt_dict_get(used_routing->host_id,dst);
- xbt_dynar_t route = used_routing->get_route(src_id, dst_id);
+ if (!global_routing)
+ return;
+ xbt_dynar_t route = global_routing->get_route(src, dst);
unsigned int i;
void *link_ptr;
xbt_dynar_foreach(route, i, link_ptr) {
- char *link = (*(link_CM02_t)link_ptr).lmm_resource.generic_resource.name;
-
- if (strcmp (what, "set") == 0){
- pajeSetVariable (time, variable, link, valuestr);
- }else if (strcmp (what, "add") == 0){
- pajeAddVariable (time, variable, link, valuestr);
- }else if (strcmp (what, "sub") == 0){
- pajeSubVariable (time, variable, link, valuestr);
- }
+ char resource[100];
+ snprintf(resource, 100, "%p", link_ptr);
+
+ if (strcmp(what, "set") == 0) {
+ pajeSetVariable(time, variable, resource, valuestr);
+ } else if (strcmp(what, "add") == 0) {
+ pajeAddVariable(time, variable, resource, valuestr);
+ } else if (strcmp(what, "sub") == 0) {
+ pajeSubVariable(time, variable, resource, valuestr);
+ }
}
}
-void __TRACE_host_variable (double time, const char *variable, double value, const char *what)
+void TRACE_user_host_variable(double time, const char *variable,
+ double value, const char *what)
{
- if (!IS_TRACING || !IS_TRACING_PLATFORM) return;
-
char valuestr[100];
- snprintf (valuestr, 100, "%g", value);
-
- if (strcmp (what, "declare") == 0){
- pajeDefineVariableType (variable, "HOST", variable);
- }else if (strcmp (what, "set") == 0){
- pajeSetVariable (time, variable, MSG_host_self()->name, valuestr);
- }else if (strcmp (what, "add") == 0){
- pajeAddVariable (time, variable, MSG_host_self()->name, valuestr);
- }else if (strcmp (what, "sub") == 0){
- pajeSubVariable (time, variable, MSG_host_self()->name, valuestr);
+ if (!IS_TRACING || !IS_TRACING_PLATFORM)
+ return;
+
+ snprintf(valuestr, 100, "%g", value);
+
+ if (strcmp(what, "declare") == 0) {
+ pajeDefineVariableType(variable, "HOST", variable);
+ } else if (strcmp(what, "set") == 0) {
+ pajeSetVariable(time, variable, MSG_host_self()->name, valuestr);
+ } else if (strcmp(what, "add") == 0) {
+ pajeAddVariable(time, variable, MSG_host_self()->name, valuestr);
+ } else if (strcmp(what, "sub") == 0) {
+ pajeSubVariable(time, variable, MSG_host_self()->name, valuestr);
}
}
-
-#endif /* HAVE_TRACING */
+#endif /* HAVE_TRACING */