diff --git a/ChangeLog b/ChangeLog index eb75e021..6f1f6666 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +Sat May 21 20:58:59 2005 Soeren Sandmann + + * TODO: update + + * sysprof.c (on_menu_item_activated): New function. + + * sysprof.c (build_gui): Hook up menu items. + + * module/sysprof-module.c (init_module): Remove module_init/exit + as they cause build failure on kernels < 2.6.11. + Sat May 21 00:59:38 2005 Søren Sandmann * TODO: update diff --git a/TODO b/TODO index 1ab7c080..d7e7d798 100644 --- a/TODO +++ b/TODO @@ -2,11 +2,6 @@ Before 0.9 * Get account on people.redhat.com -* Interface - - 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 - * Web page containing - Screen shots @@ -16,6 +11,9 @@ Before 0.9 - Contact info - Ask for sucess/failure reports +* Interface + - Consider expanding a few more levels of a new descendants tree + Before 1.0: * Build system @@ -45,9 +43,6 @@ Before 1.2: - Ability to generate "screenshots" suitable for mail/blog/etc - Fixing the oops in kernels < 2.6.11 - - Oops should be fixed in 1.0, but the stuff below may still - be worth thinking about. - - Make the process waiting in poll() responsible for extracting the backtrace. Give a copy of the entire stack rather than doing the walk inside the kernel. That would allow us to do more complex @@ -89,6 +84,32 @@ Before 1.2: This way, we will have a real userspace process that can take the page faults. + + - Different approach: + + pollable file where a regular userspace process + can read a pid. Any pid returned is guaranteed to be + UNINTERRUPTIBLE. Userspace process is required to + start it again when it is done with it. + + Also provide interface to read arbitrary memory of + that process. + + ptrace() could in principle do all this, but + unfortunately it sucks to continuously + ptrace() processes. + + - Yet another + + Userspace process can register itself as "profiler" + and pass in a filedescriptor where all sorts of + information is sent. + + - could tie lifetime of module to profiler + - could send "module going away" information + - Can we map filedescriptors to files in + a module? + - Find out how gdb does backtraces; they may have a better way. Also find out what dwarf2 is and how to use it. Look into libunwind. It seems gdb is capable of doing backtraces of code that neither has @@ -286,6 +307,8 @@ Later: DONE: +- hook up menu items view/start etc (or possibly get rid of them or + move them) - Should do as suggested in the automake manual in the chapter "when automake is not enough" - add an "insert-module" target diff --git a/module/sysprof-module.c b/module/sysprof-module.c index c8110987..f7857313 100644 --- a/module/sysprof-module.c +++ b/module/sysprof-module.c @@ -425,5 +425,3 @@ cleanup_module(void) remove_proc_entry("sysprof-trace", &proc_root); } -module_init (init_module); -module_exit (cleanup_module); diff --git a/sysprof.c b/sysprof.c index 6e933c9a..85a5828c 100644 --- a/sysprof.c +++ b/sysprof.c @@ -494,11 +494,20 @@ load_module (void) return (exit_status == 0); } +static void +on_menu_item_activated (GtkWidget *menu_item, GtkWidget *tool_button) +{ + GtkToggleToolButton *button = GTK_TOGGLE_TOOL_BUTTON (tool_button); + + if (!gtk_toggle_tool_button_get_active (button)) + gtk_toggle_tool_button_set_active (button, TRUE); +} + static void on_start_toggled (GtkWidget *widget, gpointer data) { Application *app = data; - + if (!gtk_toggle_tool_button_get_active ( GTK_TOGGLE_TOOL_BUTTON (app->start_button))) return; @@ -842,7 +851,7 @@ static void on_profile_toggled (GtkWidget *widget, gpointer data) { Application *app = data; - + if (gtk_toggle_tool_button_get_active (GTK_TOGGLE_TOOL_BUTTON (app->profile_button))) { set_busy (app->main_window, TRUE); @@ -1249,41 +1258,10 @@ build_gui (Application *app) g_signal_connect (G_OBJECT (app->main_window), "delete_event", G_CALLBACK (on_delete), NULL); - /* Menu items */ - app->start_item = glade_xml_get_widget (xml, "start_item"); - app->profile_item = glade_xml_get_widget (xml, "profile_item"); - app->reset_item = glade_xml_get_widget (xml, "reset_item"); - app->open_item = glade_xml_get_widget (xml, "open_item"); - app->save_as_item = glade_xml_get_widget (xml, "save_as_item"); - - g_assert (app->start_item); - g_assert (app->profile_item); - g_assert (app->save_as_item); - g_assert (app->open_item); - -#if 0 - g_signal_connect (G_OBJECT (app->start_item), "activate", - G_CALLBACK (toggle_start_button), app); - - g_signal_connect (G_OBJECT (app->profile_item), "activate", - G_CALLBACK (on_profile_toggled), app); - - g_signal_connect (G_OBJECT (app->reset_item), "activate", - G_CALLBACK (on_reset_clicked), app); -#endif - - g_signal_connect (G_OBJECT (app->open_item), "activate", - G_CALLBACK (on_open_clicked), app); - - g_signal_connect (G_OBJECT (app->save_as_item), "activate", - G_CALLBACK (on_save_as_clicked), app); - - /* quit */ - g_signal_connect (G_OBJECT (glade_xml_get_widget (xml, "quit")), "activate", - G_CALLBACK (on_delete), NULL); - - g_signal_connect (G_OBJECT (glade_xml_get_widget (xml, "about")), "activate", - G_CALLBACK (on_about_activated), app); + gtk_widget_realize (GTK_WIDGET (app->main_window)); + set_sizes (GTK_WINDOW (app->main_window), + glade_xml_get_widget (xml, "hpaned"), + glade_xml_get_widget (xml, "vpaned")); /* Tool items */ @@ -1307,14 +1285,42 @@ 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 (app->main_window)); - set_sizes (GTK_WINDOW (app->main_window), - glade_xml_get_widget (xml, "hpaned"), - glade_xml_get_widget (xml, "vpaned")); + /* Menu items */ + app->start_item = glade_xml_get_widget (xml, "start_item"); + app->profile_item = glade_xml_get_widget (xml, "profile_item"); + app->reset_item = glade_xml_get_widget (xml, "reset_item"); + app->open_item = glade_xml_get_widget (xml, "open_item"); + app->save_as_item = glade_xml_get_widget (xml, "save_as_item"); + g_assert (app->start_item); + g_assert (app->profile_item); + g_assert (app->save_as_item); + g_assert (app->open_item); + + g_signal_connect (G_OBJECT (app->start_item), "activate", + G_CALLBACK (on_menu_item_activated), app->start_button); + + g_signal_connect (G_OBJECT (app->profile_item), "activate", + G_CALLBACK (on_menu_item_activated), app->profile_button); + + g_signal_connect (G_OBJECT (app->reset_item), "activate", + G_CALLBACK (on_reset_clicked), app); + + g_signal_connect (G_OBJECT (app->open_item), "activate", + G_CALLBACK (on_open_clicked), app); + + g_signal_connect (G_OBJECT (app->save_as_item), "activate", + G_CALLBACK (on_save_as_clicked), app); + + g_signal_connect (G_OBJECT (glade_xml_get_widget (xml, "quit")), "activate", + G_CALLBACK (on_delete), NULL); + + g_signal_connect (G_OBJECT (glade_xml_get_widget (xml, "about")), "activate", + G_CALLBACK (on_about_activated), app); /* TreeViews */