From 4ff3d534674bdced0d78f56738cfd21847b90d47 Mon Sep 17 00:00:00 2001 From: Søren Sandmann Pedersen Date: Tue, 9 Nov 2010 01:42:02 -0500 Subject: 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 b28964f..80604ff 100644 --- a/collector.c +++ b/collector.c @@ -428,7 +428,8 @@ counter_new (Collector *collector, attr.task = 1; attr.exclude_idle = 1; - if (!collector->use_hw_counters || (fd = sysprof_perf_counter_open (&attr, pid, 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; @@ -619,6 +620,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 20d3d2c..17efcce 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; -- cgit v1.2.3