libsysprof: implement various serialization hooks

This commit is contained in:
Christian Hergert
2019-05-23 18:09:42 -07:00
parent 7d6acdfc03
commit 404317d49d
3 changed files with 97 additions and 3 deletions

View File

@ -132,6 +132,31 @@ struct _SysprofSourceInterface
void (*modify_spawn) (SysprofSource *self,
GSubprocessLauncher *launcher,
GPtrArray *argv);
/**
* SysprofSource::serialize:
* @self: a #SysprofSource
* @keyfile: a #GKeyFile
* @group: the keyfile group to use
*
* Requests that the source serialize itself into the keyfile
* so that it may be replayed at a future point in time.
*/
void (*serialize) (SysprofSource *self,
GKeyFile *keyfile,
const gchar *group);
/**
* SysprofSource::deserialize:
* @self: a #SysprofSource
* @keyfile: a #GKeyFile
* @group: the keyfile group to use
*
* Deserialize from the saved state.
*/
void (*deserialize) (SysprofSource *self,
GKeyFile *keyfile,
const gchar *group);
};
SYSPROF_AVAILABLE_IN_ALL
@ -159,5 +184,13 @@ SYSPROF_AVAILABLE_IN_ALL
void sysprof_source_modify_spawn (SysprofSource *self,
GSubprocessLauncher *launcher,
GPtrArray *argv);
SYSPROF_AVAILABLE_IN_ALL
void sysprof_source_serialize (SysprofSource *self,
GKeyFile *keyfile,
const gchar *group);
SYSPROF_AVAILABLE_IN_ALL
void sysprof_source_deserialize (SysprofSource *self,
GKeyFile *keyfile,
const gchar *group);
G_END_DECLS