- 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);
+ if (TRACE_categorized()){
+ if (!surf_action->category)
+ return;
+ DEBUG5("CAT LINK [%f - %f] %s %s %f", now, now+delta, resource, surf_action->category, value);
+ char *variable_type = instr_variable_type (surf_action->category, resource);
+ char *resource_id = instr_resource_type (resource);
+ TRACE_surf_resource_utilization_event(smx_action, now, delta, variable_type, resource_id, value);
+ }