Permalink
Browse files

gjs: enable GjsProfiler via SIGUSR2

  • Loading branch information...
1 parent 2edfd45 commit e030ab2496ab36eae778bf3b883fd73817658642 @chergert committed Apr 13, 2016
Showing with 7 additions and 0 deletions.
  1. +7 −0 src/shell-global.c
View
@@ -23,6 +23,7 @@
#include <gdk/gdkx.h>
#include <gio/gio.h>
#include <girepository.h>
+#include <gjs/profiler.h>
#include <meta/display.h>
#include <meta/util.h>
#include <meta/meta-shaped-texture.h>
@@ -70,6 +71,7 @@ struct _ShellGlobal {
XserverRegion input_region;
GjsContext *js_context;
+ GjsProfiler *js_profiler;
MetaPlugin *plugin;
ShellWM *wm;
GSettings *settings;
@@ -330,6 +332,10 @@ shell_global_init (ShellGlobal *global)
"search-path", search_path,
NULL);
+ /* Allow toggling of profiling via SIGUSR2 */
+ global->js_profiler = gjs_profiler_new (global->js_context);
+ gjs_profiler_setup_signals ();
+
g_strfreev (search_path);
}
@@ -338,6 +344,7 @@ shell_global_finalize (GObject *object)
{
ShellGlobal *global = SHELL_GLOBAL (object);
+ g_clear_pointer (&global->js_profiler, gjs_profiler_free);
g_object_unref (global->js_context);
g_object_unref (global->settings);

0 comments on commit e030ab2

Please sign in to comment.