Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
kill all aspects related to masks in the tracing interface
[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 #ifdef HAVE_TRACING
11
12 #include "xbt.h"
13 #include "msg/msg.h"
14
15 /* Trace error codes (used in exceptions) */
16 #define TRACE_ERROR_COMPLEX_ROUTES 100
17 #define TRACE_ERROR_TYPE_NOT_DEFINED 200
18 #define TRACE_ERROR_TYPE_ALREADY_DEFINED 201
19 #define TRACE_ERROR_CATEGORY_NOT_DEFINED 300
20 #define TRACE_ERROR_CATEGORY_ALREADY_DEFINED 301
21 #define TRACE_ERROR_MASK 400
22 #define TRACE_ERROR_FILE_OPEN 401
23 #define TRACE_ERROR_START 500
24
25 XBT_PUBLIC(int) TRACE_start (void);
26 XBT_PUBLIC(int) TRACE_end (void);
27 XBT_PUBLIC(int) TRACE_category (const char *category);
28 XBT_PUBLIC(void) TRACE_define_type (const char *type, const char *parent_type, int final);
29 XBT_PUBLIC(int) TRACE_create_category (const char *category, const char *type, const char *parent_category);
30 XBT_PUBLIC(void) TRACE_msg_set_task_category (m_task_t task, const char *category);
31 XBT_PUBLIC(void) TRACE_msg_set_process_category (m_process_t process, const char *category);
32 XBT_PUBLIC(void) TRACE_set_mask (int mask);
33 XBT_PUBLIC(void) __TRACE_host_variable (double time, const char *variable, double value, const char *what);
34 XBT_PUBLIC(void) __TRACE_link_variable (double time, const char *src, const char *dst, const char *variable, double value, const char *what);
35 XBT_PUBLIC(void) TRACE_declare_mark (const char *mark_type);
36 XBT_PUBLIC(void) TRACE_mark (const char *mark_type, const char *mark_value);
37
38 #define TRACE_host_variable_declare(var) \
39         __TRACE_host_variable(0,var,0,"declare");
40
41 #define TRACE_host_variable_set_with_time(time,var,value) \
42         __TRACE_host_variable(time,var,value,"set");
43
44 #define TRACE_host_variable_add_with_time(time,var,value) \
45         __TRACE_host_variable(time,var,value,"add");
46
47 #define TRACE_host_variable_sub_with_time(time,var,value) \
48         __TRACE_host_variable(time,var,value,"sub");
49
50 #define TRACE_host_variable_set(var,value) \
51         __TRACE_host_variable(MSG_get_clock(),var,value,"set");
52
53 #define TRACE_host_variable_add(var,value) \
54         __TRACE_host_variable(MSG_get_clock(),var,value,"add");
55
56 #define TRACE_host_variable_sub(var,value) \
57         __TRACE_host_variable(MSG_get_clock(),var,value,"sub");
58
59 #define TRACE_link_variable_declare(var) \
60         __TRACE_link_variable(0,NULL,NULL,var,0,"declare");
61
62 #define TRACE_link_variable_set_with_time(time,src,dst,var,value) \
63         __TRACE_link_variable(time,src,dst,var,value,"set");
64
65 #define TRACE_link_variable_add_with_time(time,src,dst,var,value) \
66         __TRACE_link_variable(time,src,dst,var,value,"add");
67
68 #define TRACE_link_variable_sub_with_time(time,src,dst,var,value) \
69         __TRACE_link_variable(time,src,dst,var,value,"sub");
70
71 #define TRACE_link_variable_set(src,dst,var,value) \
72         __TRACE_link_variable(MSG_get_clock(),src,dst,var,value,"set");
73
74 #define TRACE_link_variable_add(src,dst,var,value) \
75         __TRACE_link_variable(MSG_get_clock(),src,dst,var,value,"add");
76
77 #define TRACE_link_variable_sub(src,dst,var,value) \
78         __TRACE_link_variable(MSG_get_clock(),src,dst,var,value,"sub");
79
80 #else /* HAVE_TRACING */
81
82 #define TRACE_start()
83 #define TRACE_end()
84 #define TRACE_category(cat)
85 #define TRACE_define_type(cat,supercat,final)
86 #define TRACE_create_category(inst,cat)
87 #define TRACE_msg_set_task_category(task,cat)
88 #define TRACE_msg_set_process_category(proc,cat)
89 #define TRACE_set_mask(mask)
90
91 #define TRACE_host_variable_declare(var)
92 #define TRACE_host_variable_set_with_time(time,var,value)
93 #define TRACE_host_variable_add_with_time(time,var,value)
94 #define TRACE_host_variable_sub_with_time(time,var,value)
95 #define TRACE_host_variable_set(var,value)
96 #define TRACE_host_variable_add(var,value)
97 #define TRACE_host_variable_sub(var,value)
98 #define TRACE_link_variable_declare(var)
99 #define TRACE_link_variable_set_with_time(time,src,dst,var,value)
100 #define TRACE_link_variable_add_with_time(time,src,dst,var,value)
101 #define TRACE_link_variable_sub_with_time(time,src,dst,var,value)
102 #define TRACE_link_variable_set(src,dst,var,value)
103 #define TRACE_link_variable_add(src,dst,var,value)
104 #define TRACE_link_variable_sub(src,dst,var,value)
105 #define TRACE_declare_mark(type)
106 #define TRACE_mark(type,value)
107
108 #endif /* HAVE_TRACING */
109
110 #endif /* INSTR_H_ */