[sysprof/newui: 5/24] Put everything in one big tree



commit 7b00f7c029fcd477ec9de6eacdda4aabc1147c2e
Author: SÃren Sandmann Pedersen <sandmann daimi au dk>
Date:   Tue Nov 9 01:42:02 2010 -0500

    Put everything in one big tree

 collector.c |    5 ++++-
 sysprof.c   |   25 ++++++++++++++++---------
 2 files changed, 20 insertions(+), 10 deletions(-)
---
diff --git a/collector.c b/collector.c
index 86d96ed..9cbedf5 100644
--- a/collector.c
+++ b/collector.c
@@ -427,7 +427,8 @@ counter_new (Collector  *collector,
     attr.task = 1;
     attr.exclude_idle = 1;
     
-    if (!collector->use_hw_counters || (fd = sysprof_perf_counter_open (&attr, -1, cpu, -1,  0)) < 0)
+    if (!collector->use_hw_counters ||
+	(fd = sysprof_perf_counter_open (&attr, -1, cpu, -1,  0)) < 0)
     {
 	attr.type = PERF_TYPE_SOFTWARE;
 	attr.config = PERF_COUNT_SW_CPU_CLOCK;
@@ -618,6 +619,8 @@ process_sample (Collector      *collector,
     {
 	uint64_t trace[3];
 
+	printf ("sample\n");
+	
 	if (sample->header.misc & PERF_EVENT_MISC_KERNEL)
 	{
 	    trace[0] = PERF_CONTEXT_KERNEL;
diff --git a/sysprof.c b/sysprof.c
index 55f1b09..1016261 100644
--- a/sysprof.c
+++ b/sysprof.c
@@ -522,13 +522,20 @@ fill_descendants_tree (Application *app)
 
     if (app->profile)
     {
-	char *object = get_current_object (app);
-	if (object)
+	GList *objects = profile_get_objects (app->profile);
+	GList *list;
+
+	for (list = objects; list != NULL; list = list->next)
 	{
-	    app->descendants =
-		profile_create_descendants (app->profile, object);
-	    add_node (tree_store,
-		      profile_get_size (app->profile), NULL, app->descendants);
+	    ProfileObject *object = list->data;
+
+	    if (object->name)
+	    {
+		ProfileDescendant *node =
+		    profile_create_descendants (app->profile, object->name);
+		add_node (tree_store,
+			  profile_get_size (app->profile), NULL, node);
+	    }
 	}
     }
 
@@ -1321,8 +1328,8 @@ set_sizes (GtkWindow *window,
 
     gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor);
 
-    width = monitor.width * 3 / 4;
-    height = monitor.height * 3 / 4;
+    width = 5 * (monitor.width / 13);
+    height = 0.9 * monitor.height;
 
     gtk_window_resize (window, width, height);
 
@@ -1589,7 +1596,7 @@ application_new (void)
 {
     Application *app = g_new0 (Application, 1);
 
-    app->collector = collector_new (FALSE, on_new_sample, app);
+    app->collector = collector_new (TRUE, on_new_sample, app);
     app->state = INITIAL;
 
     return app;



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