update for powerpc
[lttv.git] / ltt / branches / poly / lttv / modules / gui / statistics / statistics.c
index 87a3e762f74f22fa2736e0eb4efcf86e0fcf451c..0e87e3822b6e8ade46cf440b82f5bb53c432cee8 100644 (file)
@@ -169,7 +169,8 @@ static void request_background_data(StatisticViewerData *svd)
          * starts.
          */
         if(!lttvwindowtraces_background_request_find(trace, "stats"))
-          lttvwindowtraces_background_request_queue(trace, "stats");
+          lttvwindowtraces_background_request_queue(
+              main_window_get_widget(svd->tab), trace, "stats");
         lttvwindowtraces_background_notify_queue(svd,
                                                  trace,
                                                  ltt_time_infinite,
@@ -283,8 +284,7 @@ gui_statistic(Tab *tab)
   lttvwindow_register_traceset_notify(statistic_viewer_data->tab,
                                       statistic_traceset_changed,
                                       statistic_viewer_data);
-  request_background_data(statistic_viewer_data);
-  
   statistic_viewer_data->statistic_hash = g_hash_table_new_full(g_str_hash,
                                                   g_str_equal,
                                                   statistic_destroy_hash_key,
@@ -355,6 +355,8 @@ gui_statistic(Tab *tab)
       g_statistic_viewer_data_list,
       statistic_viewer_data);
 
+  request_background_data(statistic_viewer_data);
   return statistic_viewer_data;
 }
 
@@ -470,6 +472,7 @@ void show_tree(StatisticViewerData * statistic_viewer_data,
   LttvAttributeName name;
   LttvAttributeValue value;
   LttvAttributeType type;
+       gboolean is_named;
   gchar * str, dir_str[PATH_LENGTH];
   GtkTreePath * path;
   GtkTreeIter   iter;
@@ -477,17 +480,20 @@ void show_tree(StatisticViewerData * statistic_viewer_data,
 
   nb = lttv_attribute_get_number(stats);
   for(i = 0 ; i < nb ; i++) {
-    type = lttv_attribute_get(stats, i, &name, &value);
+    type = lttv_attribute_get(stats, i, &name, &value, &is_named);
     switch(type) {
      case LTTV_GOBJECT:
         if(LTTV_IS_ATTRIBUTE(*(value.v_gobject))) {
-    sprintf(dir_str, "%s", g_quark_to_string(name));
           subtree = (LttvAttribute *)*(value.v_gobject);
-    gtk_tree_store_append (store, &iter, parent);  
-    gtk_tree_store_set (store, &iter,NAME_COLUMN,dir_str,-1);  
-    path = gtk_tree_model_get_path(GTK_TREE_MODEL(store), &iter);
-    str = gtk_tree_path_to_string (path);
-    g_hash_table_insert(statistic_viewer_data->statistic_hash,
+          if(is_named)
+            sprintf(dir_str, "%s", g_quark_to_string(name));
+          else
+            sprintf(dir_str, "%u", name);
+          gtk_tree_store_append (store, &iter, parent);  
+          gtk_tree_store_set (store, &iter,NAME_COLUMN,dir_str,-1);  
+          path = gtk_tree_model_get_path(GTK_TREE_MODEL(store), &iter);
+          str = gtk_tree_path_to_string (path);
+          g_hash_table_insert(statistic_viewer_data->statistic_hash,
             (gpointer)str, subtree);
           show_tree(statistic_viewer_data, subtree, &iter);
         }
@@ -505,14 +511,18 @@ void show_statistic(StatisticViewerData * statistic_viewer_data,
   LttvAttributeName name;
   LttvAttributeValue value;
   LttvAttributeType type;
+       gboolean is_named;
   gchar type_name[PATH_LENGTH], type_value[PATH_LENGTH];
   GtkTextIter   text_iter;
   
   flag = 0;
   nb = lttv_attribute_get_number(stats);
   for(i = 0 ; i < nb ; i++) {
-    type = lttv_attribute_get(stats, i, &name, &value);
-    sprintf(type_name,"%s", g_quark_to_string(name));
+    type = lttv_attribute_get(stats, i, &name, &value, &is_named);
+               if(is_named)
+           sprintf(type_name,"%s", g_quark_to_string(name));
+               else
+           sprintf(type_name,"%u", name);
     type_value[0] = '\0';
     switch(type) {
       case LTTV_INT:
This page took 0.023637 seconds and 4 git commands to generate.