From b13d4acb98d3450b7e32a43f79007b67aa654026 Mon Sep 17 00:00:00 2001 From: varun-r-mallya Date: Sun, 2 Feb 2025 00:55:19 +0530 Subject: [PATCH] sysprof/greeter: add external URLs configuration for debuginfod Signed-off-by: varun-r-mallya --- src/sysprof/sysprof-greeter.ui | 23 ++++++++++++++++++++++- src/sysprof/sysprof-recording-template.c | 20 +++++++++++++++++--- 2 files changed, 39 insertions(+), 4 deletions(-) diff --git a/src/sysprof/sysprof-greeter.ui b/src/sysprof/sysprof-greeter.ui index b6f56017..515619dd 100644 --- a/src/sysprof/sysprof-greeter.ui +++ b/src/sysprof/sysprof-greeter.ui @@ -625,7 +625,7 @@ debuginfod Debuginfod - Enable Debuginfod + Enable Debuginfod to automatically fetch debug symbols @@ -636,6 +636,27 @@ + + + + + Debuginfod External URLs + + + + + + Comma-separated list of external debuginfod servers to query for debug information. + 0 + 8 + + + + + diff --git a/src/sysprof/sysprof-recording-template.c b/src/sysprof/sysprof-recording-template.c index 4de647c2..170bafd4 100644 --- a/src/sysprof/sysprof-recording-template.c +++ b/src/sysprof/sysprof-recording-template.c @@ -35,6 +35,7 @@ struct _SysprofRecordingTemplate char *cwd; char *power_profile; char **environ; + char *debuginfod_external_urls; guint stack_size; @@ -65,6 +66,7 @@ enum { PROP_BATTERY_CHARGE, PROP_BUNDLE_SYMBOLS, PROP_DEBUGINFOD, + PROP_DEBUGINFOD_EXTERNAL_URLS, PROP_CLEAR_ENVIRON, PROP_COMMAND_LINE, PROP_CPU_USAGE, @@ -103,6 +105,7 @@ sysprof_recording_template_finalize (GObject *object) g_clear_pointer (&self->cwd, g_free); g_clear_pointer (&self->power_profile, g_free); g_clear_pointer (&self->environ, g_free); + g_clear_pointer (&self->debuginfod_external_urls, g_free); G_OBJECT_CLASS (sysprof_recording_template_parent_class)->finalize (object); } @@ -129,6 +132,10 @@ sysprof_recording_template_get_property (GObject *object, g_value_set_boolean (value, self->debuginfod); break; + case PROP_DEBUGINFOD_EXTERNAL_URLS: + g_value_set_string (value, self->debuginfod_external_urls); + break; + case PROP_CLEAR_ENVIRON: g_value_set_boolean (value, self->clear_environ); break; @@ -244,6 +251,10 @@ sysprof_recording_template_set_property (GObject *object, self->debuginfod = g_value_get_boolean (value); break; + case PROP_DEBUGINFOD_EXTERNAL_URLS: + g_set_str (&self->debuginfod_external_urls, g_value_get_string (value)); + break; + case PROP_CLEAR_ENVIRON: self->clear_environ = g_value_get_boolean (value); break; @@ -361,6 +372,11 @@ sysprof_recording_template_class_init (SysprofRecordingTemplateClass *klass) g_param_spec_boolean ("debuginfod", NULL, NULL, TRUE, (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + properties[PROP_DEBUGINFOD_EXTERNAL_URLS] = + g_param_spec_string ("debuginfod-external-urls", NULL, NULL, + NULL, + (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); properties[PROP_CLEAR_ENVIRON] = g_param_spec_boolean ("clear-environ", NULL, NULL, @@ -491,6 +507,7 @@ sysprof_recording_template_init (SysprofRecordingTemplate *self) self->system_log = TRUE; self->command_line = g_strdup (""); self->cwd = g_strdup(""); + self->debuginfod_external_urls = g_strdup(""); self->stack_size = DEFAULT_STACK_SIZE; } @@ -624,9 +641,6 @@ 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.*/ - // sysprof_profiler_add_instrument (profiler, this_should_be_a_handler_function()); if (self->cpu_usage) sysprof_profiler_add_instrument (profiler, sysprof_cpu_usage_new ());