Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Evaluating the expression of xbt_assert must not have side effects.
[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 "msg/msg.h"
16 #include "simdag/simdag.h"
17
18 XBT_PUBLIC(void) TRACE_category(const char *category);
19 XBT_PUBLIC(void) TRACE_category_with_color (const char *category, const char *color);
20 XBT_PUBLIC(void) TRACE_msg_set_task_category(m_task_t task,
21                                              const char *category);
22 void TRACE_msg_set_process_category(m_process_t process, const char *category, const char *color);
23 XBT_PUBLIC(void) TRACE_user_host_variable(double time,
24                                           const char *variable,
25                                           double value, const char *what);
26 XBT_PUBLIC(void) TRACE_user_link_variable(double time, const char *resource,
27                               const char *variable,
28                               double value, const char *what);
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 XBT_PUBLIC(void) TRACE_smpi_set_category(const char *category);
32 XBT_PUBLIC(void) TRACE_sd_set_task_category(SD_task_t task,
33                                             const char *category);
34
35 #define TRACE_host_variable_declare(var) \
36         TRACE_user_host_variable(0,var,0,"declare");
37
38 #define TRACE_host_variable_set_with_time(time,var,value) \
39         TRACE_user_host_variable(time,var,value,"set");
40
41 #define TRACE_host_variable_add_with_time(time,var,value) \
42         TRACE_user_host_variable(time,var,value,"add");
43
44 #define TRACE_host_variable_sub_with_time(time,var,value) \
45         TRACE_user_host_variable(time,var,value,"sub");
46
47 #define TRACE_host_variable_set(var,value) \
48         TRACE_user_host_variable(MSG_get_clock(),var,value,"set");
49
50 #define TRACE_host_variable_add(var,value) \
51         TRACE_user_host_variable(MSG_get_clock(),var,value,"add");
52
53 #define TRACE_host_variable_sub(var,value) \
54         TRACE_user_host_variable(MSG_get_clock(),var,value,"sub");
55
56 #define TRACE_link_variable_declare(var) \
57         TRACE_user_link_variable(0,NULL,NULL,var,0,"declare");
58
59 #define TRACE_link_variable_set_with_time(time,link,var,value) \
60         TRACE_user_link_variable(time,link,var,value,"set");
61
62 #define TRACE_link_variable_add_with_time(time,link,var,value) \
63         TRACE_user_link_variable(time,link,var,value,"add");
64
65 #define TRACE_link_variable_sub_with_time(time,link,var,value) \
66         TRACE_user_link_variable(time,link,var,value,"sub");
67
68 #define TRACE_link_variable_set(link,var,value) \
69         TRACE_user_link_variable(MSG_get_clock(),link,var,value,"set");
70
71 #define TRACE_link_variable_add(link,var,value) \
72         TRACE_user_link_variable(MSG_get_clock(),link,var,value,"add");
73
74 #define TRACE_link_variable_sub(link,var,value) \
75         TRACE_user_link_variable(MSG_get_clock(),link,var,value,"sub");
76
77 #else                           /* HAVE_TRACING */
78
79 #define TRACE_category(cat)
80 #define TRACE_category_with_color(cat,color)
81 #define TRACE_msg_set_task_category(task,cat)
82 #define TRACE_msg_set_process_category(proc,cat,color)
83 #define TRACE_set_mask(mask)
84
85 #define TRACE_host_variable_declare(var)
86 #define TRACE_host_variable_set_with_time(time,var,value)
87 #define TRACE_host_variable_add_with_time(time,var,value)
88 #define TRACE_host_variable_sub_with_time(time,var,value)
89 #define TRACE_host_variable_set(var,value)
90 #define TRACE_host_variable_add(var,value)
91 #define TRACE_host_variable_sub(var,value)
92 #define TRACE_link_variable_declare(var)
93 #define TRACE_link_variable_set_with_time(time,link,var,value)
94 #define TRACE_link_variable_add_with_time(time,link,var,value)
95 #define TRACE_link_variable_sub_with_time(time,link,var,value)
96 #define TRACE_link_variable_set(link,var,value)
97 #define TRACE_link_variable_add(link,var,value)
98 #define TRACE_link_variable_sub(link,var,value)
99 #define TRACE_declare_mark(type)
100 #define TRACE_mark(type,value)
101 #define TRACE_smpi_set_category(cat)
102 #define TRACE_sd_set_task_category(task,cat)
103
104 #endif                          /* HAVE_TRACING */
105
106 #endif                          /* INSTR_H_ */