mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-09 14:40:54 +00:00
libsysprof-profile: create recording and start it
This commit is contained in:
@ -21,6 +21,7 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#include "sysprof-profiler.h"
|
#include "sysprof-profiler.h"
|
||||||
|
#include "sysprof-recording-private.h"
|
||||||
|
|
||||||
struct _SysprofProfiler
|
struct _SysprofProfiler
|
||||||
{
|
{
|
||||||
@ -106,6 +107,7 @@ sysprof_profiler_record_async (SysprofProfiler *self,
|
|||||||
GAsyncReadyCallback callback,
|
GAsyncReadyCallback callback,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
|
g_autoptr(SysprofRecording) recording = NULL;
|
||||||
g_autoptr(GTask) task = NULL;
|
g_autoptr(GTask) task = NULL;
|
||||||
|
|
||||||
g_return_if_fail (SYSPROF_IS_PROFILER (self));
|
g_return_if_fail (SYSPROF_IS_PROFILER (self));
|
||||||
@ -115,7 +117,13 @@ sysprof_profiler_record_async (SysprofProfiler *self,
|
|||||||
task = g_task_new (self, cancellable, callback, user_data);
|
task = g_task_new (self, cancellable, callback, user_data);
|
||||||
g_task_set_source_tag (task, sysprof_profiler_record_async);
|
g_task_set_source_tag (task, sysprof_profiler_record_async);
|
||||||
|
|
||||||
|
recording = _sysprof_recording_new (writer,
|
||||||
|
(SysprofInstrument **)self->instruments->pdata,
|
||||||
|
self->instruments->len);
|
||||||
|
|
||||||
|
g_task_return_pointer (task, g_object_ref (recording), g_object_unref);
|
||||||
|
|
||||||
|
_sysprof_recording_start (recording);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user