X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/ae855a0d996d06d373fbc233e78b0fbe7f1f2df6..655cc78150b8f1b58c634dab01ff2a7aae715d1d:/src/instr/instr_private.h diff --git a/src/instr/instr_private.h b/src/instr/instr_private.h index f6942c9c66..2cb140920a 100644 --- a/src/instr/instr_private.h +++ b/src/instr/instr_private.h @@ -11,16 +11,6 @@ #ifdef HAVE_TRACING -extern int tracing_active; /* declared in paje.c */ - -#define IS_TRACING (tracing_active) -#define IS_TRACED(n) (n->category) -#define IS_TRACING_TASKS (TRACE_msg_task_is_enabled()) -#define IS_TRACING_PLATFORM (TRACE_platform_is_enabled()) -#define IS_TRACING_PROCESSES (TRACE_msg_process_is_enabled()) -#define IS_TRACING_VOLUME (TRACE_msg_volume_is_enabled()) -#define IS_TRACING_SMPI (TRACE_smpi_is_enabled()) - #define INSTR_DEFAULT_STR_SIZE 500 #include "instr/instr.h" @@ -28,14 +18,54 @@ extern int tracing_active; /* declared in paje.c */ #include "simdag/private.h" #include "simix/private.h" +typedef enum { + TYPE_VARIABLE, + TYPE_LINK, + TYPE_CONTAINER, + TYPE_STATE, + TYPE_EVENT, +} e_entity_types; + +typedef struct s_type *type_t; +typedef struct s_type { + char *id; + char *name; + e_entity_types kind; + struct s_type *father; + xbt_dict_t children; +}s_type_t; + +typedef enum { + INSTR_HOST, + INSTR_LINK, + INSTR_ROUTER, + INSTR_AS, + INSTR_SMPI, +} e_container_types; + +typedef struct s_container *container_t; +typedef struct s_container { + char *name; /* Unique name of this container */ + char *id; /* Unique id of this container */ + type_t type; /* Type of this container */ + int level; /* Level in the hierarchy, root level is 0 */ + e_container_types kind; /* This container is of what kind */ + struct s_container *father; + xbt_dict_t children; +}s_container_t; + +extern xbt_dict_t created_categories; + /* from paje.c */ void TRACE_paje_create_header(void); -void TRACE_paje_start(FILE * file); -FILE *TRACE_paje_end(void); +void TRACE_paje_start(void); +void TRACE_paje_end(void); void pajeDefineContainerType(const char *alias, const char *containerType, const char *name); void pajeDefineStateType(const char *alias, const char *containerType, const char *name); +void pajeDefineEventTypeWithColor(const char *alias, const char *containerType, + const char *name, const char *color); void pajeDefineEventType(const char *alias, const char *containerType, const char *name); void pajeDefineLinkType(const char *alias, const char *containerType, @@ -74,14 +104,6 @@ void pajeSubVariable(double time, const char *entityType, void pajeNewEvent(double time, const char *entityType, const char *container, const char *value); -/* from categories.c */ -void TRACE_category_alloc(void); -void TRACE_category_release(void); -void TRACE_category_set(smx_process_t proc, const char *category); -char *TRACE_category_get(smx_process_t proc); -void TRACE_category_unset(smx_process_t proc); -void TRACE_msg_category_set(smx_process_t proc, m_task_t task); - /* declaration of instrumentation functions from msg_task_instr.c */ char *TRACE_task_container(m_task_t task, char *output, int len); void TRACE_msg_task_alloc(void); @@ -122,19 +144,9 @@ void TRACE_smx_action_destroy(smx_action_t act); /* from surf_instr.c */ void TRACE_surf_alloc(void); void TRACE_surf_release(void); -void TRACE_surf_host_declaration(const char *name, double power); -void TRACE_surf_host_set_power(double date, const char *resource, - double power); -void TRACE_surf_host_define_id(const char *name, int host_id); -void TRACE_surf_host_vivaldi_parse(char *host, double x, double y, - double h); -void TRACE_surf_link_declaration(void *link, char *name, double bw, - double lat); -void TRACE_surf_link_set_bandwidth(double date, void *link, - double bandwidth); -void TRACE_surf_link_set_latency(double date, void *link, double latency); -void TRACE_surf_save_onelink(void); -int TRACE_surf_link_is_traced(void *link); +void TRACE_surf_host_set_power(double date, const char *resource, double power); +void TRACE_surf_link_set_bandwidth(double date, const char *resource, double bandwidth); +void TRACE_surf_link_set_latency(double date, const char *resource, double latency); void TRACE_surf_action(surf_action_t surf_action, const char *category); //for tracing gtnets @@ -144,6 +156,8 @@ int TRACE_surf_gtnets_get_dst(void *action); void TRACE_surf_gtnets_destroy(void *action); /* from smpi_instr.c */ +void TRACE_internal_smpi_set_category (const char *category); +const char *TRACE_internal_smpi_get_category (void); void TRACE_smpi_alloc(void); void TRACE_smpi_release(void); void TRACE_smpi_init(int rank); @@ -157,27 +171,36 @@ void TRACE_smpi_send(int rank, int src, int dst); void TRACE_smpi_recv(int rank, int src, int dst); /* from instr_config.c */ +int TRACE_start (void); +int TRACE_end (void); +void TRACE_activate (void); +void TRACE_desactivate (void); +int TRACE_is_active (void); int TRACE_is_enabled(void); int TRACE_is_configured(void); int TRACE_smpi_is_enabled(void); int TRACE_smpi_is_grouped(void); -int TRACE_platform_is_enabled(void); +int TRACE_categorized (void); int TRACE_uncategorized (void); int TRACE_msg_task_is_enabled(void); int TRACE_msg_process_is_enabled(void); int TRACE_msg_volume_is_enabled(void); char *TRACE_get_filename(void); char *TRACE_get_platform_method(void); +char *TRACE_get_triva_uncat_conf (void); +char *TRACE_get_triva_cat_conf (void); void TRACE_global_init(int *argc, char **argv); void TRACE_help(int detailed); +void TRACE_generate_triva_uncat_conf (void); +void TRACE_generate_triva_cat_conf (void); /* from resource_utilization.c */ -void TRACE_surf_host_set_utilization(const char *name, +void TRACE_surf_host_set_utilization(const char *resource, smx_action_t smx_action, surf_action_t surf_action, double value, double now, double delta); -void TRACE_surf_link_set_utilization(void *link, smx_action_t smx_action, +void TRACE_surf_link_set_utilization(const char *resource, smx_action_t smx_action, surf_action_t surf_action, double value, double now, double delta); @@ -195,6 +218,25 @@ void TRACE_surf_resource_utilization_release(void); void TRACE_sd_task_create(SD_task_t task); void TRACE_sd_task_destroy(SD_task_t task); -#endif - -#endif /* PRIVATE_H_ */ +/* instr_routing.c */ +container_t newContainer (const char *name, e_container_types kind, container_t father); +container_t getContainer (const char *name); +type_t newContainerType (const char *typename, e_entity_types kind, type_t father); +type_t newEventType (const char *typename, e_entity_types kind, const char *color, type_t father); +type_t newVariableType (const char *typename, e_entity_types kind, const char *color, type_t father); +type_t newLinkType (const char *typename, e_entity_types kind, type_t father, type_t source, type_t dest); +type_t newStateType (const char *typename, e_entity_types kind, type_t father); +type_t getType (const char *name); +void destroyContainer (container_t container); +void instr_routing_define_callbacks (void); +int instr_link_is_traced (const char *name); +char *instr_variable_type (const char *name, const char *resource); +char *instr_resource_type (const char *resource_name); +void instr_destroy_platform (void); +void instr_new_user_variable_type (const char *new_typename, const char *color); +void instr_new_user_link_variable_type (const char *new_typename, const char *color); +void instr_new_user_host_variable_type (const char *new_typename, const char *color); +int instr_platform_traced (void); + +#endif /* HAVE_TRACING */ +#endif /* INSTR_PRIVATE_H_ */