#include <ltt/ltt.h>
#include <ltt/event.h>
-#include <ltt/type.h>
#include <ltt/trace.h>
#include <lttv/lttv.h>
#include <lttvwindow/lttvwindow.h>
#include <lttvwindow/lttvwindowtraces.h>
+#include <lttvwindow/lttv_plugin_tab.h>
#include "hGuiStatisticInsert.xpm"
GtkWidget *guistatistic_get_widget(StatisticViewerData *svd);
//! Statistic Viewer's constructor hook
-GtkWidget *h_gui_statistic(Tab *tab);
+GtkWidget *h_gui_statistic(LttvPlugin *plugin);
//! Statistic Viewer's constructor
-StatisticViewerData *gui_statistic(Tab *tab);
+StatisticViewerData *gui_statistic(LttvPluginTab *ptab);
//! Statistic Viewer's destructor
void gui_statistic_destructor(StatisticViewerData *statistic_viewer_data);
struct _StatisticViewerData{
Tab *tab;
+ LttvPluginTab *ptab;
//LttvTracesetStats * stats;
int size;
//hash
GHashTable *statistic_hash;
+
+ guint background_info_waiting;
};
Tab *tab = svd->tab;
LttvTrace *trace = (LttvTrace*)call_data;
- g_debug("statistics viewer : background computation data ready.");
+ svd->background_info_waiting--;
+
+ if(svd->background_info_waiting == 0) {
+ g_message("statistics viewer : background computation data ready.");
- gtk_tree_store_clear (svd->store_m);
+ gtk_tree_store_clear (svd->store_m);
- lttv_stats_sum_traceset(lttvwindow_get_traceset_stats(tab));
- show_traceset_stats(svd);
+ lttv_stats_sum_traceset(lttvwindow_get_traceset_stats(tab),
+ ltt_time_infinite);
+ show_traceset_stats(svd);
+ }
return 0;
}
gint num_traces = lttvwindowtraces_get_number();
gint i;
LttvTrace *trace;
+ GtkTextBuffer* buf;
LttvHooks *background_ready_hook =
lttv_hooks_new();
lttv_hooks_add(background_ready_hook, background_ready, svd,
LTTV_PRIO_DEFAULT);
+ svd->background_info_waiting = num_traces;
+ buf = gtk_text_view_get_buffer((GtkTextView*)svd->text_v);
+ gtk_text_buffer_set_text(buf,"", -1);
for(i=0;i<num_traces;i++) {
trace = lttvwindowtraces_get_trace(i);
NULL,
background_ready_hook);
} else { /* in progress */
-
lttvwindowtraces_background_notify_current(svd,
trace,
ltt_time_infinite,
lttv_hooks_call(background_ready_hook, NULL);
}
}
+
+ if(num_traces == 0) {
+ svd->background_info_waiting = 1;
+ lttv_hooks_call(background_ready_hook, NULL);
+ }
lttv_hooks_destroy(background_ready_hook);
}
* @return The widget created.
*/
GtkWidget *
-h_gui_statistic(Tab *tab)
+h_gui_statistic(LttvPlugin *plugin)
{
- StatisticViewerData* statistic_viewer_data = gui_statistic(tab) ;
+ LttvPluginTab *ptab = LTTV_PLUGIN_TAB(plugin);
+ StatisticViewerData* statistic_viewer_data = gui_statistic(ptab) ;
if(statistic_viewer_data)
return guistatistic_get_widget(statistic_viewer_data);
* @return The Statistic viewer data created.
*/
StatisticViewerData *
-gui_statistic(Tab *tab)
+gui_statistic(LttvPluginTab *ptab)
{
GtkCellRenderer *renderer;
GtkTreeViewColumn *column;
StatisticViewerData* statistic_viewer_data = g_new(StatisticViewerData,1);
-
+ Tab *tab = ptab->tab;
statistic_viewer_data->tab = tab;
+ statistic_viewer_data->ptab = ptab;
// statistic_viewer_data->stats =
// lttvwindow_get_traceset_stats(statistic_viewer_data->tab);
// statistic_viewer_data->calculate_stats =
ts = tscs->parent.parent.ts;
nb = lttv_traceset_number(ts);
- if(nb == 0)return;
+ if(nb == 0) return;
gtk_tree_store_append (store, &iter, NULL);
gtk_tree_store_set (store, &iter,