-//to check if variables were previously set to 0, otherwise paje won't simulate them
-static std::set<std::string> platform_variables;
-
-static void instr_event(double now, double delta, simgrid::instr::VariableType* variable, container_t resource,
- double value)
-{
- /* To trace resource utilization, we use AddEvent and SubEvent only. This implies to add a SetEvent first to set the
- * initial value of all variables for subsequent adds/subs. If we don't do so, the first AddEvent would be added to a
- * non-determined value, hence causing analysis problems.
- */
-
- // create a key considering the resource and variable
- std::string key = resource->get_name() + variable->get_name();
-
- // check if key exists: if it doesn't, set the variable to zero and mark this in the global map.
- if (platform_variables.find(key) == platform_variables.end()) {
- variable->setEvent(now, 0);
- platform_variables.insert(key);
- }
-
- variable->addEvent(now, value);
- variable->subEvent(now + delta, value);
-}
-
-void TRACE_surf_resource_set_utilization(const char* type, const char* name, const char* resource, const char* category,
- double value, double now, double delta)
+namespace simgrid {
+namespace instr {
+void resource_set_utilization(const char* type, const char* name, const char* resource, const std::string& category,
+ double value, double now, double delta)