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(void) TRACE_smpi_set_category(const char *category);
25
26 /*
27  * Functions to manage tracing marks (used for trace comparison experiments)
28  */
29 XBT_PUBLIC(void) TRACE_declare_mark(const char *mark_type);
30 XBT_PUBLIC(void) TRACE_mark(const char *mark_type, const char *mark_value);
31
32 /*
33  * Function used by graphicator (transform a SimGrid platform
34  * file in a graphviz dot file with the network topology)
35  */
36 XBT_PUBLIC(int) TRACE_platform_graph_export_graphviz (const char *filename);
37
38 /*
39  * User-variables related functions
40  */
41 /* for host variables */
42 XBT_PUBLIC(void) TRACE_host_variable_declare (const char *variable);
43 XBT_PUBLIC(void) TRACE_host_variable_declare_with_color (const char *variable, const char *color);
44 XBT_PUBLIC(void) TRACE_host_variable_set (const char *host, const char *variable, double value);
45 XBT_PUBLIC(void) TRACE_host_variable_add (const char *host, const char *variable, double value);
46 XBT_PUBLIC(void) TRACE_host_variable_sub (const char *host, const char *variable, double value);
47 XBT_PUBLIC(void) TRACE_host_variable_set_with_time (double time, const char *host, const char *variable, double value);
48 XBT_PUBLIC(void) TRACE_host_variable_add_with_time (double time, const char *host, const char *variable, double value);
49 XBT_PUBLIC(void) TRACE_host_variable_sub_with_time (double time, const char *host, const char *variable, double value);
50
51 /* for link variables */
52 XBT_PUBLIC(void) TRACE_link_variable_declare (const char *var);
53 XBT_PUBLIC(void) TRACE_link_variable_declare_with_color (const char *var, const char *color);
54 XBT_PUBLIC(void) TRACE_link_variable_set (const char *link, const char *variable, double value);
55 XBT_PUBLIC(void) TRACE_link_variable_add (const char *link, const char *variable, double value);
56 XBT_PUBLIC(void) TRACE_link_variable_sub (const char *link, const char *variable, double value);
57 XBT_PUBLIC(void) TRACE_link_variable_set_with_time (double time, const char *link, const char *variable, double value);
58 XBT_PUBLIC(void) TRACE_link_variable_add_with_time (double time, const char *link, const char *variable, double value);
59 XBT_PUBLIC(void) TRACE_link_variable_sub_with_time (double time, const char *link, const char *variable, double value);
60
61 /* for link variables, but with src and dst used for get_route */
62 XBT_PUBLIC(void) TRACE_link_srcdst_variable_set (const char *src, const char *dst, const char *variable, double value);
63 XBT_PUBLIC(void) TRACE_link_srcdst_variable_add (const char *src, const char *dst, const char *variable, double value);
64 XBT_PUBLIC(void) TRACE_link_srcdst_variable_sub (const char *src, const char *dst, const char *variable, double value);
65 XBT_PUBLIC(void) TRACE_link_srcdst_variable_set_with_time (double time, const char *src, const char *dst, const char *variable, double value);
66 XBT_PUBLIC(void) TRACE_link_srcdst_variable_add_with_time (double time, const char *src, const char *dst, const char *variable, double value);
67 XBT_PUBLIC(void) TRACE_link_srcdst_variable_sub_with_time (double time, const char *src, const char *dst, const char *variable, double value);
68
69 #else                           /* HAVE_TRACING */
70
71 #define TRACE_category(category)
72 #define TRACE_category_with_color(category,color)
73 #define TRACE_smpi_set_category(category)
74
75 #define TRACE_declare_mark(mark_type)
76 #define TRACE_mark(mark_type,mark_value)
77
78 #define TRACE_platform_graph_export_graphviz(filename)
79
80 #define TRACE_host_variable_declare(var)
81 #define TRACE_host_variable_declare_with_color(var,color)
82 #define TRACE_host_variable_set(host,var,value)
83 #define TRACE_host_variable_add(host,var,value)
84 #define TRACE_host_variable_sub(host,var,value)
85 #define TRACE_host_variable_set_with_time(time,host,var,value)
86 #define TRACE_host_variable_add_with_time(time,host,var,value)
87 #define TRACE_host_variable_sub_with_time(time,host,var,value)
88
89 #define TRACE_link_variable_declare(var)
90 #define TRACE_link_variable_declare_with_color(var,color)
91 #define TRACE_link_variable_set(link,var,value)
92 #define TRACE_link_variable_add(link,var,value)
93 #define TRACE_link_variable_sub(link,var,value)
94 #define TRACE_link_variable_set_with_time(time,link,var,value)
95 #define TRACE_link_variable_add_with_time(time,link,var,value)
96 #define TRACE_link_variable_sub_with_time(time,link,var,value)
97
98 #define TRACE_link_srcdst_variable_set(src,dst,var,value)
99 #define TRACE_link_srcdst_variable_add(src,dst,var,value)
100 #define TRACE_link_srcdst_variable_sub(src,dst,var,value)
101 #define TRACE_link_srcdst_variable_set_with_time(time,src,dst,var,value)
102 #define TRACE_link_srcdst_variable_add_with_time(time,src,dst,var,value)
103 #define TRACE_link_srcdst_variable_sub_with_time(time,src,dst,var,value)
104
105 #endif                          /* HAVE_TRACING */
106
107 #endif                          /* INSTR_H_ */