#include "xbt/dict.h"
#include "trace_mgr_private.h"
#include "surf_private.h"
-#include <stdlib.h>
-
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(trace, surf,
- "Logging specific to the SURF trace module");
static xbt_dict_t trace_list = NULL;
static void _tmgr_trace_free(void *trace)
h = xbt_new0(s_tmgr_history_t, 1);
- h->heap = xbt_heap_new(8, free); /* Why 8 ? Well, why not... */
+ h->heap = xbt_heap_new(8, xbt_free_f); /* Why 8 ? Well, why not... */
return h;
}
tmgr_trace_t tmgr_empty_trace_new(void)
{
tmgr_trace_t trace = NULL;
- /*double periodicity = -1.0; No periodicity by default; unused variables
- tmgr_event_t last_event = NULL;*/
+ /*double periodicity = -1.0; No periodicity by default; unused variables
+ tmgr_event_t last_event = NULL; */
s_tmgr_event_t event;
trace = xbt_new0(s_tmgr_trace_t, 1);
tmgr_trace_event_t tmgr_history_add_trace(tmgr_history_t h,
tmgr_trace_t trace,
double start_time, int offset,
- void *resource)
+ void *model)
{
tmgr_trace_event_t trace_event = NULL;
trace_event = xbt_new0(s_tmgr_trace_event_t, 1);
trace_event->trace = trace;
trace_event->idx = offset;
- trace_event->resource = resource;
+ trace_event->model = model;
xbt_assert0((trace_event->idx < xbt_dynar_length(trace->event_list)),
"You're refering to an event that does not exist!");
tmgr_trace_event_t tmgr_history_get_next_event_leq(tmgr_history_t h,
double date,
double *value,
- void **resource)
+ void **model)
{
double event_date = tmgr_history_next_date(h);
tmgr_trace_event_t trace_event = NULL;
event = xbt_dynar_get_ptr(trace->event_list, trace_event->idx);
*value = event->value;
- *resource = trace_event->resource;
+ *model = trace_event->model;
if (trace_event->idx < xbt_dynar_length(trace->event_list) - 1) {
xbt_heap_push(h->heap, trace_event, event_date + event->delta);