diff options
author | Matthias Clasen <mclasen@redhat.com> | 2018-05-19 19:42:11 +0100 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2019-05-07 09:37:59 -0700 |
commit | 9e40642335e5b0b0b5eb676d79a914fcc951e6af (patch) | |
tree | 07691eac3b4d852c24645b5b6ab2eaf22de2f00f /gdk/gdk.c | |
parent | 032bb45ce3fa91b7c0d6b8b76334756b036cecd5 (diff) | |
download | gtk+-9e40642335e5b0b0b5eb676d79a914fcc951e6af.tar.gz |
Add a way to start the profiler
If SYSPROF_TRACE_FD is set in the environment,
interpret it as an fd to write profiling data
to.
If GTK_TRACE is set, write profiling data
to a file with name gtk.$PID.syscap.
Diffstat (limited to 'gdk/gdk.c')
-rw-r--r-- | gdk/gdk.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -26,6 +26,7 @@ #include "gdkversionmacros.h" +#include "gdkprofilerprivate.h" #include "gdkinternals.h" #include "gdkintl.h" @@ -211,6 +212,11 @@ gdk_pre_parse (void) _gdk_debug_flags = g_parse_debug_string (debug_string, (GDebugKey *) gdk_debug_keys, G_N_ELEMENTS (gdk_debug_keys)); + + if (g_getenv ("SYSPROF_TRACE_FD")) + gdk_profiler_start (atoi (g_getenv ("SYSPROF_TRACE_FD"))); + else if (g_getenv ("GTK_TRACE")) + gdk_profiler_start (-1); } #endif /* G_ENABLE_DEBUG */ |