[sysprof] memprof: simplify memprof source
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [sysprof] memprof: simplify memprof source
- Date: Fri, 14 Feb 2020 02:59:43 +0000 (UTC)
commit e7f2702f886de6a44a6a75c09761f7d0d38ee2aa
Author: Christian Hergert <chergert redhat com>
Date: Thu Feb 13 18:58:35 2020 -0800
memprof: simplify memprof source
This doesn't need to be using trace-fd anymore now that we have the
collector API.
src/libsysprof/sysprof-memprof-source.c | 18 +++++++++---------
src/libsysprof/sysprof-memprof-source.h | 2 +-
2 files changed, 10 insertions(+), 10 deletions(-)
---
diff --git a/src/libsysprof/sysprof-memprof-source.c b/src/libsysprof/sysprof-memprof-source.c
index 4856ba7..00ffc9f 100644
--- a/src/libsysprof/sysprof-memprof-source.c
+++ b/src/libsysprof/sysprof-memprof-source.c
@@ -26,11 +26,9 @@
struct _SysprofMemprofSource
{
- SysprofTracefdSource parent_instance;
+ GObject parent_instance;
};
-static SysprofSourceInterface *parent_iface;
-
static void
sysprof_memprof_source_modify_spawn (SysprofSource *source,
SysprofSpawnable *spawnable)
@@ -38,8 +36,6 @@ sysprof_memprof_source_modify_spawn (SysprofSource *source,
g_assert (SYSPROF_IS_SOURCE (source));
g_assert (SYSPROF_IS_SPAWNABLE (spawnable));
- parent_iface->modify_spawn (source, spawnable);
-
#ifdef __linux__
sysprof_spawnable_setenv (spawnable, "G_SLICE", "always-malloc");
sysprof_spawnable_setenv (spawnable,
@@ -49,14 +45,19 @@ sysprof_memprof_source_modify_spawn (SysprofSource *source,
}
static void
-source_iface_init (SysprofSourceInterface *iface)
+sysprof_memprof_source_stop (SysprofSource *source)
{
- parent_iface = g_type_interface_peek_parent (iface);
+ sysprof_source_emit_finished (source);
+}
+static void
+source_iface_init (SysprofSourceInterface *iface)
+{
iface->modify_spawn = sysprof_memprof_source_modify_spawn;
+ iface->stop = sysprof_memprof_source_stop;
}
-G_DEFINE_TYPE_WITH_CODE (SysprofMemprofSource, sysprof_memprof_source, SYSPROF_TYPE_TRACEFD_SOURCE,
+G_DEFINE_TYPE_WITH_CODE (SysprofMemprofSource, sysprof_memprof_source, G_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE (SYSPROF_TYPE_SOURCE, source_iface_init))
static void
@@ -67,7 +68,6 @@ sysprof_memprof_source_class_init (SysprofMemprofSourceClass *klass)
static void
sysprof_memprof_source_init (SysprofMemprofSource *self)
{
- sysprof_tracefd_source_set_envvar (SYSPROF_TRACEFD_SOURCE (self), "MEMPROF_TRACE_FD");
}
SysprofSource *
diff --git a/src/libsysprof/sysprof-memprof-source.h b/src/libsysprof/sysprof-memprof-source.h
index 9188a89..cfff995 100644
--- a/src/libsysprof/sysprof-memprof-source.h
+++ b/src/libsysprof/sysprof-memprof-source.h
@@ -27,7 +27,7 @@ G_BEGIN_DECLS
#define SYSPROF_TYPE_MEMPROF_SOURCE (sysprof_memprof_source_get_type())
SYSPROF_AVAILABLE_IN_3_36
-G_DECLARE_FINAL_TYPE (SysprofMemprofSource, sysprof_memprof_source, SYSPROF, MEMPROF_SOURCE,
SysprofTracefdSource)
+G_DECLARE_FINAL_TYPE (SysprofMemprofSource, sysprof_memprof_source, SYSPROF, MEMPROF_SOURCE, GObject)
SYSPROF_AVAILABLE_IN_3_36
SysprofSource *sysprof_memprof_source_new (void);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]