#ifdef HAVE_TRACING
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_resource, instr, "tracing (un)-categorized resource utilization");
+
//to check if variables were previously set to 0, otherwise paje won't simulate them
static xbt_dict_t platform_variables; /* host or link name -> array of categories */
xbt_dynar_t array = xbt_dynar_new(sizeof(char *), xbt_free);
char *var_cpy = xbt_strdup(variable);
xbt_dynar_push(array, &var_cpy);
- if (IS_TRACING_PLATFORM)
+ if (TRACE_platform_is_enabled())
pajeSetVariable(now, variable, resource, "0");
xbt_dict_set(platform_variables, resource, array,
xbt_dynar_free_voidp);
if (flag == 0) {
char *var_cpy = xbt_strdup(variable);
xbt_dynar_push(array, &var_cpy);
- if (IS_TRACING_PLATFORM)
+ if (TRACE_platform_is_enabled())
pajeSetVariable(now, variable, resource, "0");
}
}
const char *variable, const char *resource,
double value)
{
- if (!IS_TRACING_PLATFORM)
- return;
-
char valuestr[100];
snprintf(valuestr, 100, "%f", value);
static void __TRACE_B_release(void)
{
- if (!IS_TRACING_PLATFORM)
- return;
-
char *key, *time;
xbt_dict_cursor_t cursor = NULL;
xbt_dict_foreach(method_b_dict, cursor, key, time) {
const char *variable, const char *resource,
double value)
{
- if (!IS_TRACING_PLATFORM)
- return;
-
char key_time[INSTR_DEFAULT_STR_SIZE];
char key_value[INSTR_DEFAULT_STR_SIZE];
char nowstr[INSTR_DEFAULT_STR_SIZE];
double value, double now,
double delta)
{
- if (!IS_TRACING)
+ if (!TRACE_is_active())
return;
if (!value)
return;
//trace uncategorized link utilization
if (TRACE_uncategorized()){
+ DEBUG4("UNCAT LINK [%f - %f] %s bandwidth_used %f", now, now+delta, resource, value);
TRACE_surf_resource_utilization_event(smx_action, now, delta,
"bandwidth_used", resource, value);
}
//trace categorized utilization
- if (!IS_TRACED(surf_action))
+ if (!surf_action->category)
return;
char type[100];
snprintf(type, 100, "b%s", surf_action->category);
+ DEBUG5("CAT LINK [%f - %f] %s %s %f", now, now+delta, resource, type, value);
TRACE_surf_resource_utilization_event(smx_action, now, delta, type,
resource, value);
return;
double value, double now,
double delta)
{
- if (!IS_TRACING)
+ if (!TRACE_is_active())
return;
if (!value)
return;
//trace uncategorized host utilization
if (TRACE_uncategorized()){
+ DEBUG4("UNCAT HOST [%f - %f] %s power_used %f", now, now+delta, name, value);
TRACE_surf_resource_utilization_event(smx_action, now, delta,
"power_used", name, value);
}
//trace categorized utilization
- if (!IS_TRACED(surf_action))
+ if (!surf_action->category)
return;
char type[100];
snprintf(type, 100, "p%s", surf_action->category);
+ DEBUG5("CAT HOST [%f - %f] %s %s %f", now, now+delta, name, type, value);
TRACE_surf_resource_utilization_event(smx_action, now, delta, type, name,
value);
return;
*/
void TRACE_surf_resource_utilization_start(smx_action_t action)
{
- if (!IS_TRACING)
+ if (!TRACE_is_active())
return;
+ DEBUG1("START %p", action);
TRACE_method_start(action);
}
const char *resource,
double value)
{
- if (!IS_TRACING)
+ if (!TRACE_is_active())
return;
+ DEBUG6("EVENT %p [%f - %f] %s %s %f", action, now, now+delta, resource, variable, value);
TRACE_method_event(action, now, delta, variable, resource, value);
}
void TRACE_surf_resource_utilization_end(smx_action_t action)
{
- if (!IS_TRACING)
+ if (!TRACE_is_active())
return;
TRACE_method_end(action);
+ DEBUG1("END %p", action);
}
void TRACE_surf_resource_utilization_release()
{
- if (!IS_TRACING)
+ if (!TRACE_is_active())
return;
TRACE_method_release();
}
__TRACE_define_method(TRACE_get_platform_method());
TRACE_method_alloc();
}
-#endif
+#endif /* HAVE_TRACING */