libsysprof: abstract subprocess usage

For embedding cases, we need a bit more control here so that the
application can be in control of how the process is spawned.
This commit is contained in:
Christian Hergert
2019-06-11 18:47:07 -07:00
parent 19c2791198
commit e97490be16
9 changed files with 400 additions and 49 deletions

View File

@ -25,8 +25,9 @@
#endif
#include <gio/gio.h>
#include <sysprof-capture.h>
#include "sysprof-capture-writer.h"
#include "sysprof-spawnable.h"
G_BEGIN_DECLS
@ -123,15 +124,13 @@ struct _SysprofSourceInterface
/**
* SysprofSource::modify-spawn:
* @self: a #SysprofSource
* @launcher: a #GSubprocessLauncher
* @argv: (element-type utf8): arguments for spawning
* @spawnable: a #SysprofSpawnable
*
* Allows the source to modify the launcher or argv before the
* process is spawned.
*/
void (*modify_spawn) (SysprofSource *self,
GSubprocessLauncher *launcher,
GPtrArray *argv);
void (*modify_spawn) (SysprofSource *self,
SysprofSpawnable *spawnable);
/**
* SysprofSource::supplement:
@ -196,8 +195,7 @@ SYSPROF_AVAILABLE_IN_ALL
void sysprof_source_stop (SysprofSource *self);
SYSPROF_AVAILABLE_IN_ALL
void sysprof_source_modify_spawn (SysprofSource *self,
GSubprocessLauncher *launcher,
GPtrArray *argv);
SysprofSpawnable *spawnable);
SYSPROF_AVAILABLE_IN_ALL
void sysprof_source_serialize (SysprofSource *self,
GKeyFile *keyfile,