From f09186dc2140d978702a9e80e30dae413e62e16b Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Tue, 13 Jun 2023 11:36:42 -0700 Subject: [PATCH] libsysprof-profile: record diagnostic on kallsyms failure --- src/libsysprof-profile/sysprof-sampler.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/libsysprof-profile/sysprof-sampler.c b/src/libsysprof-profile/sysprof-sampler.c index b44940aa..bd66c079 100644 --- a/src/libsysprof-profile/sysprof-sampler.c +++ b/src/libsysprof-profile/sysprof-sampler.c @@ -225,7 +225,17 @@ sysprof_sampler_prepare_fiber (gpointer user_data) * different locations). Embed the kallsyms, but gzip it as * those files can be quite large. */ - dex_await (_sysprof_recording_add_file (prepare->recording, "/proc/kallsyms", TRUE), NULL); + if (!dex_await (_sysprof_recording_add_file (prepare->recording, + "/proc/kallsyms", + TRUE), + &error)) + { + _sysprof_recording_diagnostic (prepare->recording, + "Sampler", + "Failed to record copy of “kallsyms” to capture: %s", + error->message); + g_clear_error (&error); + } /* Now create a SysprofPerfEventStream for every CPU on the * system. Linux Perf will only let us create a stream for