[gtk/tracing: 1411/1416] Add a way to start the profiler
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/tracing: 1411/1416] Add a way to start the profiler
- Date: Mon, 6 May 2019 20:22:19 +0000 (UTC)
commit 760fc0fc86ab8886b660b54b21fda8c206e3d3b2
Author: Matthias Clasen <mclasen redhat com>
Date: Sat May 19 19:42:11 2018 +0100
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.
gdk/gdk.c | 6 ++++++
1 file changed, 6 insertions(+)
---
diff --git a/gdk/gdk.c b/gdk/gdk.c
index 29acab5415..be0db366f2 100644
--- a/gdk/gdk.c
+++ b/gdk/gdk.c
@@ -26,6 +26,7 @@
#include "gdkversionmacros.h"
+#include "gdkprofiler.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 */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]