[sysprof/wip/chergert/sysprof-3] libsysprof-ui: add hits column



commit c0105e19965fae54374f188761a41eed81823422
Author: Christian Hergert <chergert redhat com>
Date:   Mon May 20 13:56:08 2019 -0700

    libsysprof-ui: add hits column

 src/libsysprof-ui/sysprof-callgraph-view.c     |  9 ++++++---
 src/libsysprof-ui/ui/sysprof-callgraph-view.ui | 15 +++++++++++++++
 2 files changed, 21 insertions(+), 3 deletions(-)
---
diff --git a/src/libsysprof-ui/sysprof-callgraph-view.c b/src/libsysprof-ui/sysprof-callgraph-view.c
index 603450e..c9927ee 100644
--- a/src/libsysprof-ui/sysprof-callgraph-view.c
+++ b/src/libsysprof-ui/sysprof-callgraph-view.c
@@ -79,6 +79,7 @@ enum {
   COLUMN_SELF,
   COLUMN_TOTAL,
   COLUMN_POINTER,
+  COLUMN_HITS,
 };
 
 
@@ -961,6 +962,7 @@ append_to_tree_and_free (SysprofCallgraphView *self,
                       COLUMN_SELF, item->self * 100.0 / (gdouble)profile_size,
                       COLUMN_TOTAL, item->cumulative * 100.0 / (gdouble)profile_size,
                       COLUMN_POINTER, node,
+                      COLUMN_HITS, (guint)item->cumulative,
                       -1);
 
   if (item->siblings != NULL)
@@ -974,7 +976,7 @@ append_to_tree_and_free (SysprofCallgraphView *self,
 
 static void
 sysprof_callgraph_view_update_descendants (SysprofCallgraphView *self,
-                                      StackNode       *node)
+                                           StackNode            *node)
 {
   SysprofCallgraphViewPrivate *priv = sysprof_callgraph_view_get_instance_private (self);
   GtkTreeStore *store;
@@ -984,11 +986,12 @@ sysprof_callgraph_view_update_descendants (SysprofCallgraphView *self,
   if (g_queue_peek_head (priv->history) != node)
     g_queue_push_head (priv->history, node);
 
-  store = gtk_tree_store_new (4,
+  store = gtk_tree_store_new (5,
                               G_TYPE_STRING,
                               G_TYPE_DOUBLE,
                               G_TYPE_DOUBLE,
-                              G_TYPE_POINTER);
+                              G_TYPE_POINTER,
+                              G_TYPE_UINT);
 
   if (priv->profile != NULL)
   {
diff --git a/src/libsysprof-ui/ui/sysprof-callgraph-view.ui b/src/libsysprof-ui/ui/sysprof-callgraph-view.ui
index f3164f7..e7ef948 100644
--- a/src/libsysprof-ui/ui/sysprof-callgraph-view.ui
+++ b/src/libsysprof-ui/ui/sysprof-callgraph-view.ui
@@ -183,6 +183,21 @@
                         </child>
                       </object>
                     </child>
+                    <child>
+                      <object class="GtkTreeViewColumn" id="function_hits_column">
+                        <property name="expand">false</property>
+                        <property name="sizing">fixed</property>
+                        <property name="title" translatable="yes">Hits</property>
+                        <child>
+                          <object class="GtkCellRendererText">
+                            <property name="xalign">1.0</property>
+                          </object>
+                          <attributes>
+                            <attribute name="text">4</attribute>
+                          </attributes>
+                        </child>
+                      </object>
+                    </child>
                   </object>
                 </child>
               </object>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]