From 64a1ac635590748b2d155297a367a4f35adc8390 Mon Sep 17 00:00:00 2001 From: Soeren Sandmann Date: Sat, 12 Mar 2005 16:05:58 +0000 Subject: [PATCH] Fix small bug in add_timeout() More descriptive tree labels update Sat Mar 12 11:05:19 2005 Soeren Sandmann * sysprof-module.c: Fix small bug in add_timeout() * sysprof.c (build_gui): More descriptive tree labels * TODO: update --- ChangeLog | 6 ++++++ TODO | 3 +-- sfile.c | 1 + sfile.h | 7 +++++++ sysprof-module.c | 22 +++++++--------------- sysprof.c | 6 +++--- 6 files changed, 25 insertions(+), 20 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8447df77..f1be4851 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Sat Mar 12 11:05:19 2005 Soeren Sandmann + + * sysprof-module.c: Fix small bug in add_timeout() + * sysprof.c (build_gui): More descriptive tree labels + * TODO: update + Thu Mar 10 16:37:52 2005 Søren Sandmann * sysprof.c (build_gui): s/Cummulative/Cumulative/. Pointed out by diff --git a/TODO b/TODO index e303aceb..3e1c6ebe 100644 --- a/TODO +++ b/TODO @@ -1,6 +1,5 @@ - crashes when you ctrl-click the selected item in the top left pane ssp: looks like it doesn't handle the none-selected case - Better labels would be useful - consider caching [filename => bin_file] - Have kernel modulereport the file the symbol was found in @@ -8,7 +7,7 @@ - grep FIXME - hide internal stuff in ProfileDescendant - add an 'everything' object. It _is_ really needed for a lot of things - +- in timer, put process to sleep. Should get us more accurate data - loading and saving - make profile.c more agnostic to processes and functions etc. Ideally diff --git a/sfile.c b/sfile.c index 760eeb91..f75b400c 100644 --- a/sfile.c +++ b/sfile.c @@ -18,6 +18,7 @@ struct SFormat enum { + TYPE_UNDEFINED = 0, TYPE_POINTER, TYPE_STRING, TYPE_INTEGER, diff --git a/sfile.h b/sfile.h index 6a6e9368..72e39af8 100644 --- a/sfile.h +++ b/sfile.h @@ -19,6 +19,13 @@ typedef guint SType; * serializer_write_int (); * serializer_end_write (..., GError **err); * + * + * For formats consider: + * + * Format *format_new (void); + * void format_new_record (Format *f, Record *r); + * + * */ /* - Describing Types - */ diff --git a/sysprof-module.c b/sysprof-module.c index 67301f3e..940d54c8 100644 --- a/sysprof-module.c +++ b/sysprof-module.c @@ -42,7 +42,6 @@ static struct timer_list timer; static void init_timeout (void) { - timer.function = on_timer; init_timer(&timer); } @@ -56,6 +55,7 @@ static void add_timeout(unsigned int interval, TimeoutFunc f) { + timer.function = f; mod_timer(&timer, jiffies + INTERVAL); } @@ -79,7 +79,7 @@ init_userspace_reader (userspace_reader *reader, } /* This is mostly cutted and pasted from ptrace.c - * I removed some locking and other stuff though. I hope it + * I removed some locking and stuff though. I hope it * wasn't important. */ @@ -303,22 +303,14 @@ static void on_timer(unsigned long dong) { #if 0 - struct task_struct *p; -#endif - static const int cpu_profiler = 1; /* set to 0 to profile disk */ - if (current && current->pid != 0) { -#if 0 - - for_each_process (p) { - if (p->state == (cpu_profiler? TASK_RUNNING : TASK_UNINTERRUPTIBLE)) { + if (p->state == (cpu_profiler? TASK_RUNNING : TASK_UNINTERRUPTIBLE)) + ; #endif - queue_generate_stack_trace (current); -#if 0 - } -#endif - } + + if (current && current->pid != 0) + queue_generate_stack_trace (current); add_timeout (INTERVAL, on_timer); } diff --git a/sysprof.c b/sysprof.c index 2883d60c..3b215797 100644 --- a/sysprof.c +++ b/sysprof.c @@ -869,7 +869,7 @@ build_gui (Application *app) /* object view */ app->object_view = (GtkTreeView *)glade_xml_get_widget (xml, "object_view"); - col = add_plain_text_column (app->object_view, _("Name"), OBJECT_NAME); + col = add_plain_text_column (app->object_view, _("Functions"), OBJECT_NAME); add_double_format_column (app->object_view, _("Self"), OBJECT_SELF, "%.2f"); add_double_format_column (app->object_view, _("Total"), OBJECT_TOTAL, "%.2f"); selection = gtk_tree_view_get_selection (app->object_view); @@ -879,7 +879,7 @@ build_gui (Application *app) /* callers view */ app->callers_view = (GtkTreeView *)glade_xml_get_widget (xml, "callers_view"); - col = add_plain_text_column (app->callers_view, _("Name"), CALLERS_NAME); + col = add_plain_text_column (app->callers_view, _("Callers"), CALLERS_NAME); add_double_format_column (app->callers_view, _("Self"), CALLERS_SELF, "%.2f"); add_double_format_column (app->callers_view, _("Total"), CALLERS_TOTAL, "%.2f"); g_signal_connect (app->callers_view, "row-activated", @@ -889,7 +889,7 @@ build_gui (Application *app) /* descendants view */ app->descendants_view = (GtkTreeView *)glade_xml_get_widget (xml, "descendants_view"); - col = add_plain_text_column (app->descendants_view, _("Name"), DESCENDANTS_NAME); + col = add_plain_text_column (app->descendants_view, _("Descendants"), DESCENDANTS_NAME); add_double_format_column (app->descendants_view, _("Self"), DESCENDANTS_SELF, "%.2f"); add_double_format_column (app->descendants_view, _("Cumulative"), DESCENDANTS_NON_RECURSE, "%.2f"); g_signal_connect (app->descendants_view, "row-activated",