Sun Nov 6 Soeren Sandmann <sandmann@redhat.com>

Sun Nov  6  Soeren Sandmann  <sandmann@redhat.com>

        * TODO: updates

        * collector.c (on_read): Only call back when a new sample actually
        arrived.

        * collector.c (collector_stop): close the filedescriptor

        * sysprof.c (on_start_toggled): Change sense of test.

        * sysprof.c (ensure_profile): Stop the collector.

        * sysprof.c (on_reset_clicked): Stop the collector when state
        becomes INITIAL.
This commit is contained in:
Søren Sandmann Pedersen
2005-11-07 02:27:55 +00:00
parent 64b2627c4a
commit fe5dd1e1fa
4 changed files with 58 additions and 24 deletions

View File

@ -342,9 +342,15 @@ on_start_toggled (GtkWidget *widget, gpointer data)
return;
}
/* FIXME: get the real error message */
if (!collector_start (app->collector, NULL))
if (collector_start (app->collector, NULL))
{
delete_data (app);
app->state = PROFILING;
}
else
{
/* FIXME: get the real error message */
sorry (app->main_window,
"Can't open /proc/sysprof-trace. You need to insert\n"
"the sysprof kernel module. Run\n"
@ -353,12 +359,6 @@ on_start_toggled (GtkWidget *widget, gpointer data)
"\n"
"as root.");
}
else
{
delete_data (app);
app->state = PROFILING;
}
update_sensitivity (app);
}
@ -639,6 +639,8 @@ ensure_profile (Application *app)
app->profile = collector_create_profile (app->collector);
collector_stop (app->collector);
fill_lists (app);
app->state = DISPLAYING;
@ -689,7 +691,10 @@ on_reset_clicked (gpointer widget, gpointer data)
delete_data (app);
if (app->state == DISPLAYING)
{
app->state = INITIAL;
collector_stop (app->collector);
}
update_sensitivity (app);
@ -818,6 +823,8 @@ set_loaded_profile (Application *app,
update_sensitivity (app);
collector_stop (app->collector);
set_busy (app->main_window, FALSE);
}