diff --git a/src/sysprof-cli/sysprof-cli.c b/src/sysprof-cli/sysprof-cli.c index 1fd274fc..009b044c 100644 --- a/src/sysprof-cli/sysprof-cli.c +++ b/src/sysprof-cli/sysprof-cli.c @@ -509,7 +509,10 @@ Examples:\n\ sysprof_profiler_set_spawnable (profiler, spawnable); if (gjs) - add_trace_fd (profiler, spawnable, "GJS_TRACE_FD"); + { + sysprof_spawnable_setenv (spawnable, "GJS_ENABLE_PROFILER", "1"); + add_trace_fd (profiler, spawnable, "GJS_TRACE_FD"); + } if (use_trace_fd) add_trace_fd (profiler, spawnable, NULL); diff --git a/src/sysprof/sysprof-recording-template.c b/src/sysprof/sysprof-recording-template.c index 965cce13..50f6c957 100644 --- a/src/sysprof/sysprof-recording-template.c +++ b/src/sysprof/sysprof-recording-template.c @@ -557,7 +557,10 @@ sysprof_recording_template_apply (SysprofRecordingTemplate *self, sysprof_profiler_set_spawnable (profiler, spawnable); if (self->javascript_stacks) - add_trace_fd (profiler, spawnable, "GJS_TRACE_FD"); + { + sysprof_spawnable_setenv (spawnable, "GJS_ENABLE_PROFILER", "1"); + add_trace_fd (profiler, spawnable, "GJS_TRACE_FD"); + } } if (self->power_profile && self->power_profile[0])