diff --git a/src/libsysprof/tests/test-profiler.c b/src/libsysprof/tests/test-profiler.c index 5df0a8b5..78056488 100644 --- a/src/libsysprof/tests/test-profiler.c +++ b/src/libsysprof/tests/test-profiler.c @@ -32,6 +32,7 @@ static gboolean memprof; static gboolean tracer; static gboolean gnome_shell; static gboolean bundle_symbols; +// static gboolean debuginfod; static gboolean session_bus; static gboolean system_bus; static gboolean gjs; @@ -45,7 +46,8 @@ static const GOptionEntry entries[] = { { "power-profile", 'p', 0, G_OPTION_ARG_STRING, &power_profile, "Use POWER_PROFILE for duration of recording", "power-saver|balanced|performance" }, { "session-bus", 0, 0, G_OPTION_ARG_NONE, &session_bus, "Record D-Bus messages on the session bus" }, { "system-bus", 0, 0, G_OPTION_ARG_NONE, &system_bus, "Record D-Bus messages on the system bus" }, - { "bundle-symbols", 'b', 0, G_OPTION_ARG_STRING, &bundle_symbols, "Bundle synbols with the capture" }, + { "bundle-symbols", 'b', 0, G_OPTION_ARG_STRING, &bundle_symbols, "Bundle symbols with the capture" }, + // { "debuginfod", 'b', 0, G_OPTION_ARG_STRING, &debuginfod, "Enable debuginfod" }, { 0 } }; @@ -192,6 +194,9 @@ main (int argc, if (bundle_symbols) sysprof_profiler_add_instrument (profiler, sysprof_symbols_bundle_new ()); + // if (debuginfod) /*TODO: this function has not been created anywhere yet*/ + // sysprof_profiler_add_instrument (profiler, sysprof_debuginfod_new()); + if (power_profile) sysprof_profiler_add_instrument (profiler, sysprof_power_profile_new (power_profile)); diff --git a/src/sysprof/sysprof-greeter.c b/src/sysprof/sysprof-greeter.c index caec226d..6f70ef98 100644 --- a/src/sysprof/sysprof-greeter.c +++ b/src/sysprof/sysprof-greeter.c @@ -57,6 +57,7 @@ struct _SysprofGreeter GtkSwitch *record_session_bus; GtkSwitch *record_system_bus; GtkSwitch *bundle_symbols; + GtkSwitch *debuginfod; GtkButton *record_to_memory; AdwComboRow *power_combo; AdwComboRow *sample_user_stack_size; @@ -540,6 +541,7 @@ sysprof_greeter_class_init (SysprofGreeterClass *klass) gtk_widget_class_bind_template_child (widget_class, SysprofGreeter, app_environment); gtk_widget_class_bind_template_child (widget_class, SysprofGreeter, bundle_symbols); + gtk_widget_class_bind_template_child (widget_class, SysprofGreeter, debuginfod); gtk_widget_class_bind_template_child (widget_class, SysprofGreeter, envvars); gtk_widget_class_bind_template_child (widget_class, SysprofGreeter, power_combo); gtk_widget_class_bind_template_child (widget_class, SysprofGreeter, record_compositor); diff --git a/src/sysprof/sysprof-greeter.ui b/src/sysprof/sysprof-greeter.ui index 8906beb2..b6f56017 100644 --- a/src/sysprof/sysprof-greeter.ui +++ b/src/sysprof/sysprof-greeter.ui @@ -619,6 +619,23 @@ + + + + + debuginfod + Debuginfod + Enable Debuginfod + + + + center + + + + + + diff --git a/src/sysprof/sysprof-recording-template.c b/src/sysprof/sysprof-recording-template.c index 204dc2f9..c23bc669 100644 --- a/src/sysprof/sysprof-recording-template.c +++ b/src/sysprof/sysprof-recording-template.c @@ -40,6 +40,7 @@ struct _SysprofRecordingTemplate guint battery_charge : 1; guint bundle_symbols : 1; + guint debuginfod : 1; guint clear_environ : 1; guint cpu_usage : 1; guint disk_usage : 1; @@ -63,6 +64,7 @@ enum { PROP_0, PROP_BATTERY_CHARGE, PROP_BUNDLE_SYMBOLS, + PROP_DEBUGINFOD, PROP_CLEAR_ENVIRON, PROP_COMMAND_LINE, PROP_CPU_USAGE, @@ -122,6 +124,10 @@ sysprof_recording_template_get_property (GObject *object, case PROP_BUNDLE_SYMBOLS: g_value_set_boolean (value, self->bundle_symbols); break; + + case PROP_DEBUGINFOD: + g_value_set_boolean (value, self->debuginfod); + break; case PROP_CLEAR_ENVIRON: g_value_set_boolean (value, self->clear_environ); @@ -233,6 +239,10 @@ sysprof_recording_template_set_property (GObject *object, case PROP_BUNDLE_SYMBOLS: self->bundle_symbols = g_value_get_boolean (value); break; + + case PROP_DEBUGINFOD: + self->debuginfod = g_value_get_boolean (value); + break; case PROP_CLEAR_ENVIRON: self->clear_environ = g_value_get_boolean (value); @@ -346,6 +356,11 @@ sysprof_recording_template_class_init (SysprofRecordingTemplateClass *klass) g_param_spec_boolean ("bundle-symbols", NULL, NULL, TRUE, (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + properties[PROP_DEBUGINFOD] = + g_param_spec_boolean ("debuginfod", NULL, NULL, + TRUE, + (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); properties[PROP_CLEAR_ENVIRON] = g_param_spec_boolean ("clear-environ", NULL, NULL, @@ -464,6 +479,7 @@ static void sysprof_recording_template_init (SysprofRecordingTemplate *self) { self->bundle_symbols = TRUE; + self->debuginfod = TRUE; self->cpu_usage = TRUE; self->disk_usage = TRUE; self->graphics_info = TRUE; @@ -608,6 +624,9 @@ sysprof_recording_template_apply (SysprofRecordingTemplate *self, if (self->bundle_symbols) sysprof_profiler_add_instrument (profiler, sysprof_symbols_bundle_new ()); + + if (self->debuginfod) /*TODO: This just uses an a preexisting function. Write the real function*/ + sysprof_profiler_add_instrument (profiler, sysprof_symbols_bundle_new ()); if (self->cpu_usage) sysprof_profiler_add_instrument (profiler, sysprof_cpu_usage_new ());