Sat Mar 26 11:26:00 2005  Soeren Sandmann  <sandmann@redhat.com>

	* TODO: Updates

	* sfile.c (add_string): Use g_markup_escape_text() to escape the
	string before adding it to the file.

	* sysprof.c (empty_file_descriptor): New function to make sure
	samples generated before profiling started are ignored.
	(set_busy): New commented out function to set a busy cursor.
This commit is contained in:
Soeren Sandmann
2005-03-26 16:34:11 +00:00
committed by Søren Sandmann Pedersen
parent 1787419687
commit cc25479579
4 changed files with 107 additions and 28 deletions

View File

@ -1,3 +1,14 @@
Sat Mar 26 11:26:00 2005 Soeren Sandmann <sandmann@redhat.com>
* TODO: Updates
* sfile.c (add_string): Use g_markup_escape_text() to escape the
string before adding it to the file.
* sysprof.c (empty_file_descriptor): New function to make sure
samples generated before profiling started are ignored.
(set_busy): New commented out function to set a busy cursor.
Fri Mar 25 21:31:08 2005 Søren Sandmann <sandmann@redhat.com>
* sysprof.c (update_sensitivity): Comment out sensitivity of reset button.

44
TODO
View File

@ -25,20 +25,43 @@
- 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?))
- 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?))
- Need to make "make install" work (how do you know where to install kernel modules?)
- Need to make "make install" work (how do you know where to install
kernel modules?)
- Sould just install the kernel module if it running as root, pop up a dialog if not.
- Sould just install the kernel module if it running as root, pop up
a dialog if not.
- hook up menu items view/start etc (or possibly get rid of them or move them)
- Reorganise stackstash and profile
- Move "samples" label to the toolbar, then get rid of statusbar.
- stackstash should just take traces of addresses without knowing
anything about what those addresses mean
- stacktraces should then begin with a process
- profile should take traces of pointers to presentation
objects without knowing anything about these presentation
objects.
- Creating a profile is then
- For each stack node, compute a presentation object
(probably need to export opaque stacknode objects
with set/get_user_data)
- Send each stack trace to the profile module, along with
presentation objects
- hook up menu items view/start etc (or possibly get rid of them or move
them)
- consider caching [filename => bin_file]
- Make sure samples label shows correct nunber after Open
- Have kernel module report the file the address was found in
Should avoid a lot of potential broken/raciness with dlopen etc.
@ -68,8 +91,15 @@
things that are UNINTERRUPTIBLE while there are RUNNING tasks is not
consider bad.
- Make things faster
- Can I get it to profile itself?
- speedprof seems to report that lots of time is spent in
stack_stash_foreach() and also in generate_key()
DONE:
- Move "samples" label to the toolbar, then get rid of statusbar.
- crashes when you ctrl-click the selected item in the top left pane
<ian__> ssp: looks like it doesn't handle the none-selected case

22
sfile.c
View File

@ -1369,27 +1369,11 @@ add_integer (GString *output, int value)
static void
add_string (GString *output, const char *str)
{
#if 0
/* FIXME: strings need to be encoded so that special
* xml characters can be added, and so they don't get
* confused with the deletion of whitespace-only
* text entries
*/
g_string_append_printf (output, "%s", str);
#endif
int i;
char *escaped = g_markup_escape_text (str, -1);
g_string_append_c (output, '\"');
for (i = 0; str[i] != '\0'; ++i)
{
if (str[i] == '\"')
g_string_append_printf (output, "%s", "\\\"");
else if (str[i] == '\\')
g_string_append_printf (output, "\\\\");
else
g_string_append_c (output, str[i]);
}
g_string_append (output, escaped);
g_string_append_c (output, '\"');
g_free (escaped);
}
static void

View File

@ -189,6 +189,24 @@ update_sensitivity (Application *app)
queue_show_samples (app);
}
#if 0
static void
set_busy (Application *app, gboolean busy)
{
GdkCursor *cursor;
if (busy)
cursor = gdk_cursor_new (GDK_WATCH);
else
cursor = NULL;
gdk_window_set_cursor (app->main_window->window, cursor);
if (cursor)
gdk_cursor_unref (cursor);
}
#endif
#if 0
static gchar *
get_name (pid_t pid)
@ -327,6 +345,36 @@ delete_data (Application *app)
app->profile_from_file = FALSE;
}
static void
empty_file_descriptor (Application *app)
{
int rd;
SysprofStackTrace trace;
do
{
rd = read (app->input_fd, &trace, sizeof (trace));
} while (rd != -1); /* until EWOULDBLOCK */
}
static gboolean
start_profiling (gpointer data)
{
Application *app = data;
app->state = PROFILING;
update_sensitivity (app);
/* Make sure samples generated between 'start clicked' and now
* are deleted
*/
empty_file_descriptor (app);
return FALSE;
}
static void
on_start_toggled (GtkWidget *widget, gpointer data)
{
@ -337,8 +385,8 @@ on_start_toggled (GtkWidget *widget, gpointer data)
return;
delete_data (app);
app->state = PROFILING;
update_sensitivity (app);
g_idle_add_full (G_PRIORITY_LOW, start_profiling, app, NULL);
}
enum
@ -446,6 +494,9 @@ on_profile_toggled (GtkWidget *widget, gpointer data)
if (gtk_toggle_tool_button_get_active (GTK_TOGGLE_TOOL_BUTTON (app->profile_button)))
{
#if 0
set_busy (app, TRUE);
#endif
if (app->profile && !app->profile_from_file)
{
profile_free (app->profile);
@ -453,6 +504,9 @@ on_profile_toggled (GtkWidget *widget, gpointer data)
}
ensure_profile (app);
#if 0
set_busy (app, FALSE);
#endif
}
}