+ XBT_DEBUG("CAT,declare %s, %s", category, final_color);
+
+ //define the type of this category on top of hosts and links
+ instr_new_variable_type (category, final_color);
+}
+
+
+/** \ingroup TRACE_category
+ * \brief Get declared categories
+ *
+ * This function should be used to get categories that were already
+ * declared with #TRACE_category or with #TRACE_category_with_color.
+ *
+ * See \ref tracing_tracing for details on how to trace
+ * the (categorized) resource utilization.
+ *
+ * \return A dynar with the declared categories, must be freed with xbt_dynar_free.
+ *
+ * \see MSG_task_set_category, SD_task_set_category
+ */
+xbt_dynar_t TRACE_get_categories (void)
+{
+ if (!TRACE_is_enabled()) return NULL;
+ if (!TRACE_categorized()) return NULL;
+
+ return instr_dict_to_dynar (created_categories);
+}
+
+/** \ingroup TRACE_mark
+ * \brief Declare a new type for tracing mark.
+ *
+ * This function declares a new Paje event
+ * type in the trace file that can be used by
+ * simulators to declare application-level
+ * marks. This function is independent of
+ * which API is used in SimGrid.
+ *
+ * \param mark_type The name of the new type.
+ *
+ * \see TRACE_mark
+ */
+void TRACE_declare_mark(const char *mark_type)
+{
+ /* safe switch */
+ if (!TRACE_is_enabled()) return;
+
+ if (!mark_type) return;
+
+ //check if mark_type is already declared
+ char *created = xbt_dict_get_or_null(declared_marks, mark_type);
+ if (created) return;
+ xbt_dict_set (declared_marks, mark_type, xbt_strdup("1"), NULL);
+
+ XBT_DEBUG("MARK,declare %s", mark_type);
+ PJ_type_event_new(mark_type, NULL, PJ_type_get_root());
+}
+
+/**
+ * \ingroup TRACE_mark
+ * \brief Create a new instance of a tracing mark type.
+ *
+ * This function creates a mark in the trace file. The
+ * first parameter had to be previously declared using
+ * #TRACE_declare_mark, the second is the identifier
+ * for this mark instance. We recommend that the
+ * mark_value is a unique value for the whole simulation.
+ * Nevertheless, this is not a strong requirement: the
+ * trace will be valid even if there are multiple mark
+ * identifiers for the same trace.
+ *
+ * \param mark_type The name of the type for which the new instance will belong.
+ * \param mark_value The name of the new instance mark.
+ *
+ * \see TRACE_declare_mark
+ */
+void TRACE_mark(const char *mark_type, const char *mark_value)
+{
+ /* safe switch */
+ if (!TRACE_is_enabled()) return;
+
+ if (!mark_type || !mark_value) return;
+
+ //check if mark_type is already declared
+ char *created = xbt_dict_get_or_null(declared_marks, mark_type);
+ if (created) return;
+
+ XBT_DEBUG("MARK %s %s", mark_type, mark_value);
+ type_t type = PJ_type_get (mark_type, PJ_type_get_root());
+ if (type == NULL){
+ THROWF (tracing_error, 1, "mark_type with name (%s) not declared before", mark_type);