[sysprof: 53/63] libsysprof-capture: Drop sysprof_capture_writer_set_flush_delay()



commit fde278fb7f4cf6c23af01331364261a591a3de20
Author: Philip Withnall <withnall endlessm com>
Date:   Thu Jul 2 12:48:51 2020 +0100

    libsysprof-capture: Drop sysprof_capture_writer_set_flush_delay()
    
    It was unused anywhere within sysprof.git, and couldn’t be modified to
    drop its GLib dependency while still retaining its functionality.
    
    If it’s still needed, it’ll have to be reimplemented in libsysprof.
    
    Signed-off-by: Philip Withnall <withnall endlessm com>
    
    Helps: #40

 src/libsysprof-capture/sysprof-capture-writer.c | 41 -------------------------
 src/libsysprof-capture/sysprof-capture-writer.h |  4 ---
 2 files changed, 45 deletions(-)
---
diff --git a/src/libsysprof-capture/sysprof-capture-writer.c b/src/libsysprof-capture/sysprof-capture-writer.c
index 0170488..65df4ac 100644
--- a/src/libsysprof-capture/sysprof-capture-writer.c
+++ b/src/libsysprof-capture/sysprof-capture-writer.c
@@ -137,9 +137,6 @@ struct _SysprofCaptureWriter
   size_t pos;
   size_t len;
 
-  /* GSource for periodic flush */
-  GSource *periodic_flush;
-
   /* counter id sequence */
   int next_counter_id;
 
@@ -171,8 +168,6 @@ sysprof_capture_writer_finalize (SysprofCaptureWriter *self)
 {
   if (self != NULL)
     {
-      sysprof_clear_pointer (&self->periodic_flush, g_source_destroy);
-
       sysprof_capture_writer_flush (self);
 
       if (self->fd != -1)
@@ -1502,42 +1497,6 @@ sysprof_capture_writer_add_file_fd (SysprofCaptureWriter *self,
   return true;
 }
 
-static gboolean
-sysprof_capture_writer_auto_flush_cb (SysprofCaptureWriter *self)
-{
-  g_assert (self != NULL);
-
-  sysprof_capture_writer_flush (self);
-
-  return G_SOURCE_CONTINUE;
-}
-
-void
-sysprof_capture_writer_set_flush_delay (SysprofCaptureWriter *self,
-                                        GMainContext         *main_context,
-                                        guint                 timeout_seconds)
-{
-  GSource *source;
-
-  g_return_if_fail (self != NULL);
-
-  sysprof_clear_pointer (&self->periodic_flush, g_source_destroy);
-
-  if (timeout_seconds == 0)
-    return;
-
-  source = g_timeout_source_new_seconds (timeout_seconds);
-  g_source_set_name (source, "[sysprof-capture-writer-flush]");
-  g_source_set_priority (source, G_PRIORITY_LOW + 100);
-  g_source_set_callback (source,
-                         (GSourceFunc) sysprof_capture_writer_auto_flush_cb,
-                         self, NULL);
-
-  self->periodic_flush = g_steal_pointer (&source);
-
-  g_source_attach (self->periodic_flush, main_context);
-}
-
 bool
 sysprof_capture_writer_add_allocation (SysprofCaptureWriter  *self,
                                        int64_t                time,
diff --git a/src/libsysprof-capture/sysprof-capture-writer.h b/src/libsysprof-capture/sysprof-capture-writer.h
index b69cd74..bf39f0f 100644
--- a/src/libsysprof-capture/sysprof-capture-writer.h
+++ b/src/libsysprof-capture/sysprof-capture-writer.h
@@ -85,10 +85,6 @@ SYSPROF_AVAILABLE_IN_ALL
 void                  sysprof_capture_writer_stat                            (SysprofCaptureWriter           
   *self,
                                                                               SysprofCaptureStat             
   *stat);
 SYSPROF_AVAILABLE_IN_ALL
-void                  sysprof_capture_writer_set_flush_delay                 (SysprofCaptureWriter           
   *self,
-                                                                              GMainContext                   
   *main_context,
-                                                                              unsigned int                   
    timeout_seconds);
-SYSPROF_AVAILABLE_IN_ALL
 bool                  sysprof_capture_writer_add_file                        (SysprofCaptureWriter           
   *self,
                                                                               int64_t                        
    time,
                                                                               int                            
    cpu,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]