#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
};
-/*
-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
+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 */
+};
-ZOMBIE + WAIT EXIT
-*/
+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, 0x5E00, 0x0000 }, /* COL_IRQ_BUSY */
+};
+GdkColor drawing_colors_bdev[NUM_COLORS_BDEV] =
+{ /* Pixel, R, G, B */
+ { 0, 0x0000, 0x0000, 0x0000 }, /* COL_BDEV_UNKNOWN */
+ { 0, 0xBBBB, 0xBBBB, 0xBBBB }, /* COL_BDEV_IDLE */
+ { 0, 0x0000, 0x0000, 0xFFFF }, /* COL_BDEV_BUSY_READING */
+ { 0, 0xFFFF, 0x0000, 0x0000 }, /* COL_BDEV_BUSY_WRITING */
+};
/*****************************************************************************
* drawing functions *
/* 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,
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,
&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,
+ LTT_FACILITY_BLOCK, LTT_EVENT_REQUEST_ISSUE,
+ LTT_FIELD_MAJOR, LTT_FIELD_MINOR, LTT_FIELD_OPERATION,
+ before_bdev_event_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,
+ LTT_FACILITY_BLOCK, LTT_EVENT_REQUEST_COMPLETE,
+ LTT_FIELD_MAJOR, LTT_FIELD_MINOR, LTT_FIELD_OPERATION,
+ before_bdev_event_hook,
events_request,
&g_array_index(hooks, LttvTraceHook, before_hn++));
if(ret) before_hn--;
&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);
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;
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,
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);
+ gdk_colormap_alloc_colors(colormap, drawing_colors_irq, NUM_COLORS_IRQ, FALSE,
+ TRUE, success);
+ gdk_colormap_alloc_colors(colormap, drawing_colors_bdev, NUM_COLORS_BDEV, FALSE,
+ TRUE, success);
drawing->gc =
gdk_gc_new(GDK_DRAWABLE(main_window_get_widget(control_flow_data->tab)->window));
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);
+ gdk_colormap_free_colors(colormap, drawing_colors_bdev, NUM_COLORS_BDEV);
// Do not unref here, Drawing_t destroyed by it's widget.
//g_object_unref( G_OBJECT(drawing->drawing_area));