}
-static void set_line_color_cpu(PropertiesLine *prop_line, GQuark present_state)
+static void cpu_set_line_color(PropertiesLine *prop_line, LttvCPUState *s)
{
- if(present_state == LTTV_CPU_IDLE) {
+ GQuark present_state = ((GQuark*)s->mode_stack->data)[s->mode_stack->len-1];
+
+ if(present_state == LTTV_CPU_UNKNOWN) {
+ prop_line->color = drawing_colors_cpu[COL_CPU_UNKNOWN];
+ }
+ else if(present_state == LTTV_CPU_IDLE) {
prop_line->color = drawing_colors_cpu[COL_CPU_IDLE];
}
else if(present_state == LTTV_CPU_BUSY) {
else if(present_state == LTTV_CPU_IRQ) {
prop_line->color = drawing_colors_cpu[COL_CPU_IRQ];
}
+ else if(present_state == LTTV_CPU_TRAP) {
+ prop_line->color = drawing_colors_cpu[COL_CPU_TRAP];
+ }
}
/* before_schedchange_hook
// return 0;
// }
- exit(0);
-
tfc->target_pid = pid_out;
// if(!filter || !filter->head ||
// lttv_filter_tree_parse(filter->head,e,tfc->tf,
prop_line.line_width = STATE_LINE_WIDTH;
prop_line.style = GDK_LINE_SOLID;
prop_line.y = MIDDLE;
- cpu_set_line_color(&prop_line, tfs->cpu_state->present_state);
+ cpu_set_line_color(&prop_line, tfs->cpu_state);
draw_line((void*)&prop_line, (void*)&draw_context);
}
ResourceInfo *process_info;
/* Process not present */
Drawing_t *drawing = control_flow_data->drawing;
- ressourcelist_add(process_list,
+ resourcelist_add(process_list,
drawing,
trace_num,
cpuq, //process->name,
COLLISION_POSITION(hashed_process_data->height));
hashed_process_data->x.middle_marked = TRUE;
}
- } else {
+ }
+ else {
TimeWindow time_window =
lttvwindow_get_time_window(control_flow_data->tab);
hashed_process_data->x.middle_marked = TRUE;
}
/* jump */
- } else {
+ }
+ else {
DrawContext draw_context;
/* Now create the drawing context that will be used to draw
{
/* Draw the line */
PropertiesLine prop_line;
- cpu_set_line_color(&prop_line, tfs->cpu_state->present_state);
- printf("current state: %s\n", g_quark_to_string(tfs->cpu_state->present_state));
+ prop_line.line_width = STATE_LINE_WIDTH;
+ prop_line.style = GDK_LINE_SOLID;
+ prop_line.y = MIDDLE;
+ cpu_set_line_color(&prop_line, tfs->cpu_state);
draw_line((void*)&prop_line, (void*)&draw_context);
}
/* become the last x position */
prop_line.line_width = STATE_LINE_WIDTH;
prop_line.style = GDK_LINE_SOLID;
prop_line.y = MIDDLE;
- cpu_set_line_color(&prop_line, ts->cpu_states[process_info->id].present_state);
+ cpu_set_line_color(&prop_line, &ts->cpu_states[process_info->id]);
draw_line((void*)&prop_line, (void*)&draw_context);
}