tools: set cwd when spawning with sysprof-cli

This commit is contained in:
Christian Hergert
2019-07-28 12:31:07 -07:00
parent 745f4c4168
commit 8c72bafff8
6 changed files with 68 additions and 2 deletions

View File

@ -102,6 +102,13 @@ sysprof_profiler_default_init (SysprofProfilerInterface *iface)
G_TYPE_STRV,
(G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
g_object_interface_install_property (iface,
g_param_spec_string ("spawn-cwd",
"Spawn Working Directory",
"The directory to spawn the application from",
NULL,
(G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
g_object_interface_install_property (iface,
g_param_spec_boxed ("spawn-env",
"Sysprofawn Environment",
@ -163,9 +170,17 @@ sysprof_profiler_get_spawn (SysprofProfiler *self)
return spawn;
}
void
sysprof_profiler_set_spawn_cwd (SysprofProfiler *self,
const gchar *spawn_cwd)
{
g_return_if_fail (SYSPROF_IS_PROFILER (self));
g_object_set (self, "spawn-cwd", spawn_cwd, NULL);
}
void
sysprof_profiler_set_spawn (SysprofProfiler *self,
gboolean spawn)
gboolean spawn)
{
g_return_if_fail (SYSPROF_IS_PROFILER (self));
g_object_set (self, "spawn", !!spawn, NULL);