mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
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:
14
collector.c
14
collector.c
@ -138,10 +138,10 @@ on_read (gpointer data)
|
||||
add_trace_to_stash (&trace, collector->stash);
|
||||
|
||||
collector->n_samples++;
|
||||
}
|
||||
|
||||
if (collector->callback)
|
||||
collector->callback (collector->data);
|
||||
if (collector->callback)
|
||||
collector->callback (collector->data);
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@ -205,7 +205,13 @@ collector_start (Collector *collector,
|
||||
void
|
||||
collector_stop (Collector *collector)
|
||||
{
|
||||
fd_set_read_callback (collector->fd, NULL);
|
||||
if (collector->fd >= 0)
|
||||
{
|
||||
fd_remove_watch (collector->fd);
|
||||
|
||||
close (collector->fd);
|
||||
collector->fd = -1;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user