From 50c62b0804daa4e4ccc5ed45716a7de4901a6900 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Sandmann?= Date: Fri, 25 Mar 2005 00:12:37 +0000 Subject: [PATCH] Various GUI updates MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Thu Mar 24 19:09:33 2005 Søren Sandmann * sysprof.c: Various GUI updates * TODO: update * sfile.[ch] (sformat_new_optional): Add some notes about an "optional" construction. --- ChangeLog | 9 ++ TODO | 31 +++++-- sfile.c | 16 +++- sfile.h | 8 +- sysprof.c | 28 ++++-- sysprof.glade | 241 ++++++++++++++++++++++++++++++-------------------- 6 files changed, 219 insertions(+), 114 deletions(-) diff --git a/ChangeLog b/ChangeLog index 60b857a8..a379b757 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +Thu Mar 24 19:09:33 2005 Søren Sandmann + + * sysprof.c: Various GUI updates + + * TODO: update + + * sfile.[ch] (sformat_new_optional): Add some notes about an + "optional" construction. + Wed Mar 23 00:04:07 2005 Soeren Sandmann Primitive loading and saving. diff --git a/TODO b/TODO index 3e1c6ebe..92c19e48 100644 --- a/TODO +++ b/TODO @@ -1,13 +1,35 @@ +- Figure out what's needed before 1.0 + +- Consider adding KDE-style nested callgraph view + +- Find out what distributions it actually works on + +- Find out how to hack around gtk+ bug causing multiple double clicks + to get eaten. + +- hook up about box + +- hook up menu items view/start etc (or possibly get rid of them or move them) + - crashes when you ctrl-click the selected item in the top left pane ssp: looks like it doesn't handle the none-selected case +- Move "samples" label to the toolbar, then get rid of statusbar. + - consider caching [filename => bin_file] -- Have kernel modulereport the file the symbol was found in + +- Have kernel module report the file the address was found in Should avoid a lot of potential broken/raciness with dlopen etc. + - 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 + +- add an 'everything' object. It is really needed for a lot of things + +- kernel module should put process to sleep before sampling. Should get us + more accurate data + - loading and saving - make profile.c more agnostic to processes and functions etc. Ideally @@ -27,9 +49,6 @@ things that are UNINTERRUPTIBLE while there are RUNNING tasks is not consider bad. -- Make sure we don't overcharge when many processes are "RUNNING". We should - probably divide each sample with the number of runnable processes - DONE: - consider making ProfileObject more of an object. diff --git a/sfile.c b/sfile.c index 39e6090a..bf698c48 100644 --- a/sfile.c +++ b/sfile.c @@ -152,6 +152,18 @@ sformat_new (gpointer f) return sformat; } +#if 0 +SFormat * +sformat_new_optional (gpointer f) +{ + SFormat *sformat = g_new0 (SFormat, 1); + Fragment *fragment = f; + + sformat->begin = state_new (); + sformat->end = state_new (); +} +#endif + void sformat_free (SFormat *format) { @@ -657,7 +669,9 @@ static void hook_up_pointers (SFileInput *file) { int i; - + + /* FIXME: we need to check the types here */ + #if 0 g_print ("emfle\n"); #endif diff --git a/sfile.h b/sfile.h index 72e39af8..a7abec68 100644 --- a/sfile.h +++ b/sfile.h @@ -25,7 +25,13 @@ typedef guint SType; * Format *format_new (void); * void format_new_record (Format *f, Record *r); * - * + * + * Consider adding optional elements: + * + * sformat_new_optional (gpointer content) + * + * enums, optionals, selections, empties + * */ /* - Describing Types - */ diff --git a/sysprof.c b/sysprof.c index dc9e238c..4eb03c5c 100644 --- a/sysprof.c +++ b/sysprof.c @@ -35,7 +35,6 @@ struct Application GtkTreeView * object_view; GtkTreeView * callers_view; GtkTreeView * descendants_view; - GtkStatusbar * statusbar; GtkWidget * start_button; GtkWidget * profile_button; @@ -47,6 +46,7 @@ struct Application GtkWidget * profile_item; GtkWidget * open_item; GtkWidget * save_as_item; + GtkWidget * samples_label; Profile * profile; ProfileDescendant * descendants; @@ -90,7 +90,7 @@ show_samples_timeout (gpointer data) switch (app->state) { case INITIAL: - label = g_strdup (""); + label = g_strdup ("Samples: 0"); break; case PROFILING: @@ -98,9 +98,8 @@ show_samples_timeout (gpointer data) label = g_strdup_printf ("Samples: %d", app->n_samples); break; } - - gtk_statusbar_pop (app->statusbar, 0); - gtk_statusbar_push (app->statusbar, 0, label); + + gtk_label_set_label (GTK_LABEL (app->samples_label), label); g_free (label); @@ -123,6 +122,8 @@ update_sensitivity (Application *app) gboolean sensitive_save_as_button; gboolean sensitive_start_button; gboolean sensitive_tree_views; + gboolean sensitive_samples_label; + gboolean sensitive_reset_button; GtkWidget *active_radio_button; @@ -132,15 +133,19 @@ update_sensitivity (Application *app) sensitive_profile_button = FALSE; sensitive_save_as_button = FALSE; sensitive_start_button = TRUE; + sensitive_reset_button = FALSE; sensitive_tree_views = FALSE; + sensitive_samples_label = FALSE; active_radio_button = app->dummy_button; break; case PROFILING: sensitive_profile_button = (app->n_samples > 0); sensitive_save_as_button = (app->n_samples > 0); + sensitive_reset_button = (app->n_samples > 0); sensitive_start_button = TRUE; sensitive_tree_views = FALSE; + sensitive_samples_label = TRUE; active_radio_button = app->start_button; break; @@ -149,6 +154,8 @@ update_sensitivity (Application *app) sensitive_save_as_button = TRUE; sensitive_start_button = TRUE; sensitive_tree_views = TRUE; + sensitive_reset_button = TRUE; + sensitive_samples_label = FALSE; active_radio_button = app->profile_button; break; } @@ -162,11 +169,15 @@ update_sensitivity (Application *app) sensitive_save_as_button); gtk_widget_set_sensitive (GTK_WIDGET (app->start_button), - sensitive_start_button); - + sensitive_start_button); + + gtk_widget_set_sensitive (GTK_WIDGET (app->reset_button), + sensitive_reset_button); + gtk_widget_set_sensitive (GTK_WIDGET (app->object_view), sensitive_tree_views); gtk_widget_set_sensitive (GTK_WIDGET (app->callers_view), sensitive_tree_views); gtk_widget_set_sensitive (GTK_WIDGET (app->descendants_view), sensitive_tree_views); + gtk_widget_set_sensitive (GTK_WIDGET (app->samples_label), sensitive_samples_label); queue_show_samples (app); } @@ -896,6 +907,8 @@ build_gui (Application *app) g_signal_connect (G_OBJECT (app->save_as_button), "clicked", G_CALLBACK (on_save_as_clicked), app); + + app->samples_label = glade_xml_get_widget (xml, "samples_label"); gtk_widget_realize (GTK_WIDGET (main_window)); set_sizes (GTK_WINDOW (main_window), @@ -936,7 +949,6 @@ build_gui (Application *app) gtk_tree_view_column_set_expand (col, TRUE); /* Statusbar */ - app->statusbar = (GtkStatusbar *)glade_xml_get_widget (xml, "statusbar"); queue_show_samples (app); } diff --git a/sysprof.glade b/sysprof.glade index 7dbf4375..e0baec11 100644 --- a/sysprof.glade +++ b/sysprof.glade @@ -180,114 +180,171 @@ - + True - GTK_ORIENTATION_HORIZONTAL - GTK_TOOLBAR_BOTH_HORIZ - True - True + False + 0 - + True - S_tart - True - gtk-media-play - True - True - True - False - - - False - True - - - - - - True - _Profile - True - gtk-justify-left - True - True - True - False - start_button - - - False - True - - - - - - True - _Reset - True - gtk-clear - True - True - False - - - False - True - - - - - - True - True - True - False + GTK_ORIENTATION_HORIZONTAL + GTK_TOOLBAR_BOTH_HORIZ + True + True - + True - True + S_tart + True + gtk-media-play True True + True + False + + False + True + + + + + + True + _Profile + True + gtk-justify-left + True + True + True + False + start_button + + + False + True + + + + + + True + _Reset + True + gtk-clear + True + True + False + + + False + True + + + + + + True + True + True + False + + + + True + True + True + True + + + + + False + False + + + + + + True + gtk-save-as + True + True + True + + + False + True + + + + + + True + dummy + True + True + True + False + False + start_button + + + False + True + - False - False + 0 + True + True - + True - gtk-save-as - True - True - True - - - False - True - - + GTK_ORIENTATION_HORIZONTAL + GTK_TOOLBAR_BOTH_HORIZ + True + False - - - True - dummy - True - True - True - False - False - start_button + + + True + True + True + False + + + + True + Samples: 0 + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 6 + 0 + + + + + False + False + + + 0 False - True + True @@ -405,18 +462,6 @@ True - - - - True - True - - - 0 - False - False - - 0