mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-09 22:50:54 +00:00
libsysprof-profile: make timeout msec tweakable
We may want to tweak this as we discover we can either backoff or increase our timing intervals.
This commit is contained in:
@ -94,6 +94,7 @@ typedef struct _SysprofPerfEventSource
|
|||||||
{
|
{
|
||||||
GSource source;
|
GSource source;
|
||||||
SysprofPerfEventStream *stream;
|
SysprofPerfEventStream *stream;
|
||||||
|
int timeout_msec;
|
||||||
} SysprofPerfEventSource;
|
} SysprofPerfEventSource;
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
@ -237,7 +238,7 @@ sysprof_perf_event_source_prepare (GSource *gsource,
|
|||||||
SysprofPerfEventStream *self = source->stream;
|
SysprofPerfEventStream *self = source->stream;
|
||||||
|
|
||||||
if (timeout != NULL)
|
if (timeout != NULL)
|
||||||
*timeout = 5;
|
*timeout = source->timeout_msec;
|
||||||
|
|
||||||
return self != NULL &&
|
return self != NULL &&
|
||||||
self->active &&
|
self->active &&
|
||||||
@ -450,6 +451,7 @@ sysprof_perf_event_stream_new (GDBusConnection *connection,
|
|||||||
source = (SysprofPerfEventSource *)
|
source = (SysprofPerfEventSource *)
|
||||||
g_source_new (&source_funcs, sizeof (SysprofPerfEventSource));
|
g_source_new (&source_funcs, sizeof (SysprofPerfEventSource));
|
||||||
source->stream = self;
|
source->stream = self;
|
||||||
|
source->timeout_msec = 5;
|
||||||
self->source = (GSource *)source;
|
self->source = (GSource *)source;
|
||||||
|
|
||||||
g_source_set_callback (self->source, sysprof_perf_event_stream_dispatch, self, NULL);
|
g_source_set_callback (self->source, sysprof_perf_event_stream_dispatch, self, NULL);
|
||||||
|
|||||||
Reference in New Issue
Block a user