mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-13 22:10:08 +00:00
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.
This commit is contained in:
parent
032bb45ce3
commit
9e40642335
@ -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 */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user