From 79ac0a2c73eadebf4b0089a9484884a0cba16140 Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Sat, 8 Jul 2023 12:41:06 -0700 Subject: [PATCH] libsysprof-profile: add version info as metadata --- src/libsysprof-profile/sysprof-recording.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/libsysprof-profile/sysprof-recording.c b/src/libsysprof-profile/sysprof-recording.c index 764c5de2..fac93d8a 100644 --- a/src/libsysprof-profile/sysprof-recording.c +++ b/src/libsysprof-profile/sysprof-recording.c @@ -101,6 +101,16 @@ _sysprof_recording_spawn (SysprofSpawnable *spawnable) return dex_subprocess_wait_check (subprocess); } +static inline void +add_metadata (SysprofRecording *self, + const char *id, + const char *value) +{ + sysprof_capture_writer_add_metadata (self->writer, + SYSPROF_CAPTURE_CURRENT_TIME, + -1, -1, id, value, -1); +} + static DexFuture * sysprof_recording_fiber (gpointer user_data) { @@ -140,6 +150,10 @@ sysprof_recording_fiber (gpointer user_data) else monitor = dex_future_new_infinite (); + /* Track various metadata */ + add_metadata (self, "org.gnome.sysprof.app-id", APP_ID_S); + add_metadata (self, "org.gnome.sysprof.version", PACKAGE_VERSION); + self->start_time = g_get_monotonic_time (); /* Queue receive of first message */