From 32690091ef59df4e382a1326e9f4e4c0f935c8b2 Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Wed, 14 Aug 2024 14:38:06 -0700 Subject: [PATCH] sysprof-cli: set GJS_ENABLE_PROFILER --- src/sysprof-cli/sysprof-cli.c | 5 ++++- src/sysprof/sysprof-recording-template.c | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) 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])