From 4a4a5fc5cae8d3ff1df827eb1cd96f9938f3bf11 Mon Sep 17 00:00:00 2001 From: Soeren Sandmann Date: Mon, 4 Apr 2005 06:19:16 +0000 Subject: [PATCH] Busy cursors in many more places. Mon Apr 4 00:57:11 2005 Soeren Sandmann * sysprof.c: Busy cursors in many more places. * TODO: updates --- ChangeLog | 6 ++++++ TODO | 62 +++++++++++++++++++++++++++++++++---------------------- sysprof.c | 45 +++++++++++++++++++++++++++++++--------- 3 files changed, 78 insertions(+), 35 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1bab9ad1..65ba1fbc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Mon Apr 4 00:57:11 2005 Soeren Sandmann + + * sysprof.c: Busy cursors in many more places. + + * TODO: updates + Sun Apr 3 23:28:45 2005 Soeren Sandmann * sysprof-module.c (do_generate): Re-schedule the timeout here diff --git a/TODO b/TODO index 6f4e794e..be949f45 100644 --- a/TODO +++ b/TODO @@ -1,27 +1,29 @@ Before 1.0: -- grep FIXME -- When the module is unloaded, kill all processes blocking in read -- Need to make "make install" work (how do you know where to install - kernel modules?) -- Find out what distributions it actually works on - (ask for sucess stories in 0.9.x releases) -- hook up about box -- Need an icon -- Add busy cursors, - - when you hit "Profile" - - when you click something in the main list and we don't respond - within 50ms (or perhaps when we expect to not be able to do - so (can we know the size in advance?)) -- Sould just install the kernel module if it running as root, pop up - a dialog if not. Note we must be able to start without module now, since - it is useful to just load profiles from disk. -- hook up menu items view/start etc (or possibly get rid of them or move - them) -- give profiles on the command line -- auto*? -- .desktop file -- Consider expanding a few more levels of a new descendants tree +* Correctness + - grep FIXME + - When the module is unloaded, kill all processes blocking in read + +* Interface + - hook up about box + - Need an icon + - If the current profile has a name, display it in the title bar + - Sould just install the kernel module if it running as root, pop up + a dialog if not. Note we must be able to start without module now, + since it is useful to just load profiles from disk. + - hook up menu items view/start etc (or possibly get rid of them or + move them) + - Consider expanding a few more levels of a new descendants tree + - give profiles on the command line + +* Build system + - Need to make "make install" work (how do you know where to install + kernel modules?) + - Find out what distributions it actually works on + (ask for sucess/failure-stories in 0.9.x releases) + - auto*? + - .desktop file + - translations Before 1.2: @@ -48,6 +50,10 @@ Before 1.2: - Charge 'self' properly to processes that don't get any stack trace at all (probably we get that for free with stackstash reorganisation) +- support more than one reader of the samples properly + - Don't generate them if noone cares + - When not profiling, sysprof shouldn't care + - Add ability to show more than one function at a time. Algorithm: Find all relevant nodes; For each relevant node @@ -80,13 +86,13 @@ Before 1.2: dump the data to a network socket. Should be able to react to eg. SIGUSR1 by dumping the data. +- Figure out how Google's pprof script works. Then add real call graph + drawing. (google's script is really simple; uses dot from graphviz). + - hide internal stuff in ProfileDescendant Later: -- Figure out how Google's pprof script works. Then add real call graph - drawing. - - Find out how to hack around gtk+ bug causing multiple double clicks to get eaten. @@ -151,6 +157,12 @@ Later: DONE: +- Add busy cursors, + - when you hit "Profile" + - when you click something in the main list and we don't respond + within 50ms (or perhaps when we expect to not be able to do + so (can we know the size in advance?)) + - kernel module should put process to sleep before sampling. Should get us more accurate data diff --git a/sysprof.c b/sysprof.c index af288a10..7e07950e 100644 --- a/sysprof.c +++ b/sysprof.c @@ -190,7 +190,7 @@ update_sensitivity (Application *app) } static void -set_busy (Application *app, gboolean busy) +set_busy (GtkWidget *widget, gboolean busy) { GdkCursor *cursor; @@ -199,7 +199,7 @@ set_busy (Application *app, gboolean busy) else cursor = NULL; - gdk_window_set_cursor (app->main_window->window, cursor); + gdk_window_set_cursor (widget->window, cursor); if (cursor) gdk_cursor_unref (cursor); @@ -682,7 +682,7 @@ on_profile_toggled (GtkWidget *widget, gpointer data) if (gtk_toggle_tool_button_get_active (GTK_TOGGLE_TOOL_BUTTON (app->profile_button))) { - set_busy (app, TRUE); + set_busy (app->main_window, TRUE); if (app->profile && !app->profile_from_file) { profile_free (app->profile); @@ -690,7 +690,7 @@ on_profile_toggled (GtkWidget *widget, gpointer data) } ensure_profile (app); - set_busy (app, FALSE); + set_busy (app->main_window, FALSE); } } @@ -723,6 +723,8 @@ static void on_reset_clicked (gpointer widget, gpointer data) { Application *app = data; + + set_busy (app->main_window, TRUE); delete_data (app); @@ -730,6 +732,8 @@ on_reset_clicked (gpointer widget, gpointer data) app->state = INITIAL; update_sensitivity (app); + + set_busy (app->main_window, FALSE); } static gboolean @@ -783,6 +787,8 @@ on_save_as_clicked (gpointer widget, gpointer data) ensure_profile (app); + set_busy (app->main_window, TRUE); + dialog = gtk_file_chooser_dialog_new ("Save As", GTK_WINDOW (app->main_window), GTK_FILE_CHOOSER_ACTION_SAVE, @@ -793,6 +799,8 @@ on_save_as_clicked (gpointer widget, gpointer data) gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_ACCEPT); gtk_window_set_modal (GTK_WINDOW (dialog), TRUE); + set_busy (app->main_window, FALSE); + retry: if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT) { @@ -808,15 +816,17 @@ on_save_as_clicked (gpointer widget, gpointer data) goto retry; } + set_busy (dialog, TRUE); if (!profile_save (app->profile, filename, &err)) { sorry (app->main_window, "Could not save %s: %s", filename, err->message); - + + set_busy (dialog, FALSE); g_free (filename); goto retry; } - + set_busy (dialog, FALSE); g_free (filename); } @@ -829,6 +839,8 @@ on_open_clicked (gpointer widget, gpointer data) Application *app = data; Profile *profile = NULL; GtkWidget *dialog; + + set_busy (app->main_window, TRUE); dialog = gtk_file_chooser_dialog_new ("Open", GTK_WINDOW (app->main_window), @@ -838,6 +850,8 @@ on_open_clicked (gpointer widget, gpointer data) NULL); gtk_window_set_modal (GTK_WINDOW (dialog), TRUE); + + set_busy (app->main_window, FALSE); retry: if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT) @@ -846,10 +860,15 @@ on_open_clicked (gpointer widget, gpointer data) gchar *filename; filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog)); + + set_busy (dialog, TRUE); + profile = profile_load (filename, &err); if (!profile) { + set_busy (dialog, FALSE); + sorry (app->main_window, "Could not open %s: %s", filename, err->message); @@ -857,10 +876,14 @@ on_open_clicked (gpointer widget, gpointer data) goto retry; } + set_busy (dialog, FALSE); + g_free (filename); } gtk_widget_destroy (dialog); + + set_busy (app->main_window, TRUE); if (profile) { @@ -872,11 +895,13 @@ on_open_clicked (gpointer widget, gpointer data) app->profile = profile; app->profile_from_file = TRUE; - + fill_lists (app); - + update_sensitivity (app); } + + set_busy (app->main_window, FALSE); } static void @@ -891,7 +916,7 @@ on_object_selection_changed (GtkTreeSelection *selection, gpointer data) Application *app = data; GtkTreePath *path; - set_busy (app, TRUE); + set_busy (app->main_window, TRUE); gdk_window_process_all_updates (); @@ -906,7 +931,7 @@ on_object_selection_changed (GtkTreeSelection *selection, gpointer data) GTK_TREE_VIEW (app->descendants_view), path, FALSE); gtk_tree_path_free (path); - set_busy (app, FALSE); + set_busy (app->main_window, FALSE); } static void