1 /* Copyright (c) 2010. The SimGrid Team.
2 * All rights reserved. */
4 /* This program is free software; you can redistribute it and/or modify it
5 * under the terms of the license (GNU LGPL) which comes with this package. */
10 #include "simgrid_config.h"
15 #include "xbt/graph.h"
17 #include "simdag/simdag.h"
19 XBT_PUBLIC(void) TRACE_category(const char *category);
20 XBT_PUBLIC(void) TRACE_category_with_color (const char *category, const char *color);
21 XBT_PUBLIC(void) TRACE_msg_set_task_category(m_task_t task, const char *category);
22 XBT_PUBLIC(void) TRACE_msg_set_process_category(m_process_t process, const char *category, const char *color);
23 XBT_PUBLIC(void) TRACE_smpi_set_category(const char *category);
24 XBT_PUBLIC(void) TRACE_sd_set_task_category(SD_task_t task, const char *category);
26 XBT_PUBLIC(void) TRACE_declare_mark(const char *mark_type);
27 XBT_PUBLIC(void) TRACE_mark(const char *mark_type, const char *mark_value);
29 XBT_PUBLIC(const char *) TRACE_node_name (xbt_node_t node);
30 XBT_PUBLIC(xbt_graph_t) TRACE_platform_graph (void);
31 XBT_PUBLIC(void) TRACE_platform_graph_export_graphviz (xbt_graph_t g, const char *filename);
35 * User-variables related functions
44 XBT_PUBLIC(void) TRACE_user_variable(double time,
47 const char *father_type,
49 InstrUserVariable what);
51 #define TRACE_host_variable_declare(var) \
52 TRACE_user_variable(0,NULL,var,"HOST",0,INSTR_US_DECLARE);
54 #define TRACE_host_variable_set_with_time(time,host,var,value) \
55 TRACE_user_variable(time,host,var,"HOST",value,INSTR_US_SET);
57 #define TRACE_host_variable_add_with_time(time,host,var,value) \
58 TRACE_user_variable(time,host,var,"HOST",value,INSTR_US_ADD);
60 #define TRACE_host_variable_sub_with_time(time,host,var,value) \
61 TRACE_user_variable(time,host,var,"HOST",value,INSTR_US_SUB);
63 #define TRACE_host_variable_set(host,var,value) \
64 TRACE_user_variable(MSG_get_clock(),host,var,"HOST",value,INSTR_US_SET);
66 #define TRACE_host_variable_add(host,var,value) \
67 TRACE_user_variable(MSG_get_clock(),host,var,"HOST",value,INSTR_US_ADD);
69 #define TRACE_host_variable_sub(host,var,value) \
70 TRACE_user_variable(MSG_get_clock(),host,var,"HOST",value,INSTR_US_SUB);
72 #define TRACE_link_variable_declare(var) \
73 TRACE_user_variable(0,NULL,var,"LINK",0,INSTR_US_DECLARE);
75 #define TRACE_link_variable_set_with_time(time,link,var,value) \
76 TRACE_user_variable(time,link,var,"LINK",value,INSTR_US_SET);
78 #define TRACE_link_variable_add_with_time(time,link,var,value) \
79 TRACE_user_variable(time,link,var,"LINK",value,INSTR_US_ADD);
81 #define TRACE_link_variable_sub_with_time(time,link,var,value) \
82 TRACE_user_variable(time,link,var,"LINK",value,INSTR_US_SUB);
84 #define TRACE_link_variable_set(link,var,value) \
85 TRACE_user_variable(MSG_get_clock(),link,var,"LINK",value,INSTR_US_SET);
87 #define TRACE_link_variable_add(link,var,value) \
88 TRACE_user_variable(MSG_get_clock(),link,var,"LINK",value,INSTR_US_ADD);
90 #define TRACE_link_variable_sub(link,var,value) \
91 TRACE_user_variable(MSG_get_clock(),link,var,"LINK",value,INSTR_US_SUB);
93 #else /* HAVE_TRACING */
95 #define TRACE_category(category)
96 #define TRACE_category_with_color(category,color)
97 #define TRACE_msg_set_task_category(task,category)
98 #define TRACE_msg_set_process_category(process,category,color)
99 #define TRACE_smpi_set_category(category)
100 #define TRACE_sd_set_task_category(task,category)
101 #define TRACE_declare_mark(mark_type)
102 #define TRACE_mark(mark_type,mark_value)
103 #define TRACE_node_name(node)
104 #define TRACE_platform_graph(void)
105 #define TRACE_platform_graph_export_graphviz(g,filename)
107 #define TRACE_host_variable_declare(var)
108 #define TRACE_host_variable_set_with_time(time,host,var,value)
109 #define TRACE_host_variable_add_with_time(time,host,var,value)
110 #define TRACE_host_variable_sub_with_time(time,host,var,value)
111 #define TRACE_host_variable_set(host,var,value)
112 #define TRACE_host_variable_add(host,var,value)
113 #define TRACE_host_variable_sub(host,var,value)
114 #define TRACE_link_variable_declare(var)
115 #define TRACE_link_variable_set_with_time(time,link,var,value)
116 #define TRACE_link_variable_add_with_time(time,link,var,value)
117 #define TRACE_link_variable_sub_with_time(time,link,var,value)
118 #define TRACE_link_variable_set(link,var,value)
119 #define TRACE_link_variable_add(link,var,value)
120 #define TRACE_link_variable_sub(link,var,value)
122 #endif /* HAVE_TRACING */
124 #endif /* INSTR_H_ */