virtual void set_max_duration(double duration);
/** @brief Get the tracing category associated to the current action */
- char* get_category() const { return category_; }
+ std::string get_category() const { return category_; }
/** @brief Set the tracing category of the current Action */
- void set_category(const char* category);
+ void set_category(std::string category) { category_ = category; }
/** @brief Get the priority of the current Action */
double get_priority() const { return sharing_priority_; };
double remains_; /**< How much of that cost remains to be done in the currently running task */
double start_time_; /**< start time */
double finish_time_ = -1; /**< finish time (may fluctuate until the task is completed) */
- char* category_ = nullptr; /**< tracing category for categorized resource utilization monitoring */
+ std::string category_; /**< tracing category for categorized resource utilization monitoring */
double cost_;
simgrid::kernel::resource::Model* model_;
XBT_PUBLIC bool TRACE_smpi_view_internals();
XBT_PRIVATE void TRACE_surf_resource_set_utilization(const char* type, const char* name, const char* resource,
- const char* category, double value, double now, double delta);
+ std::string category, double value, double now, double delta);
/* instr_paje.c */
extern XBT_PRIVATE std::set<std::string> trivaNodeTypes;
XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_resource, instr, "tracing (un)-categorized resource utilization");
-void TRACE_surf_resource_set_utilization(const char* type, const char* name, const char* resource, const char* category,
+void TRACE_surf_resource_set_utilization(const char* type, const char* name, const char* resource, std::string category,
double value, double now, double delta)
{
// only trace resource utilization if resource is known by tracing mechanism
}
// trace categorized resource utilization
- if (TRACE_categorized() && category) {
- std::string category_type = name[0] + std::string(category);
+ if (TRACE_categorized() && !category.empty()) {
+ std::string category_type = name[0] + category;
XBT_DEBUG("CAT %s [%f - %f] %s %s %f", type, now, now + delta, resource, category_type.c_str(), value);
container->get_variable(name)->instr_event(now, delta, resource, value);
}
get_model()->get_action_heap().remove(this);
if (modified_set_hook_.is_linked())
simgrid::xbt::intrusive_erase(*get_model()->get_modified_set(), *this);
-
- xbt_free(category_);
}
void Action::finish(Action::State state)
XBT_OUT();
}
-void Action::set_category(const char* category)
-{
- category_ = xbt_strdup(category);
-}
-
void Action::ref()
{
refcount_++;