X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/c5f13796049934534009468a92c64392d0092510..dbb6a5398ebdb917f1de3acc0d16cd83cd23de71:/include/instr/instr.h diff --git a/include/instr/instr.h b/include/instr/instr.h index 4449bdd6f0..2467a46ef0 100644 --- a/include/instr/instr.h +++ b/include/instr/instr.h @@ -30,92 +30,36 @@ XBT_PUBLIC(const char *) TRACE_node_name (xbt_node_t node); XBT_PUBLIC(xbt_graph_t) TRACE_platform_graph (void); XBT_PUBLIC(void) TRACE_platform_graph_export_graphviz (xbt_graph_t g, const char *filename); - /* * User-variables related functions */ -typedef enum { - INSTR_US_DECLARE, - INSTR_US_SET, - INSTR_US_ADD, - INSTR_US_SUB, -} InstrUserVariable; - -XBT_PUBLIC(void) TRACE_user_variable(double time, - const char *resource, - const char *variable, - const char *father_type, - double value, - InstrUserVariable what); -XBT_PUBLIC(void) TRACE_user_srcdst_variable(double time, - const char *src, - const char *dst, - const char *variable, - const char *father_type, - double value, - InstrUserVariable what); - -#define TRACE_host_variable_declare(var) \ - TRACE_user_variable(0,NULL,var,"HOST",0,INSTR_US_DECLARE); - -#define TRACE_host_variable_set_with_time(time,host,var,value) \ - TRACE_user_variable(time,host,var,"HOST",value,INSTR_US_SET); - -#define TRACE_host_variable_add_with_time(time,host,var,value) \ - TRACE_user_variable(time,host,var,"HOST",value,INSTR_US_ADD); - -#define TRACE_host_variable_sub_with_time(time,host,var,value) \ - TRACE_user_variable(time,host,var,"HOST",value,INSTR_US_SUB); - -#define TRACE_host_variable_set(host,var,value) \ - TRACE_user_variable(MSG_get_clock(),host,var,"HOST",value,INSTR_US_SET); - -#define TRACE_host_variable_add(host,var,value) \ - TRACE_user_variable(MSG_get_clock(),host,var,"HOST",value,INSTR_US_ADD); - -#define TRACE_host_variable_sub(host,var,value) \ - TRACE_user_variable(MSG_get_clock(),host,var,"HOST",value,INSTR_US_SUB); - -#define TRACE_link_variable_declare(var) \ - TRACE_user_variable(0,NULL,var,"LINK",0,INSTR_US_DECLARE); - -#define TRACE_link_variable_set_with_time(time,link,var,value) \ - TRACE_user_variable(time,link,var,"LINK",value,INSTR_US_SET); - -#define TRACE_link_variable_add_with_time(time,link,var,value) \ - TRACE_user_variable(time,link,var,"LINK",value,INSTR_US_ADD); - -#define TRACE_link_variable_sub_with_time(time,link,var,value) \ - TRACE_user_variable(time,link,var,"LINK",value,INSTR_US_SUB); - -#define TRACE_link_variable_set(link,var,value) \ - TRACE_user_variable(MSG_get_clock(),link,var,"LINK",value,INSTR_US_SET); - -#define TRACE_link_variable_add(link,var,value) \ - TRACE_user_variable(MSG_get_clock(),link,var,"LINK",value,INSTR_US_ADD); - -#define TRACE_link_variable_sub(link,var,value) \ - TRACE_user_variable(MSG_get_clock(),link,var,"LINK",value,INSTR_US_SUB); - -//user provides src and dst, we set the value for the variables of all -//links connecting src and dst -#define TRACE_link_srcdst_variable_set_with_time(time,src,dst,var,value) \ - TRACE_user_srcdst_variable(time,src,dst,,var,"LINK",value,INSTR_US_SET); - -#define TRACE_link_srcdst_variable_add_with_time(time,src,dst,var,value) \ - TRACE_user_srcdst_variable(time,src,dst,var,"LINK",value,INSTR_US_ADD); - -#define TRACE_link_srcdst_variable_sub_with_time(time,src,dst,var,value) \ - TRACE_user_srcdst_variable(time,src,dst,var,"LINK",value,INSTR_US_SUB); - -#define TRACE_link_srcdst_variable_set(src,dst,var,value) \ - TRACE_user_srcdst_variable(MSG_get_clock(),src,dst,var,"LINK",value,INSTR_US_SET); - -#define TRACE_link_srcdst_variable_add(src,dst,var,value) \ - TRACE_user_srcdst_variable(MSG_get_clock(),src,dst,var,"LINK",value,INSTR_US_ADD); - -#define TRACE_link_srcdst_variable_sub(src,dst,var,value) \ - TRACE_user_srcdst_variable(MSG_get_clock(),src,dst,var,"LINK",value,INSTR_US_SUB); +/* for host variables */ +XBT_PUBLIC(void) TRACE_host_variable_declare (const char *var); +XBT_PUBLIC(void) TRACE_host_variable_declare_with_color (const char *var, const char *color); +XBT_PUBLIC(void) TRACE_host_variable_set (const char *host, const char *variable, double value); +XBT_PUBLIC(void) TRACE_host_variable_add (const char *host, const char *variable, double value); +XBT_PUBLIC(void) TRACE_host_variable_sub (const char *host, const char *variable, double value); +XBT_PUBLIC(void) TRACE_host_variable_set_with_time (double time, const char *host, const char *variable, double value); +XBT_PUBLIC(void) TRACE_host_variable_add_with_time (double time, const char *host, const char *variable, double value); +XBT_PUBLIC(void) TRACE_host_variable_sub_with_time (double time, const char *host, const char *variable, double value); + +/* for link variables */ +XBT_PUBLIC(void) TRACE_link_variable_declare (const char *var); +XBT_PUBLIC(void) TRACE_link_variable_declare_with_color (const char *var, const char *color); +XBT_PUBLIC(void) TRACE_link_variable_set (const char *link, const char *variable, double value); +XBT_PUBLIC(void) TRACE_link_variable_add (const char *link, const char *variable, double value); +XBT_PUBLIC(void) TRACE_link_variable_sub (const char *link, const char *variable, double value); +XBT_PUBLIC(void) TRACE_link_variable_set_with_time (double time, const char *link, const char *variable, double value); +XBT_PUBLIC(void) TRACE_link_variable_add_with_time (double time, const char *link, const char *variable, double value); +XBT_PUBLIC(void) TRACE_link_variable_sub_with_time (double time, const char *link, const char *variable, double value); + +/* for link variables, but with src and dst used for get_route */ +XBT_PUBLIC(void) TRACE_link_srcdst_variable_set (void *src, void *dst, const char *variable, double value); +XBT_PUBLIC(void) TRACE_link_srcdst_variable_add (void *src, void *dst, const char *variable, double value); +XBT_PUBLIC(void) TRACE_link_srcdst_variable_sub (void *src, void *dst, const char *variable, double value); +XBT_PUBLIC(void) TRACE_link_srcdst_variable_set_with_time (double time, void *src, void *dst, const char *variable, double value); +XBT_PUBLIC(void) TRACE_link_srcdst_variable_add_with_time (double time, void *src, void *dst, const char *variable, double value); +XBT_PUBLIC(void) TRACE_link_srcdst_variable_sub_with_time (double time, void *src, void *dst, const char *variable, double value); #else /* HAVE_TRACING */ @@ -125,34 +69,38 @@ XBT_PUBLIC(void) TRACE_user_srcdst_variable(double time, #define TRACE_msg_set_process_category(process,category,color) #define TRACE_smpi_set_category(category) #define TRACE_sd_set_task_category(task,category) + #define TRACE_declare_mark(mark_type) #define TRACE_mark(mark_type,mark_value) + #define TRACE_node_name(node) #define TRACE_platform_graph(void) #define TRACE_platform_graph_export_graphviz(g,filename) #define TRACE_host_variable_declare(var) -#define TRACE_host_variable_set_with_time(time,host,var,value) -#define TRACE_host_variable_add_with_time(time,host,var,value) -#define TRACE_host_variable_sub_with_time(time,host,var,value) +#define TRACE_host_variable_declare_with_color(var,color) #define TRACE_host_variable_set(host,var,value) #define TRACE_host_variable_add(host,var,value) #define TRACE_host_variable_sub(host,var,value) +#define TRACE_host_variable_set_with_time(time,host,var,value) +#define TRACE_host_variable_add_with_time(time,host,var,value) +#define TRACE_host_variable_sub_with_time(time,host,var,value) + #define TRACE_link_variable_declare(var) -#define TRACE_link_variable_set_with_time(time,link,var,value) -#define TRACE_link_variable_add_with_time(time,link,var,value) -#define TRACE_link_variable_sub_with_time(time,link,var,value) +#define TRACE_link_variable_declare_with_color(var,color) #define TRACE_link_variable_set(link,var,value) #define TRACE_link_variable_add(link,var,value) #define TRACE_link_variable_sub(link,var,value) -#define TRACE_link_srcdst_variable_set_with_time(time,src,dst,var,value) -#define TRACE_link_srcdst_variable_add_with_time(time,src,dst,var,value) -#define TRACE_link_srcdst_variable_sub_with_time(time,src,dst,var,value) +#define TRACE_link_variable_set_with_time(time,link,var,value) +#define TRACE_link_variable_add_with_time(time,link,var,value) +#define TRACE_link_variable_sub_with_time(time,link,var,value) + #define TRACE_link_srcdst_variable_set(src,dst,var,value) #define TRACE_link_srcdst_variable_add(src,dst,var,value) #define TRACE_link_srcdst_variable_sub(src,dst,var,value) - - +#define TRACE_link_srcdst_variable_set_with_time(time,src,dst,var,value) +#define TRACE_link_srcdst_variable_add_with_time(time,src,dst,var,value) +#define TRACE_link_srcdst_variable_sub_with_time(time,src,dst,var,value) #endif /* HAVE_TRACING */