mirror of
https://github.com/brl/mutter.git
synced 2025-06-13 16:59:30 +00:00
context: Start persistent profiling via command line argument
Persistent profiling was started via an env var, but that's rather hard to discover and remember without grepping; change to use a command line argument. The profiler is started early, even during (though late in) configuration, but configuration should ideally be instant and pointless to configure. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2998>
This commit is contained in:
@ -73,6 +73,7 @@ typedef struct _MetaContextMainOptions
|
||||
#ifdef HAVE_NATIVE_BACKEND
|
||||
GList *virtual_monitor_infos;
|
||||
#endif
|
||||
char *trace_file;
|
||||
} MetaContextMainOptions;
|
||||
|
||||
struct _MetaContextMain
|
||||
@ -298,6 +299,10 @@ meta_context_main_configure (MetaContext *context,
|
||||
context_main->options.sm.client_id = g_strdup (desktop_autostart_id);
|
||||
}
|
||||
|
||||
#ifdef HAVE_PROFILER
|
||||
meta_context_set_trace_file (context, context_main->options.trace_file);
|
||||
#endif
|
||||
|
||||
g_unsetenv ("DESKTOP_AUTOSTART_ID");
|
||||
|
||||
return TRUE;
|
||||
@ -662,6 +667,12 @@ meta_context_main_add_option_entries (MetaContextMain *context_main)
|
||||
N_("Run with X11 backend")
|
||||
},
|
||||
#endif
|
||||
{
|
||||
"profile", 0, 0, G_OPTION_ARG_FILENAME,
|
||||
&context_main->options.trace_file,
|
||||
N_("Profile performance using trace instrumentation"),
|
||||
"FILE"
|
||||
},
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user