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"
16 #include "simdag/simdag.h"
18 XBT_PUBLIC(int) TRACE_category(const char *category);
19 XBT_PUBLIC(int) TRACE_category_with_color (const char *category, const char *color);
20 XBT_PUBLIC(void) TRACE_define_type(const char *type,
21 const char *parent_type, int final);
22 XBT_PUBLIC(int) TRACE_create_category(const char *category,
24 const char *parent_category);
25 XBT_PUBLIC(int) TRACE_create_category_with_color(const char *category,
27 const char *parent_category,
29 XBT_PUBLIC(void) TRACE_msg_set_task_category(m_task_t task,
30 const char *category);
31 XBT_PUBLIC(void) TRACE_msg_set_process_category(m_process_t process,
32 const char *category);
33 XBT_PUBLIC(void) TRACE_set_mask(int mask);
34 XBT_PUBLIC(void) TRACE_user_host_variable(double time,
36 double value, const char *what);
37 XBT_PUBLIC(void) TRACE_user_link_variable(double time, const char *src,
40 double value, const char *what);
41 XBT_PUBLIC(void) TRACE_declare_mark(const char *mark_type);
42 XBT_PUBLIC(void) TRACE_mark(const char *mark_type, const char *mark_value);
43 XBT_PUBLIC(void) TRACE_smpi_set_category(const char *category);
44 XBT_PUBLIC(void) TRACE_sd_set_task_category(SD_task_t task,
45 const char *category);
47 #define TRACE_host_variable_declare(var) \
48 TRACE_user_host_variable(0,var,0,"declare");
50 #define TRACE_host_variable_set_with_time(time,var,value) \
51 TRACE_user_host_variable(time,var,value,"set");
53 #define TRACE_host_variable_add_with_time(time,var,value) \
54 TRACE_user_host_variable(time,var,value,"add");
56 #define TRACE_host_variable_sub_with_time(time,var,value) \
57 TRACE_user_host_variable(time,var,value,"sub");
59 #define TRACE_host_variable_set(var,value) \
60 TRACE_user_host_variable(MSG_get_clock(),var,value,"set");
62 #define TRACE_host_variable_add(var,value) \
63 TRACE_user_host_variable(MSG_get_clock(),var,value,"add");
65 #define TRACE_host_variable_sub(var,value) \
66 TRACE_user_host_variable(MSG_get_clock(),var,value,"sub");
68 #define TRACE_link_variable_declare(var) \
69 TRACE_user_link_variable(0,NULL,NULL,var,0,"declare");
71 #define TRACE_link_variable_set_with_time(time,src,dst,var,value) \
72 TRACE_user_link_variable(time,src,dst,var,value,"set");
74 #define TRACE_link_variable_add_with_time(time,src,dst,var,value) \
75 TRACE_user_link_variable(time,src,dst,var,value,"add");
77 #define TRACE_link_variable_sub_with_time(time,src,dst,var,value) \
78 TRACE_user_link_variable(time,src,dst,var,value,"sub");
80 #define TRACE_link_variable_set(src,dst,var,value) \
81 TRACE_user_link_variable(MSG_get_clock(),src,dst,var,value,"set");
83 #define TRACE_link_variable_add(src,dst,var,value) \
84 TRACE_user_link_variable(MSG_get_clock(),src,dst,var,value,"add");
86 #define TRACE_link_variable_sub(src,dst,var,value) \
87 TRACE_user_link_variable(MSG_get_clock(),src,dst,var,value,"sub");
89 #else /* HAVE_TRACING */
91 #define TRACE_category(cat)
92 #define TRACE_category_with_color(cat,color)
93 #define TRACE_define_type(cat,supercat,final)
94 #define TRACE_create_category(inst,cat)
95 #define TRACE_msg_set_task_category(task,cat)
96 #define TRACE_msg_set_process_category(proc,cat)
97 #define TRACE_set_mask(mask)
99 #define TRACE_host_variable_declare(var)
100 #define TRACE_host_variable_set_with_time(time,var,value)
101 #define TRACE_host_variable_add_with_time(time,var,value)
102 #define TRACE_host_variable_sub_with_time(time,var,value)
103 #define TRACE_host_variable_set(var,value)
104 #define TRACE_host_variable_add(var,value)
105 #define TRACE_host_variable_sub(var,value)
106 #define TRACE_link_variable_declare(var)
107 #define TRACE_link_variable_set_with_time(time,src,dst,var,value)
108 #define TRACE_link_variable_add_with_time(time,src,dst,var,value)
109 #define TRACE_link_variable_sub_with_time(time,src,dst,var,value)
110 #define TRACE_link_variable_set(src,dst,var,value)
111 #define TRACE_link_variable_add(src,dst,var,value)
112 #define TRACE_link_variable_sub(src,dst,var,value)
113 #define TRACE_declare_mark(type)
114 #define TRACE_mark(type,value)
115 #define TRACE_smpi_set_category(cat)
116 #define TRACE_sd_set_task_category(task,cat)
118 #endif /* HAVE_TRACING */
120 #endif /* INSTR_H_ */