Permalink
Browse files
gjs: enable GjsProfiler via SIGUSR2
- Loading branch information...
Showing
with
7 additions
and
0 deletions.
-
+7
−0
src/shell-global.c
|
|
@@ -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