-static void __TRACE_A_end(smx_action_t action)
-{
-}
-
-#define B_METHOD
-//B
-
-static void __TRACE_B_alloc(void)
-{
- method_b_dict = xbt_dict_new();
-}
-
-static void __TRACE_B_release(void)
-{
- char *key, *time;
- xbt_dict_cursor_t cursor = NULL;
- xbt_dict_foreach(method_b_dict, cursor, key, time) {
- char resource[INSTR_DEFAULT_STR_SIZE];
- char variable[INSTR_DEFAULT_STR_SIZE];
- char what[INSTR_DEFAULT_STR_SIZE];
- sscanf (key, "%s %s %s", resource, variable, what);
- if (strcmp(what, "time")==0){
- char key_value[INSTR_DEFAULT_STR_SIZE];
- snprintf (key_value, INSTR_DEFAULT_STR_SIZE, "%s %s value", resource, variable);
- char *value = xbt_dict_get_or_null (method_b_dict, key_value);
- container_t container = getContainerByName (resource);
- type_t type = getVariableType (variable, NULL, container->type);
- new_pajeSubVariable(atof(time), container, type, atof(value));
- }
- }
- xbt_dict_free(&method_b_dict);
-}
-
-static void __TRACE_B_start(smx_action_t action)
-{
-}
-
-static void __TRACE_B_event(smx_action_t action, double now, double delta,
- const char *variable, const char *resource,
- double value)
-{
- char key_time[INSTR_DEFAULT_STR_SIZE];
- char key_value[INSTR_DEFAULT_STR_SIZE];
- char nowstr[INSTR_DEFAULT_STR_SIZE];
- char valuestr[INSTR_DEFAULT_STR_SIZE];
- char nowdeltastr[INSTR_DEFAULT_STR_SIZE];
-
- snprintf (key_time, INSTR_DEFAULT_STR_SIZE, "%s %s time", resource, variable);
- snprintf (key_value, INSTR_DEFAULT_STR_SIZE, "%s %s value", resource, variable);
- snprintf (nowstr, INSTR_DEFAULT_STR_SIZE, "%f", now);
- snprintf (valuestr, INSTR_DEFAULT_STR_SIZE, "%f", value);
- snprintf (nowdeltastr, INSTR_DEFAULT_STR_SIZE, "%f", now+delta);
-
- char *lasttimestr = xbt_dict_get_or_null(method_b_dict, key_time);
- char *lastvaluestr = xbt_dict_get_or_null(method_b_dict, key_value);
- if (lasttimestr == NULL){
- __TRACE_surf_check_variable_set_to_zero(now, variable, resource);
- container_t container = getContainerByName (resource);
- type_t type = getVariableType (variable, NULL, container->type);
- new_pajeAddVariable(now, container, type, value);
- xbt_dict_set(method_b_dict, key_time, xbt_strdup(nowdeltastr), xbt_free);
- xbt_dict_set(method_b_dict, key_value, xbt_strdup(valuestr), xbt_free);
- }else{
- double lasttime = atof (lasttimestr);
- double lastvalue = atof (lastvaluestr);
-
- if (lastvalue == value){
- double dif = fabs(now - lasttime);
- if (dif < 0.000001){
- //perfect, just go on
- }else{
- //time changed, have to update
- container_t container = getContainerByName (resource);
- type_t type = getVariableType (variable, NULL, container->type);
- new_pajeSubVariable(lasttime, container, type, lastvalue);
- new_pajeAddVariable(now, container, type, value);
- }
- }else{
- //value changed, have to update
- container_t container = getContainerByName (resource);
- type_t type = getVariableType (variable, NULL, container->type);
- new_pajeSubVariable(lasttime, container, type, lastvalue);
- new_pajeAddVariable(now, container, type, value);
- }
- xbt_dict_set(method_b_dict, key_time, xbt_strdup(nowdeltastr), xbt_free);
- xbt_dict_set(method_b_dict, key_value, xbt_strdup(valuestr), xbt_free);
- }
- return;
-}
-
-static void __TRACE_B_end(smx_action_t action)
-{
-}
-
-#define C_METHOD
-//C
-static void __TRACE_C_alloc(void)
-{
- method_c_dict = xbt_dict_new();
-}
-
-static void __TRACE_C_release(void)