details:
- TRACE_category_with_color (category, color)
- TRACE_create_category_with_color (cat, type, parent_cat, color)
- this function can be used to create hierarchical categories definition
- color is a char* that must be in the following format
"%f %f %f", red, green, blue
where red, green, blue are float values in the interval [0, 1]
- user can specify a NULL color, or simply call the
TRACE_category (cat) or
TRACE_create_category (cat, type, parent_cat)
as before
-> instrumentation will define random colors
- but they might not be good colors for visu
- no need to configure colors during visualization analysis
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@8519
48e7efb5-ca39-0410-a469-
dd3cf9ba447f
XBT_PUBLIC(int) TRACE_start(void);
XBT_PUBLIC(int) TRACE_end(void);
XBT_PUBLIC(int) TRACE_category(const char *category);
XBT_PUBLIC(int) TRACE_start(void);
XBT_PUBLIC(int) TRACE_end(void);
XBT_PUBLIC(int) TRACE_category(const char *category);
+XBT_PUBLIC(int) TRACE_category_with_color (const char *category, const char *color);
XBT_PUBLIC(void) TRACE_define_type(const char *type,
const char *parent_type, int final);
XBT_PUBLIC(int) TRACE_create_category(const char *category,
const char *type,
const char *parent_category);
XBT_PUBLIC(void) TRACE_define_type(const char *type,
const char *parent_type, int final);
XBT_PUBLIC(int) TRACE_create_category(const char *category,
const char *type,
const char *parent_category);
+XBT_PUBLIC(int) TRACE_create_category_with_color(const char *category,
+ const char *type,
+ const char *parent_category,
+ const char *color);
XBT_PUBLIC(void) TRACE_msg_set_task_category(m_task_t task,
const char *category);
XBT_PUBLIC(void) TRACE_msg_set_process_category(m_process_t process,
XBT_PUBLIC(void) TRACE_msg_set_task_category(m_task_t task,
const char *category);
XBT_PUBLIC(void) TRACE_msg_set_process_category(m_process_t process,
}
int TRACE_category(const char *category)
}
int TRACE_category(const char *category)
+{
+ return TRACE_category_with_color (category, NULL);
+}
+
+int TRACE_category_with_color (const char *category, const char *color)
{
static int first_time = 1;
if (!IS_TRACING)
{
static int first_time = 1;
if (!IS_TRACING)
TRACE_define_type("user_type", "0", 1);
first_time = 0;
}
TRACE_define_type("user_type", "0", 1);
first_time = 0;
}
- return TRACE_create_category(category, "user_type", "0");
+ return TRACE_create_category_with_color(category, "user_type", "0", color);
}
void TRACE_define_type(const char *type,
}
void TRACE_define_type(const char *type,
int TRACE_create_category(const char *category,
const char *type, const char *parent_category)
int TRACE_create_category(const char *category,
const char *type, const char *parent_category)
+{
+ return TRACE_create_category_with_color (category, type, parent_category, NULL);
+}
+
+int TRACE_create_category_with_color(const char *category,
+ const char *type,
+ const char *parent_category,
+ const char *color)
{
char state[100];
char *val_one = NULL;
{
char state[100];
char *val_one = NULL;
pajeCreateContainer(MSG_get_clock(), category, type, parent_category,
category);
pajeCreateContainer(MSG_get_clock(), category, type, parent_category,
category);
- /* for registering application categories on top of platform */
+ char final_color[INSTR_DEFAULT_STR_SIZE];
+ if (!color){
+ //generate a random color
+ double red = drand48();
+ double green = drand48();
+ double blue = drand48();
+ snprintf (final_color, INSTR_DEFAULT_STR_SIZE, "%f %f %f", red, green, blue);
+ }else{
+ snprintf (final_color, INSTR_DEFAULT_STR_SIZE, "%s", color);
+ }
+ /* for registering application categories on top of platform */
snprintf(state, 100, "b%s", category);
if (IS_TRACING_PLATFORM)
snprintf(state, 100, "b%s", category);
if (IS_TRACING_PLATFORM)
- pajeDefineVariableType(state, "LINK", state);
+ pajeDefineVariableTypeWithColor(state, "LINK", state, final_color);
snprintf(state, 100, "p%s", category);
if (IS_TRACING_PLATFORM)
snprintf(state, 100, "p%s", category);
if (IS_TRACING_PLATFORM)
- pajeDefineVariableType(state, "HOST", state);
+ pajeDefineVariableTypeWithColor(state, "HOST", state, final_color);
val_one = xbt_strdup("1");
xbt_dict_set(created_categories, category, &val_one, xbt_free);
val_one = xbt_strdup("1");
xbt_dict_set(created_categories, category, &val_one, xbt_free);