X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Flttv%2Fmodules%2Fgui%2Fresourceview%2Fdrawing.c;h=ab9de32cb86e2aa33148807676a97ac746365414;hb=201fcc156aeee6cf7c1283c0163e47cb209cb78e;hp=e0b92aa3fc526ec49bba9444916e68139249d64e;hpb=9e01e6d4aa891aa2900227503bde6e7dd9ae65a1;p=lttv.git diff --git a/ltt/branches/poly/lttv/modules/gui/resourceview/drawing.c b/ltt/branches/poly/lttv/modules/gui/resourceview/drawing.c index e0b92aa3..ab9de32c 100644 --- a/ltt/branches/poly/lttv/modules/gui/resourceview/drawing.c +++ b/ltt/branches/poly/lttv/modules/gui/resourceview/drawing.c @@ -36,8 +36,8 @@ #include "eventhooks.h" #include "cfv.h" -#define g_info(format...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_INFO, format) -#define g_debug(format...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, format) +//#define g_info(format...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_INFO, format) +//#define g_debug(format...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, format) //FIXME // fixed #define TRACE_NUMBER 0 @@ -84,20 +84,21 @@ GdkColor drawing_colors[NUM_COLORS] = }; -/* -RUN+USER MODE green -RUN+SYSCALL -RUN+TRAP -RUN+IRQ -WAIT+foncé -WAIT CPU + WAIT FORK vert foncé ou jaune -IRQ rouge -TRAP: orange -SYSCALL: bleu pâle - -ZOMBIE + WAIT EXIT -*/ +GdkColor drawing_colors_cpu[NUM_COLORS_CPU] = +{ /* Pixel, R, G, B */ + { 0, 0x0000, 0x0000, 0x0000 }, /* COL_CPU_UNKNOWN */ + { 0, 0xBBBB, 0xBBBB, 0xBBBB }, /* COL_CPU_IDLE */ + { 0, 0xFFFF, 0xFFFF, 0xFFFF }, /* COL_CPU_BUSY */ + { 0, 0xFFFF, 0x5E00, 0x0000 }, /* COL_CPU_IRQ */ + { 0, 0xFF00, 0xFF00, 0x0100 }, /* COL_CPU_TRAP */ +}; +GdkColor drawing_colors_irq[NUM_COLORS_IRQ] = +{ /* Pixel, R, G, B */ + { 0, 0x0000, 0x0000, 0x0000 }, /* COL_IRQ_UNKNOWN */ + { 0, 0xBBBB, 0xBBBB, 0xBBBB }, /* COL_IRQ_IDLE */ + { 0, 0xFFFF, 0xFFFF, 0xFFFF }, /* COL_IRQ_BUSY */ +}; /***************************************************************************** * drawing functions * @@ -225,22 +226,22 @@ void drawing_data_request(Drawing_t *drawing, /* before hooks */ - ret = lttv_trace_find_hook(ts->parent.t, - LTT_FACILITY_KERNEL_ARCH, LTT_EVENT_SYSCALL_ENTRY, - LTT_FIELD_SYSCALL_ID, 0, 0, - before_execmode_hook, - events_request, - &g_array_index(hooks, LttvTraceHook, before_hn++)); - if(ret) before_hn--; - - ret = lttv_trace_find_hook(ts->parent.t, - LTT_FACILITY_KERNEL_ARCH, LTT_EVENT_SYSCALL_EXIT, - 0, 0, 0, - before_execmode_hook, - events_request, - &g_array_index(hooks, LttvTraceHook, before_hn++)); - if(ret) before_hn--; - +// ret = lttv_trace_find_hook(ts->parent.t, +// LTT_FACILITY_KERNEL_ARCH, LTT_EVENT_SYSCALL_ENTRY, +// LTT_FIELD_SYSCALL_ID, 0, 0, +// before_execmode_hook, +// events_request, +// &g_array_index(hooks, LttvTraceHook, before_hn++)); +// if(ret) before_hn--; +// +// ret = lttv_trace_find_hook(ts->parent.t, +// LTT_FACILITY_KERNEL_ARCH, LTT_EVENT_SYSCALL_EXIT, +// 0, 0, 0, +// before_execmode_hook, +// events_request, +// &g_array_index(hooks, LttvTraceHook, before_hn++)); +// if(ret) before_hn--; +// ret = lttv_trace_find_hook(ts->parent.t, LTT_FACILITY_KERNEL_ARCH, LTT_EVENT_TRAP_ENTRY, LTT_FIELD_TRAP_ID, 0, 0, @@ -272,22 +273,22 @@ void drawing_data_request(Drawing_t *drawing, events_request, &g_array_index(hooks, LttvTraceHook, before_hn++)); if(ret) before_hn--; - - ret = lttv_trace_find_hook(ts->parent.t, - LTT_FACILITY_KERNEL, LTT_EVENT_SOFT_IRQ_ENTRY, - LTT_FIELD_SOFT_IRQ_ID, 0, 0, - before_execmode_hook, - events_request, - &g_array_index(hooks, LttvTraceHook, before_hn++)); - if(ret) before_hn--; - - ret = lttv_trace_find_hook(ts->parent.t, - LTT_FACILITY_KERNEL, LTT_EVENT_SOFT_IRQ_EXIT, - 0, 0, 0, - before_execmode_hook, - events_request, - &g_array_index(hooks, LttvTraceHook, before_hn++)); - if(ret) before_hn--; +// +// ret = lttv_trace_find_hook(ts->parent.t, +// LTT_FACILITY_KERNEL, LTT_EVENT_SOFT_IRQ_ENTRY, +// LTT_FIELD_SOFT_IRQ_ID, 0, 0, +// before_execmode_hook, +// events_request, +// &g_array_index(hooks, LttvTraceHook, before_hn++)); +// if(ret) before_hn--; +// +// ret = lttv_trace_find_hook(ts->parent.t, +// LTT_FACILITY_KERNEL, LTT_EVENT_SOFT_IRQ_EXIT, +// 0, 0, 0, +// before_execmode_hook, +// events_request, +// &g_array_index(hooks, LttvTraceHook, before_hn++)); +// if(ret) before_hn--; ret = lttv_trace_find_hook(ts->parent.t, @@ -298,29 +299,29 @@ void drawing_data_request(Drawing_t *drawing, &g_array_index(hooks, LttvTraceHook, before_hn++)); if(ret) before_hn--; - ret = lttv_trace_find_hook(ts->parent.t, - LTT_FACILITY_KERNEL, LTT_EVENT_PROCESS_EXIT, - LTT_FIELD_PID, 0, 0, - before_process_exit_hook, - events_request, - &g_array_index(hooks, LttvTraceHook, before_hn++)); - if(ret) before_hn--; - - ret = lttv_trace_find_hook(ts->parent.t, - LTT_FACILITY_KERNEL, LTT_EVENT_PROCESS_FREE, - LTT_FIELD_PID, 0, 0, - before_process_release_hook, - events_request, - &g_array_index(hooks, LttvTraceHook, before_hn++)); - if(ret) before_hn--; - - ret = lttv_trace_find_hook(ts->parent.t, - LTT_FACILITY_LIST, LTT_EVENT_STATEDUMP_END, - 0, 0, 0, - before_statedump_end, - events_request, - &g_array_index(hooks, LttvTraceHook, before_hn++)); - if(ret) before_hn--; +// ret = lttv_trace_find_hook(ts->parent.t, +// LTT_FACILITY_KERNEL, LTT_EVENT_PROCESS_EXIT, +// LTT_FIELD_PID, 0, 0, +// before_process_exit_hook, +// events_request, +// &g_array_index(hooks, LttvTraceHook, before_hn++)); +// if(ret) before_hn--; +// +// ret = lttv_trace_find_hook(ts->parent.t, +// LTT_FACILITY_KERNEL, LTT_EVENT_PROCESS_FREE, +// LTT_FIELD_PID, 0, 0, +// before_process_release_hook, +// events_request, +// &g_array_index(hooks, LttvTraceHook, before_hn++)); +// if(ret) before_hn--; +// +// ret = lttv_trace_find_hook(ts->parent.t, +// LTT_FACILITY_LIST, LTT_EVENT_STATEDUMP_END, +// 0, 0, 0, +// before_statedump_end, +// events_request, +// &g_array_index(hooks, LttvTraceHook, before_hn++)); +// if(ret) before_hn--; #if 0 lttv_trace_find_hook(ts->parent.t, @@ -381,45 +382,45 @@ void drawing_data_request(Drawing_t *drawing, &g_array_index(hooks, LttvTraceHook, after_hn++)); if(ret) after_hn--; - ret = lttv_trace_find_hook(ts->parent.t, - LTT_FACILITY_KERNEL, LTT_EVENT_PROCESS_FORK, - LTT_FIELD_PARENT_PID, LTT_FIELD_CHILD_PID, 0, - after_process_fork_hook, - events_request, - &g_array_index(hooks, LttvTraceHook, after_hn++)); - if(ret) after_hn--; - - ret = lttv_trace_find_hook(ts->parent.t, - LTT_FACILITY_KERNEL, LTT_EVENT_PROCESS_EXIT, - LTT_FIELD_PID, 0, 0, - after_process_exit_hook, - events_request, - &g_array_index(hooks, LttvTraceHook, after_hn++)); - if(ret) after_hn--; - - ret = lttv_trace_find_hook(ts->parent.t, - LTT_FACILITY_FS, LTT_EVENT_EXEC, - 0, 0, 0, - after_fs_exec_hook, - events_request, - &g_array_index(hooks, LttvTraceHook, after_hn++)); - if(ret) after_hn--; - - ret = lttv_trace_find_hook(ts->parent.t, - LTT_FACILITY_USER_GENERIC, LTT_EVENT_THREAD_BRAND, - LTT_FIELD_NAME, 0, 0, - after_user_generic_thread_brand_hook, - events_request, - &g_array_index(hooks, LttvTraceHook, after_hn++)); - if(ret) after_hn--; - - ret = lttv_trace_find_hook(ts->parent.t, - LTT_FACILITY_LIST, LTT_EVENT_PROCESS_STATE, - LTT_FIELD_PID, LTT_FIELD_PARENT_PID, LTT_FIELD_NAME, - after_event_enum_process_hook, - events_request, - &g_array_index(hooks, LttvTraceHook, after_hn++)); - if(ret) after_hn--; +// ret = lttv_trace_find_hook(ts->parent.t, +// LTT_FACILITY_KERNEL, LTT_EVENT_PROCESS_FORK, +// LTT_FIELD_PARENT_PID, LTT_FIELD_CHILD_PID, 0, +// after_process_fork_hook, +// events_request, +// &g_array_index(hooks, LttvTraceHook, after_hn++)); +// if(ret) after_hn--; +// +// ret = lttv_trace_find_hook(ts->parent.t, +// LTT_FACILITY_KERNEL, LTT_EVENT_PROCESS_EXIT, +// LTT_FIELD_PID, 0, 0, +// after_process_exit_hook, +// events_request, +// &g_array_index(hooks, LttvTraceHook, after_hn++)); +// if(ret) after_hn--; +// +// ret = lttv_trace_find_hook(ts->parent.t, +// LTT_FACILITY_FS, LTT_EVENT_EXEC, +// 0, 0, 0, +// after_fs_exec_hook, +// events_request, +// &g_array_index(hooks, LttvTraceHook, after_hn++)); +// if(ret) after_hn--; +// +// ret = lttv_trace_find_hook(ts->parent.t, +// LTT_FACILITY_USER_GENERIC, LTT_EVENT_THREAD_BRAND, +// LTT_FIELD_NAME, 0, 0, +// after_user_generic_thread_brand_hook, +// events_request, +// &g_array_index(hooks, LttvTraceHook, after_hn++)); +// if(ret) after_hn--; +// +// ret = lttv_trace_find_hook(ts->parent.t, +// LTT_FACILITY_LIST, LTT_EVENT_PROCESS_STATE, +// LTT_FIELD_PID, LTT_FIELD_PARENT_PID, LTT_FIELD_NAME, +// after_event_enum_process_hook, +// events_request, +// &g_array_index(hooks, LttvTraceHook, after_hn++)); +// if(ret) after_hn--; hooks = g_array_set_size(hooks, after_hn); @@ -526,8 +527,8 @@ void drawing_data_request(Drawing_t *drawing, static void set_last_start(gpointer key, gpointer value, gpointer user_data) { - ProcessInfo *process_info = (ProcessInfo*)key; - HashedProcessData *hashed_process_data = (HashedProcessData*)value; + ResourceInfo *process_info = (ResourceInfo*)key; + HashedResourceData *hashed_process_data = (HashedResourceData*)value; guint x = (guint)user_data; hashed_process_data->x.over = x; @@ -579,12 +580,12 @@ void drawing_chunk_begin(EventsRequest *events_request, LttvTracesetState *tss) guint nb_trace = lttv_traceset_number(traceset); if(!cfd->process_list->current_hash_data) { - cfd->process_list->current_hash_data = g_new(HashedProcessData**,nb_trace); + cfd->process_list->current_hash_data = g_new(HashedResourceData**,nb_trace); for(i = 0 ; i < nb_trace ; i++) { guint num_cpu = ltt_trace_get_num_cpu(tss->parent.traces[i]->t); - cfd->process_list->current_hash_data[i] = g_new(HashedProcessData*,num_cpu); + cfd->process_list->current_hash_data[i] = g_new(HashedResourceData*,num_cpu); memset(cfd->process_list->current_hash_data[i], 0, - sizeof(HashedProcessData*)*num_cpu); + sizeof(HashedResourceData*)*num_cpu); } } //cfd->drawing->last_start = LTT_TIME_MIN(current_time, @@ -1072,6 +1073,8 @@ Drawing_t *drawing_construct(ControlFlowData *control_flow_data) gboolean success[NUM_COLORS]; gdk_colormap_alloc_colors(colormap, drawing_colors, NUM_COLORS, FALSE, TRUE, success); + gdk_colormap_alloc_colors(colormap, drawing_colors_cpu, NUM_COLORS_CPU, FALSE, + TRUE, success); drawing->gc = gdk_gc_new(GDK_DRAWABLE(main_window_get_widget(control_flow_data->tab)->window)); @@ -1128,8 +1131,8 @@ void drawing_destroy(Drawing_t *drawing) GdkColormap* colormap = gdk_colormap_get_system(); gdk_colormap_free_colors(colormap, drawing_colors, NUM_COLORS); - - + gdk_colormap_free_colors(colormap, drawing_colors_cpu, NUM_COLORS_CPU); + gdk_colormap_free_colors(colormap, drawing_colors_irq, NUM_COLORS_IRQ); // Do not unref here, Drawing_t destroyed by it's widget. //g_object_unref( G_OBJECT(drawing->drawing_area));