From b38850f27d72a4fe2ef23829890576326c5d1fd9 Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Tue, 6 Jun 2023 15:35:43 -0700 Subject: [PATCH] libsysprof-profile: ensure instruments finish recording They may still be doing operations that need to complete before we can move on to the augmentation phase. --- src/libsysprof-profile/sysprof-recording.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/libsysprof-profile/sysprof-recording.c b/src/libsysprof-profile/sysprof-recording.c index 25e1d35c..43fb45bf 100644 --- a/src/libsysprof-profile/sysprof-recording.c +++ b/src/libsysprof-profile/sysprof-recording.c @@ -162,6 +162,12 @@ stop_recording: */ g_cancellable_cancel (cancellable); + /* But we must still wait for instruments to respond to + * the cancellation and clean up before we can move onto + * the augmentation phase. + */ + dex_await (dex_ref (record), NULL); + /* Let instruments augment the capture. Some instruments may include * extra information about the capture such as symbol names and their * address ranges per-process.