Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid
[simgrid.git] / include / instr / instr.h
1 /* Copyright (c) 2010. The SimGrid Team.
2  * All rights reserved.                                                     */
3
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. */
6
7 #ifndef INSTR_H_
8 #define INSTR_H_
9
10 #include "simgrid_config.h"
11
12 #ifdef HAVE_TRACING
13
14 #include "xbt.h"
15 #include "xbt/graph.h"
16 #include "msg/msg.h"
17 #include "simdag/simdag.h"
18
19 /*
20  * Functions to manage tracing categories
21  */
22 XBT_PUBLIC(void) TRACE_category(const char *category);
23 XBT_PUBLIC(void) TRACE_category_with_color (const char *category, const char *color);
24 XBT_PUBLIC(xbt_dynar_t) TRACE_get_categories (void);
25 XBT_PUBLIC(void) TRACE_smpi_set_category(const char *category);
26
27 /*
28  * Functions to manage tracing marks (used for trace comparison experiments)
29  */
30 XBT_PUBLIC(void) TRACE_declare_mark(const char *mark_type);
31 XBT_PUBLIC(void) TRACE_declare_mark_value_with_color (const char *mark_type, const char *mark_value, const char *mark_color);
32 XBT_PUBLIC(void) TRACE_declare_mark_value (const char *mark_type, const char *mark_value);
33 XBT_PUBLIC(void) TRACE_mark(const char *mark_type, const char *mark_value);
34 XBT_PUBLIC(xbt_dynar_t) TRACE_get_marks (void);
35
36 /*
37  * Function used by graphicator (transform a SimGrid platform
38  * file in a graphviz dot file with the network topology)
39  */
40 XBT_PUBLIC(int) TRACE_platform_graph_export_graphviz (const char *filename);
41
42 /*
43  * User-variables related functions
44  */
45 /* for host variables */
46 XBT_PUBLIC(void) TRACE_host_variable_declare (const char *variable);
47 XBT_PUBLIC(void) TRACE_host_variable_declare_with_color (const char *variable, const char *color);
48 XBT_PUBLIC(void) TRACE_host_variable_set (const char *host, const char *variable, double value);
49 XBT_PUBLIC(void) TRACE_host_variable_add (const char *host, const char *variable, double value);
50 XBT_PUBLIC(void) TRACE_host_variable_sub (const char *host, const char *variable, double value);
51 XBT_PUBLIC(void) TRACE_host_variable_set_with_time (double time, const char *host, const char *variable, double value);
52 XBT_PUBLIC(void) TRACE_host_variable_add_with_time (double time, const char *host, const char *variable, double value);
53 XBT_PUBLIC(void) TRACE_host_variable_sub_with_time (double time, const char *host, const char *variable, double value);
54 XBT_PUBLIC(xbt_dynar_t) TRACE_get_host_variables (void);
55
56 /* for link variables */
57 XBT_PUBLIC(void) TRACE_link_variable_declare (const char *var);
58 XBT_PUBLIC(void) TRACE_link_variable_declare_with_color (const char *var, const char *color);
59 XBT_PUBLIC(void) TRACE_link_variable_set (const char *link, const char *variable, double value);
60 XBT_PUBLIC(void) TRACE_link_variable_add (const char *link, const char *variable, double value);
61 XBT_PUBLIC(void) TRACE_link_variable_sub (const char *link, const char *variable, double value);
62 XBT_PUBLIC(void) TRACE_link_variable_set_with_time (double time, const char *link, const char *variable, double value);
63 XBT_PUBLIC(void) TRACE_link_variable_add_with_time (double time, const char *link, const char *variable, double value);
64 XBT_PUBLIC(void) TRACE_link_variable_sub_with_time (double time, const char *link, const char *variable, double value);
65
66 /* for link variables, but with src and dst used for get_route */
67 XBT_PUBLIC(void) TRACE_link_srcdst_variable_set (const char *src, const char *dst, const char *variable, double value);
68 XBT_PUBLIC(void) TRACE_link_srcdst_variable_add (const char *src, const char *dst, const char *variable, double value);
69 XBT_PUBLIC(void) TRACE_link_srcdst_variable_sub (const char *src, const char *dst, const char *variable, double value);
70 XBT_PUBLIC(void) TRACE_link_srcdst_variable_set_with_time (double time, const char *src, const char *dst, const char *variable, double value);
71 XBT_PUBLIC(void) TRACE_link_srcdst_variable_add_with_time (double time, const char *src, const char *dst, const char *variable, double value);
72 XBT_PUBLIC(void) TRACE_link_srcdst_variable_sub_with_time (double time, const char *src, const char *dst, const char *variable, double value);
73 XBT_PUBLIC(xbt_dynar_t) TRACE_get_link_variables (void);
74 XBT_PUBLIC(void) TRACE_host_state_declare (const char *state);
75 XBT_PUBLIC(void) TRACE_host_state_declare_value (const char *state, const char *value, const char *color);
76 XBT_PUBLIC(void) TRACE_host_set_state (const char *host, const char *state, const char *value);
77 XBT_PUBLIC(void) TRACE_host_push_state (const char *host, const char *state, const char *value);
78 XBT_PUBLIC(void) TRACE_host_pop_state (const char *host, const char *state);
79 XBT_PUBLIC(void) TRACE_host_reset_state (const char *host, const char *state);
80
81 /* for creating graph configuration files for Viva by hand */
82 XBT_PUBLIC(xbt_dynar_t) TRACE_get_node_types (void);
83 XBT_PUBLIC(xbt_dynar_t) TRACE_get_edge_types (void);
84 XBT_PUBLIC(void) TRACE_pause (void);
85 XBT_PUBLIC(void) TRACE_resume (void);
86
87
88 #else                           /* HAVE_TRACING */
89
90 #define TRACE_category(category)
91 #define TRACE_category_with_color(category,color)
92 #define TRACE_get_categories()
93 #define TRACE_smpi_set_category(category)
94
95 #define TRACE_declare_mark(mark_type)
96 #define TRACE_mark(mark_type,mark_value)
97 #define TRACE_get_marks()
98
99 #define TRACE_platform_graph_export_graphviz(filename)
100
101 #define TRACE_host_variable_declare(var)
102 #define TRACE_host_variable_declare_with_color(var,color)
103 #define TRACE_host_variable_set(host,var,value)
104 #define TRACE_host_variable_add(host,var,value)
105 #define TRACE_host_variable_sub(host,var,value)
106 #define TRACE_host_variable_set_with_time(time,host,var,value)
107 #define TRACE_host_variable_add_with_time(time,host,var,value)
108 #define TRACE_host_variable_sub_with_time(time,host,var,value)
109 #define TRACE_get_host_variables()
110
111 #define TRACE_link_variable_declare(var)
112 #define TRACE_link_variable_declare_with_color(var,color)
113 #define TRACE_link_variable_set(link,var,value)
114 #define TRACE_link_variable_add(link,var,value)
115 #define TRACE_link_variable_sub(link,var,value)
116 #define TRACE_link_variable_set_with_time(time,link,var,value)
117 #define TRACE_link_variable_add_with_time(time,link,var,value)
118 #define TRACE_link_variable_sub_with_time(time,link,var,value)
119
120 #define TRACE_link_srcdst_variable_set(src,dst,var,value)
121 #define TRACE_link_srcdst_variable_add(src,dst,var,value)
122 #define TRACE_link_srcdst_variable_sub(src,dst,var,value)
123 #define TRACE_link_srcdst_variable_set_with_time(time,src,dst,var,value)
124 #define TRACE_link_srcdst_variable_add_with_time(time,src,dst,var,value)
125 #define TRACE_link_srcdst_variable_sub_with_time(time,src,dst,var,value)
126 #define TRACE_get_host_variables()
127
128 #define TRACE_get_node_types()
129 #define TRACE_get_edge_types()
130
131 #endif                          /* HAVE_TRACING */
132
133 #endif                          /* INSTR_H_ */