X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Flttv%2Fmodules%2Fgui%2Fdiskperformance%2Fdiskperformance.c;h=d09da7e65daa55b06a686edd3f19c24decd76b1a;hb=0305fe774206ec12a98378be3cf891446b1b901c;hp=4805347b146c469c6d5030de6abd957363b69465;hpb=e62ca91e55ad4c8758400ecba3efc61f3c14eea2;p=lttv.git diff --git a/ltt/branches/poly/lttv/modules/gui/diskperformance/diskperformance.c b/ltt/branches/poly/lttv/modules/gui/diskperformance/diskperformance.c index 4805347b..d09da7e6 100644 --- a/ltt/branches/poly/lttv/modules/gui/diskperformance/diskperformance.c +++ b/ltt/branches/poly/lttv/modules/gui/diskperformance/diskperformance.c @@ -27,15 +27,14 @@ #include #include #include -#include #include -#include #include #include #include #include #include #include +#include #include #include "hDiskPerformanceInsert.xpm" @@ -43,7 +42,7 @@ #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 TRACE_NUMBER 0 +// fixed #define TRACE_NUMBER 0 #define NO_ITEMS 0 enum{ @@ -65,6 +64,8 @@ enum operation_t { typedef struct _DiskPerformanceData { Tab * tab; + + LttvPluginTab *ptab; LttvHooks * hooks_trace_after; @@ -118,7 +119,7 @@ GQuark LTT_FACILITY_BLOCK; GQuark LTT_EVENT_BLOCK_READ; GQuark LTT_EVENT_BLOCK_WRITE; -static DiskPerformanceData *disk_performance_data(Tab *tab); +static DiskPerformanceData *disk_performance_data(LttvPluginTab *ptab); static void disk_destroy_walk(gpointer data, gpointer user_data); static gboolean disk_show(void *hook_data, void *call_data); static gboolean trace_header(void *hook_data, void *call_data); @@ -128,7 +129,7 @@ void gui_disperformance_free(DiskPerformanceData *event_viewer_data); static void get_event_detail(LttEvent *e, lttv_block* disk_data); static char * major_minor_to_diskname( lttv_block* disk_data); static void sum_data(char* diskname, guint size, enum operation_t opt, GArray *disk_array); -static GtkWidget *disk_performance(Tab * tab); +static GtkWidget *disk_performance(LttvPlugin *plugin); static gboolean block_read_callback(void *hook_data, void *call_data); @@ -263,13 +264,13 @@ static void init() * Constructor hook * */ -GtkWidget *disk_performance(Tab * tab) +GtkWidget *disk_performance(LttvPlugin *plugin) { - - DiskPerformanceData* disk_data = disk_performance_data(tab); - if(disk_data) + LttvPluginTab *ptab = LTTV_PLUGIN_TAB(plugin); + DiskPerformanceData* disk_data = disk_performance_data(ptab); + if(disk_data) return disk_data->hbox_v; - else + else return NULL; } @@ -277,7 +278,7 @@ GtkWidget *disk_performance(Tab * tab) * This function initializes the Event Viewer functionnality through the * GTK API. */ -DiskPerformanceData *disk_performance_data(Tab *tab) +DiskPerformanceData *disk_performance_data(LttvPluginTab *ptab) { LttTime end; GtkTreeViewColumn *column; @@ -285,8 +286,9 @@ DiskPerformanceData *disk_performance_data(Tab *tab) DiskPerformanceData* disk_data = g_new(DiskPerformanceData,1) ; g_info("enter disk_performance_data \n"); - + Tab *tab = ptab->tab; disk_data->tab = tab; + disk_data->ptab = ptab; disk_data->time_window = lttvwindow_get_time_window(tab); disk_data->disk_array = g_array_new(FALSE, FALSE, sizeof(lttv_total_block )); @@ -432,8 +434,8 @@ static void request_event(DiskPerformanceData *disk_performance) nb_trace = lttv_traceset_number(traceset); - for(i = 0; i