[gnome-builder] plugins/podman: Add debug logging macros
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] plugins/podman: Add debug logging macros
- Date: Sun, 6 Sep 2020 20:24:47 +0000 (UTC)
commit 1ff9767a73d45f1c52c64b166c7dc5c444c5b813
Author: Ondřej Míchal <harrymichal seznam cz>
Date: Wed Sep 2 16:33:48 2020 +0200
plugins/podman: Add debug logging macros
src/plugins/podman/gbp-podman-runtime-provider.c | 36 +++++++++++++++++++---
.../podman/gbp-podman-subprocess-launcher.c | 12 +++++++-
2 files changed, 43 insertions(+), 5 deletions(-)
---
diff --git a/src/plugins/podman/gbp-podman-runtime-provider.c
b/src/plugins/podman/gbp-podman-runtime-provider.c
index 958c108cd..507fee12f 100644
--- a/src/plugins/podman/gbp-podman-runtime-provider.c
+++ b/src/plugins/podman/gbp-podman-runtime-provider.c
@@ -47,6 +47,8 @@ gbp_podman_runtime_provider_apply_cb (JsonArray *ar,
g_autoptr(GbpPodmanRuntime) runtime = NULL;
JsonObject *obj;
+ IDE_ENTRY;
+
g_assert (IDE_IS_MAIN_THREAD ());
g_assert (GBP_IS_PODMAN_RUNTIME_PROVIDER (self));
@@ -62,6 +64,8 @@ gbp_podman_runtime_provider_apply_cb (JsonArray *ar,
ide_object_append (IDE_OBJECT (self), IDE_OBJECT (runtime));
ide_runtime_manager_add (self->manager, IDE_RUNTIME (runtime));
}
+
+ IDE_EXIT;
}
static gboolean
@@ -73,6 +77,8 @@ gbp_podman_runtime_provider_apply (GbpPodmanRuntimeProvider *self,
JsonArray *ar;
JsonNode *root;
+ IDE_ENTRY;
+
g_assert (IDE_IS_MAIN_THREAD ());
g_assert (GBP_IS_PODMAN_RUNTIME_PROVIDER (self));
g_assert (json_string != NULL);
@@ -80,7 +86,7 @@ gbp_podman_runtime_provider_apply (GbpPodmanRuntimeProvider *self,
parser = json_parser_new ();
if (!json_parser_load_from_data (parser, json_string, -1, error))
- return FALSE;
+ IDE_RETURN(FALSE);
if (!(root = json_parser_get_root (parser)) ||
!JSON_NODE_HOLDS_ARRAY (root) ||
@@ -90,14 +96,14 @@ gbp_podman_runtime_provider_apply (GbpPodmanRuntimeProvider *self,
G_IO_ERROR,
G_IO_ERROR_INVALID_DATA,
"Expected [] for root JSON node");
- return FALSE;
+ IDE_RETURN(FALSE);
}
json_array_foreach_element (ar,
gbp_podman_runtime_provider_apply_cb,
self);
- return TRUE;
+ IDE_RETURN(TRUE);
}
static void
@@ -111,6 +117,8 @@ gbp_podman_runtime_provider_load_communicate_cb (GObject *object,
g_autoptr(IdeTask) task = user_data;
g_autoptr(GError) error = NULL;
+ IDE_ENTRY;
+
g_assert (IDE_IS_MAIN_THREAD ());
g_assert (IDE_IS_SUBPROCESS (subprocess));
g_assert (G_IS_ASYNC_RESULT (result));
@@ -123,6 +131,8 @@ gbp_podman_runtime_provider_load_communicate_cb (GObject *object,
ide_task_return_error (task, g_steal_pointer (&error));
else
ide_task_return_boolean (task, TRUE);
+
+ IDE_EXIT;
}
static gboolean
@@ -130,6 +140,8 @@ gbp_podman_runtime_provider_has_preserve_fds (GbpPodmanRuntimeProvider *self,
const gchar *stdout_buf,
GError **error)
{
+ IDE_ENTRY;
+
g_assert (GBP_IS_PODMAN_RUNTIME_PROVIDER (self));
g_assert (stdout_buf != NULL);
@@ -142,7 +154,7 @@ gbp_podman_runtime_provider_has_preserve_fds (GbpPodmanRuntimeProvider *self,
return FALSE;
}
- return TRUE;
+ IDE_RETURN(TRUE);
}
static void
@@ -158,6 +170,8 @@ gbp_podman_runtime_provider_load_sniff_cb (GObject *object,
g_autoptr(GError) error = NULL;
GCancellable *cancellable;
+ IDE_ENTRY;
+
g_assert (IDE_IS_MAIN_THREAD ());
g_assert (IDE_IS_SUBPROCESS (subprocess));
g_assert (G_IS_ASYNC_RESULT (result));
@@ -189,6 +203,8 @@ gbp_podman_runtime_provider_load_sniff_cb (GObject *object,
cancellable,
gbp_podman_runtime_provider_load_communicate_cb,
g_steal_pointer (&task));
+
+ IDE_EXIT;
}
static void
@@ -202,6 +218,8 @@ gbp_podman_runtime_provider_load_async (GbpPodmanRuntimeProvider *self,
g_autoptr(IdeSubprocess) subprocess = NULL;
g_autoptr(GError) error = NULL;
+ IDE_ENTRY;
+
g_assert (IDE_IS_MAIN_THREAD ());
g_assert (GBP_IS_PODMAN_RUNTIME_PROVIDER (self));
g_assert (!cancellable || G_IS_CANCELLABLE (cancellable));
@@ -226,6 +244,8 @@ gbp_podman_runtime_provider_load_async (GbpPodmanRuntimeProvider *self,
cancellable,
gbp_podman_runtime_provider_load_sniff_cb,
g_steal_pointer (&task));
+
+ IDE_EXIT;
}
static void
@@ -234,6 +254,8 @@ gbp_podman_runtime_provider_load (IdeRuntimeProvider *provider,
{
GbpPodmanRuntimeProvider *self = (GbpPodmanRuntimeProvider *)provider;
+ IDE_ENTRY;
+
g_assert (IDE_IS_MAIN_THREAD ());
g_assert (GBP_IS_PODMAN_RUNTIME_PROVIDER (self));
g_assert (IDE_IS_RUNTIME_MANAGER (manager));
@@ -242,6 +264,8 @@ gbp_podman_runtime_provider_load (IdeRuntimeProvider *provider,
self->manager = manager;
gbp_podman_runtime_provider_load_async (self, self->cancellable, NULL, NULL);
+
+ IDE_EXIT;
}
static void
@@ -250,6 +274,8 @@ gbp_podman_runtime_provider_unload (IdeRuntimeProvider *provider,
{
GbpPodmanRuntimeProvider *self = (GbpPodmanRuntimeProvider *)provider;
+ IDE_ENTRY;
+
g_assert (IDE_IS_MAIN_THREAD ());
g_assert (GBP_IS_PODMAN_RUNTIME_PROVIDER (self));
g_assert (IDE_IS_RUNTIME_MANAGER (manager));
@@ -258,6 +284,8 @@ gbp_podman_runtime_provider_unload (IdeRuntimeProvider *provider,
g_cancellable_cancel (self->cancellable);
g_clear_object (&self->cancellable);
+
+ IDE_EXIT;
}
static void
diff --git a/src/plugins/podman/gbp-podman-subprocess-launcher.c
b/src/plugins/podman/gbp-podman-subprocess-launcher.c
index 3b34942da..a0653c342 100644
--- a/src/plugins/podman/gbp-podman-subprocess-launcher.c
+++ b/src/plugins/podman/gbp-podman-subprocess-launcher.c
@@ -47,12 +47,16 @@ copy_envvar (IdeSubprocessLauncher *launcher,
{
const gchar *val;
+ IDE_ENTRY;
+
if ((val = g_getenv (key)))
{
g_autofree gchar *arg = g_strdup_printf ("--env=%s=%s", key, val);
ide_subprocess_launcher_insert_argv (launcher, *position, arg);
(*position)++;
}
+
+ IDE_EXIT;
}
static IdeSubprocess *
@@ -63,6 +67,8 @@ gbp_podman_subprocess_launcher_spawn (IdeSubprocessLauncher *launcher,
GbpPodmanSubprocessLauncher *self = (GbpPodmanSubprocessLauncher *)launcher;
const gchar * const *argv;
+ IDE_ENTRY;
+
g_assert (GBP_IS_PODMAN_SUBPROCESS_LAUNCHER (self));
g_assert (!cancellable || G_IS_CANCELLABLE (cancellable));
g_assert (self->id != NULL);
@@ -141,7 +147,7 @@ gbp_podman_subprocess_launcher_spawn (IdeSubprocessLauncher *launcher,
ide_subprocess_launcher_insert_argv (launcher, i++, self->id);
}
- return IDE_SUBPROCESS_LAUNCHER_CLASS (gbp_podman_subprocess_launcher_parent_class)->spawn (launcher,
cancellable, error);
+ IDE_RETURN(IDE_SUBPROCESS_LAUNCHER_CLASS (gbp_podman_subprocess_launcher_parent_class)->spawn (launcher,
cancellable, error));
}
static void
@@ -149,9 +155,13 @@ gbp_podman_subprocess_launcher_finalize (GObject *object)
{
GbpPodmanSubprocessLauncher *self = (GbpPodmanSubprocessLauncher *)object;
+ IDE_ENTRY;
+
g_clear_pointer (&self->id, g_free);
G_OBJECT_CLASS (gbp_podman_subprocess_launcher_parent_class)->finalize (object);
+
+ IDE_EXIT;
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]