[sysprof/wip/chergert/sysprof-3] libsysprof-capture: shorten names by removing Frame



commit e290cac7accf1ca84b8768f0f535785b2ae9dc93
Author: Christian Hergert <chergert redhat com>
Date:   Wed May 22 16:36:30 2019 -0700

    libsysprof-capture: shorten names by removing Frame

 src/libsysprof-capture/sysprof-capture-condition.c  |  4 ++--
 src/libsysprof-capture/sysprof-capture-reader.c     | 18 +++++++++---------
 src/libsysprof-capture/sysprof-capture-reader.h     |  4 ++--
 src/libsysprof-capture/sysprof-capture-types.h      |  8 ++++----
 src/libsysprof-capture/sysprof-capture-writer-cat.c |  4 ++--
 src/libsysprof-capture/sysprof-capture-writer.c     |  8 ++++----
 src/libsysprof-ui/sysprof-cpu-visualizer-row.c      |  2 +-
 src/libsysprof-ui/sysprof-line-visualizer-row.c     |  4 ++--
 src/libsysprof-ui/sysprof-marks-model.c             |  4 ++--
 src/libsysprof-ui/sysprof-visualizer-list.c         |  2 +-
 src/tests/test-capture.c                            |  4 ++--
 src/tools/sysprof-cat.c                             |  4 ++--
 src/tools/sysprof-dump.c                            |  4 ++--
 13 files changed, 35 insertions(+), 35 deletions(-)
---
diff --git a/src/libsysprof-capture/sysprof-capture-condition.c 
b/src/libsysprof-capture/sysprof-capture-condition.c
index c2c7378..fd110c5 100644
--- a/src/libsysprof-capture/sysprof-capture-condition.c
+++ b/src/libsysprof-capture/sysprof-capture-condition.c
@@ -105,7 +105,7 @@ sysprof_capture_condition_match (const SysprofCaptureCondition *self,
     case SYSPROF_CAPTURE_CONDITION_WHERE_COUNTER_IN:
       if (frame->type == SYSPROF_CAPTURE_FRAME_CTRSET)
         {
-          const SysprofCaptureFrameCounterSet *set = (SysprofCaptureFrameCounterSet *)frame;
+          const SysprofCaptureCounterSet *set = (SysprofCaptureCounterSet *)frame;
 
           for (guint i = 0; i < self->u.where_counter_in->len; i++)
             {
@@ -127,7 +127,7 @@ sysprof_capture_condition_match (const SysprofCaptureCondition *self,
         }
       else if (frame->type == SYSPROF_CAPTURE_FRAME_CTRDEF)
         {
-          const SysprofCaptureFrameCounterDefine *def = (SysprofCaptureFrameCounterDefine *)frame;
+          const SysprofCaptureCounterDefine *def = (SysprofCaptureCounterDefine *)frame;
 
           for (guint i = 0; i < self->u.where_counter_in->len; i++)
             {
diff --git a/src/libsysprof-capture/sysprof-capture-reader.c b/src/libsysprof-capture/sysprof-capture-reader.c
index e2aed4f..b42a553 100644
--- a/src/libsysprof-capture/sysprof-capture-reader.c
+++ b/src/libsysprof-capture/sysprof-capture-reader.c
@@ -721,10 +721,10 @@ sysprof_capture_reader_read_sample (SysprofCaptureReader *self)
   return sample;
 }
 
-const SysprofCaptureFrameCounterDefine *
+const SysprofCaptureCounterDefine *
 sysprof_capture_reader_read_counter_define (SysprofCaptureReader *self)
 {
-  SysprofCaptureFrameCounterDefine *def;
+  SysprofCaptureCounterDefine *def;
 
   g_assert (self != NULL);
   g_assert ((self->pos % SYSPROF_CAPTURE_ALIGN) == 0);
@@ -733,7 +733,7 @@ sysprof_capture_reader_read_counter_define (SysprofCaptureReader *self)
   if (!sysprof_capture_reader_ensure_space_for (self, sizeof *def))
     return NULL;
 
-  def = (SysprofCaptureFrameCounterDefine *)(gpointer)&self->buf[self->pos];
+  def = (SysprofCaptureCounterDefine *)(gpointer)&self->buf[self->pos];
 
   if (def->frame.type != SYSPROF_CAPTURE_FRAME_CTRDEF)
     return NULL;
@@ -744,13 +744,13 @@ sysprof_capture_reader_read_counter_define (SysprofCaptureReader *self)
   if (G_UNLIKELY (self->endian != G_BYTE_ORDER))
     def->n_counters = GUINT16_SWAP_LE_BE (def->n_counters);
 
-  if (def->frame.len < (sizeof *def + (sizeof (SysprofCaptureFrameCounterDefine) * def->n_counters)))
+  if (def->frame.len < (sizeof *def + (sizeof (SysprofCaptureCounterDefine) * def->n_counters)))
     return NULL;
 
   if (!sysprof_capture_reader_ensure_space_for (self, def->frame.len))
     return NULL;
 
-  def = (SysprofCaptureFrameCounterDefine *)(gpointer)&self->buf[self->pos];
+  def = (SysprofCaptureCounterDefine *)(gpointer)&self->buf[self->pos];
 
   if (G_UNLIKELY (self->endian != G_BYTE_ORDER))
     {
@@ -768,10 +768,10 @@ sysprof_capture_reader_read_counter_define (SysprofCaptureReader *self)
   return def;
 }
 
-const SysprofCaptureFrameCounterSet *
+const SysprofCaptureCounterSet *
 sysprof_capture_reader_read_counter_set (SysprofCaptureReader *self)
 {
-  SysprofCaptureFrameCounterSet *set;
+  SysprofCaptureCounterSet *set;
 
   g_assert (self != NULL);
   g_assert ((self->pos % SYSPROF_CAPTURE_ALIGN) == 0);
@@ -780,7 +780,7 @@ sysprof_capture_reader_read_counter_set (SysprofCaptureReader *self)
   if (!sysprof_capture_reader_ensure_space_for (self, sizeof *set))
     return NULL;
 
-  set = (SysprofCaptureFrameCounterSet *)(gpointer)&self->buf[self->pos];
+  set = (SysprofCaptureCounterSet *)(gpointer)&self->buf[self->pos];
 
   if (set->frame.type != SYSPROF_CAPTURE_FRAME_CTRSET)
     return NULL;
@@ -797,7 +797,7 @@ sysprof_capture_reader_read_counter_set (SysprofCaptureReader *self)
   if (!sysprof_capture_reader_ensure_space_for (self, set->frame.len))
     return NULL;
 
-  set = (SysprofCaptureFrameCounterSet *)(gpointer)&self->buf[self->pos];
+  set = (SysprofCaptureCounterSet *)(gpointer)&self->buf[self->pos];
 
   if (G_UNLIKELY (self->endian != G_BYTE_ORDER))
     {
diff --git a/src/libsysprof-capture/sysprof-capture-reader.h b/src/libsysprof-capture/sysprof-capture-reader.h
index 5f47848..944daf1 100644
--- a/src/libsysprof-capture/sysprof-capture-reader.h
+++ b/src/libsysprof-capture/sysprof-capture-reader.h
@@ -74,9 +74,9 @@ const SysprofCaptureSample             *sysprof_capture_reader_read_sample
 SYSPROF_AVAILABLE_IN_ALL
 GHashTable                             *sysprof_capture_reader_read_jitmap         (SysprofCaptureReader     
*self);
 SYSPROF_AVAILABLE_IN_ALL
-const SysprofCaptureFrameCounterDefine *sysprof_capture_reader_read_counter_define (SysprofCaptureReader     
*self);
+const SysprofCaptureCounterDefine *sysprof_capture_reader_read_counter_define (SysprofCaptureReader     
*self);
 SYSPROF_AVAILABLE_IN_ALL
-const SysprofCaptureFrameCounterSet    *sysprof_capture_reader_read_counter_set    (SysprofCaptureReader     
*self);
+const SysprofCaptureCounterSet    *sysprof_capture_reader_read_counter_set    (SysprofCaptureReader     
*self);
 SYSPROF_AVAILABLE_IN_ALL
 gboolean                                sysprof_capture_reader_reset               (SysprofCaptureReader     
*self);
 SYSPROF_AVAILABLE_IN_ALL
diff --git a/src/libsysprof-capture/sysprof-capture-types.h b/src/libsysprof-capture/sysprof-capture-types.h
index 582e9f9..1aa179a 100644
--- a/src/libsysprof-capture/sysprof-capture-types.h
+++ b/src/libsysprof-capture/sysprof-capture-types.h
@@ -202,7 +202,7 @@ typedef struct
   guint32               padding1 : 16;
   guint32               padding2;
   SysprofCaptureCounter counters[0];
-} SysprofCaptureFrameCounterDefine
+} SysprofCaptureCounterDefine
 SYSPROF_ALIGNED_END(1);
 
 SYSPROF_ALIGNED_BEGIN(1)
@@ -226,7 +226,7 @@ typedef struct
   guint32                     padding1 : 16;
   guint32                     padding2;
   SysprofCaptureCounterValues values[0];
-} SysprofCaptureFrameCounterSet
+} SysprofCaptureCounterSet
 SYSPROF_ALIGNED_END(1);
 
 SYSPROF_ALIGNED_BEGIN(1)
@@ -260,8 +260,8 @@ G_STATIC_ASSERT (sizeof (SysprofCaptureExit) == 24);
 G_STATIC_ASSERT (sizeof (SysprofCaptureTimestamp) == 24);
 G_STATIC_ASSERT (sizeof (SysprofCaptureCounter) == 128);
 G_STATIC_ASSERT (sizeof (SysprofCaptureCounterValues) == 96);
-G_STATIC_ASSERT (sizeof (SysprofCaptureFrameCounterDefine) == 32);
-G_STATIC_ASSERT (sizeof (SysprofCaptureFrameCounterSet) == 32);
+G_STATIC_ASSERT (sizeof (SysprofCaptureCounterDefine) == 32);
+G_STATIC_ASSERT (sizeof (SysprofCaptureCounterSet) == 32);
 G_STATIC_ASSERT (sizeof (SysprofCaptureMark) == 96);
 G_STATIC_ASSERT (sizeof (SysprofCaptureMetadata) == 64);
 
diff --git a/src/libsysprof-capture/sysprof-capture-writer-cat.c 
b/src/libsysprof-capture/sysprof-capture-writer-cat.c
index 9743740..7e7f4e6 100644
--- a/src/libsysprof-capture/sysprof-capture-writer-cat.c
+++ b/src/libsysprof-capture/sysprof-capture-writer-cat.c
@@ -308,7 +308,7 @@ sysprof_capture_writer_cat (SysprofCaptureWriter  *self,
 
         case SYSPROF_CAPTURE_FRAME_CTRDEF:
           {
-            const SysprofCaptureFrameCounterDefine *frame;
+            const SysprofCaptureCounterDefine *frame;
 
             if (!(frame = sysprof_capture_reader_read_counter_define (reader)))
               goto panic;
@@ -344,7 +344,7 @@ sysprof_capture_writer_cat (SysprofCaptureWriter  *self,
 
         case SYSPROF_CAPTURE_FRAME_CTRSET:
           {
-            const SysprofCaptureFrameCounterSet *frame;
+            const SysprofCaptureCounterSet *frame;
 
             if (!(frame = sysprof_capture_reader_read_counter_set (reader)))
               goto panic;
diff --git a/src/libsysprof-capture/sysprof-capture-writer.c b/src/libsysprof-capture/sysprof-capture-writer.c
index f73895c..1d416c0 100644
--- a/src/libsysprof-capture/sysprof-capture-writer.c
+++ b/src/libsysprof-capture/sysprof-capture-writer.c
@@ -1111,7 +1111,7 @@ sysprof_capture_writer_define_counters (SysprofCaptureWriter        *self,
                                         const SysprofCaptureCounter *counters,
                                         guint                        n_counters)
 {
-  SysprofCaptureFrameCounterDefine *def;
+  SysprofCaptureCounterDefine *def;
   gsize len;
   guint i;
 
@@ -1123,7 +1123,7 @@ sysprof_capture_writer_define_counters (SysprofCaptureWriter        *self,
 
   len = sizeof *def + (sizeof *counters * n_counters);
 
-  def = (SysprofCaptureFrameCounterDefine *)sysprof_capture_writer_allocate (self, &len);
+  def = (SysprofCaptureCounterDefine *)sysprof_capture_writer_allocate (self, &len);
   if (!def)
     return FALSE;
 
@@ -1162,7 +1162,7 @@ sysprof_capture_writer_set_counters (SysprofCaptureWriter             *self,
                                      const SysprofCaptureCounterValue *values,
                                      guint                             n_counters)
 {
-  SysprofCaptureFrameCounterSet *set;
+  SysprofCaptureCounterSet *set;
   gsize len;
   guint n_groups;
   guint group;
@@ -1183,7 +1183,7 @@ sysprof_capture_writer_set_counters (SysprofCaptureWriter             *self,
 
   len = sizeof *set + (n_groups * sizeof (SysprofCaptureCounterValues));
 
-  set = (SysprofCaptureFrameCounterSet *)sysprof_capture_writer_allocate (self, &len);
+  set = (SysprofCaptureCounterSet *)sysprof_capture_writer_allocate (self, &len);
   if (!set)
     return FALSE;
 
diff --git a/src/libsysprof-ui/sysprof-cpu-visualizer-row.c b/src/libsysprof-ui/sysprof-cpu-visualizer-row.c
index 2da08f1..b97ebaf 100644
--- a/src/libsysprof-ui/sysprof-cpu-visualizer-row.c
+++ b/src/libsysprof-ui/sysprof-cpu-visualizer-row.c
@@ -39,7 +39,7 @@ static gboolean
 sysprof_cpu_visualizer_counter_found (const SysprofCaptureFrame *frame,
                                       gpointer                   user_data)
 {
-  const SysprofCaptureFrameCounterDefine *def = (SysprofCaptureFrameCounterDefine *)frame;
+  const SysprofCaptureCounterDefine *def = (SysprofCaptureCounterDefine *)frame;
   GArray *counters = user_data;
   gboolean found = FALSE;
 
diff --git a/src/libsysprof-ui/sysprof-line-visualizer-row.c b/src/libsysprof-ui/sysprof-line-visualizer-row.c
index c3ac83f..5488a45 100644
--- a/src/libsysprof-ui/sysprof-line-visualizer-row.c
+++ b/src/libsysprof-ui/sysprof-line-visualizer-row.c
@@ -581,7 +581,7 @@ sysprof_line_visualizer_row_load_data_frame_cb (const SysprofCaptureFrame *frame
 
   if (frame->type == SYSPROF_CAPTURE_FRAME_CTRSET)
     {
-      const SysprofCaptureFrameCounterSet *set = (SysprofCaptureFrameCounterSet *)frame;
+      const SysprofCaptureCounterSet *set = (SysprofCaptureCounterSet *)frame;
       gdouble x = calc_x (load->begin_time, load->end_time, frame->time);
 
       for (guint i = 0; i < set->n_values; i++)
@@ -625,7 +625,7 @@ sysprof_line_visualizer_row_load_data_range_cb (const SysprofCaptureFrame *frame
 
   if (frame->type == SYSPROF_CAPTURE_FRAME_CTRSET)
     {
-      const SysprofCaptureFrameCounterSet *set = (SysprofCaptureFrameCounterSet *)frame;
+      const SysprofCaptureCounterSet *set = (SysprofCaptureCounterSet *)frame;
 
       for (guint i = 0; i < set->n_values; i++)
         {
diff --git a/src/libsysprof-ui/sysprof-marks-model.c b/src/libsysprof-ui/sysprof-marks-model.c
index 006dabc..abedb5f 100644
--- a/src/libsysprof-ui/sysprof-marks-model.c
+++ b/src/libsysprof-ui/sysprof-marks-model.c
@@ -333,7 +333,7 @@ cursor_foreach_cb (const SysprofCaptureFrame *frame,
     }
   else if (frame->type == SYSPROF_CAPTURE_FRAME_CTRDEF)
     {
-      SysprofCaptureFrameCounterDefine *ctrdef = (SysprofCaptureFrameCounterDefine *)frame;
+      SysprofCaptureCounterDefine *ctrdef = (SysprofCaptureCounterDefine *)frame;
 
       for (guint i = 0; i < ctrdef->n_counters; i++)
         {
@@ -346,7 +346,7 @@ cursor_foreach_cb (const SysprofCaptureFrame *frame,
     }
   else if (frame->type == SYSPROF_CAPTURE_FRAME_CTRSET)
     {
-      SysprofCaptureFrameCounterSet *ctrset = (SysprofCaptureFrameCounterSet *)frame;
+      SysprofCaptureCounterSet *ctrset = (SysprofCaptureCounterSet *)frame;
 
       for (guint i = 0; i < ctrset->n_values; i++)
         {
diff --git a/src/libsysprof-ui/sysprof-visualizer-list.c b/src/libsysprof-ui/sysprof-visualizer-list.c
index 4b9e021..51815d7 100644
--- a/src/libsysprof-ui/sysprof-visualizer-list.c
+++ b/src/libsysprof-ui/sysprof-visualizer-list.c
@@ -229,7 +229,7 @@ discover_new_rows_frame_cb (const SysprofCaptureFrame *frame,
     }
   else if (frame->type == SYSPROF_CAPTURE_FRAME_CTRDEF)
     {
-      const SysprofCaptureFrameCounterDefine *def = (const SysprofCaptureFrameCounterDefine *)frame;
+      const SysprofCaptureCounterDefine *def = (const SysprofCaptureCounterDefine *)frame;
 
       for (guint i = 0; i < def->n_counters; i++)
         {
diff --git a/src/tests/test-capture.c b/src/tests/test-capture.c
index daa25c1..0094ab6 100644
--- a/src/tests/test-capture.c
+++ b/src/tests/test-capture.c
@@ -216,7 +216,7 @@ test_reader_basic (void)
   sysprof_capture_writer_flush (writer);
 
   {
-    const SysprofCaptureFrameCounterDefine *def;
+    const SysprofCaptureCounterDefine *def;
 
     def = sysprof_capture_reader_read_counter_define (reader);
     g_assert (def != NULL);
@@ -247,7 +247,7 @@ test_reader_basic (void)
 
   for (i = 0; i < 1000; i++)
     {
-      const SysprofCaptureFrameCounterSet *set;
+      const SysprofCaptureCounterSet *set;
 
       set = sysprof_capture_reader_read_counter_set (reader);
       g_assert (set != NULL);
diff --git a/src/tools/sysprof-cat.c b/src/tools/sysprof-cat.c
index e236990..b9c5ae9 100644
--- a/src/tools/sysprof-cat.c
+++ b/src/tools/sysprof-cat.c
@@ -344,7 +344,7 @@ main (gint   argc,
 
             case SYSPROF_CAPTURE_FRAME_CTRDEF:
               {
-                const SysprofCaptureFrameCounterDefine *frame;
+                const SysprofCaptureCounterDefine *frame;
 
                 if (!(frame = sysprof_capture_reader_read_counter_define (reader)))
                   goto panic;
@@ -380,7 +380,7 @@ main (gint   argc,
 
             case SYSPROF_CAPTURE_FRAME_CTRSET:
               {
-                const SysprofCaptureFrameCounterSet *frame;
+                const SysprofCaptureCounterSet *frame;
 
                 if (!(frame = sysprof_capture_reader_read_counter_set (reader)))
                   goto panic;
diff --git a/src/tools/sysprof-dump.c b/src/tools/sysprof-dump.c
index 270bf65..c17efb0 100644
--- a/src/tools/sysprof-dump.c
+++ b/src/tools/sysprof-dump.c
@@ -189,7 +189,7 @@ main (gint argc,
 
         case SYSPROF_CAPTURE_FRAME_CTRDEF:
           {
-            const SysprofCaptureFrameCounterDefine *def = sysprof_capture_reader_read_counter_define 
(reader);
+            const SysprofCaptureCounterDefine *def = sysprof_capture_reader_read_counter_define (reader);
             guint i;
 
             g_print ("NEW COUNTERS: pid=%d time=%"G_GINT64_FORMAT"\n", def->frame.pid, def->frame.time);
@@ -211,7 +211,7 @@ main (gint argc,
 
         case SYSPROF_CAPTURE_FRAME_CTRSET:
           {
-            const SysprofCaptureFrameCounterSet *set = sysprof_capture_reader_read_counter_set (reader);
+            const SysprofCaptureCounterSet *set = sysprof_capture_reader_read_counter_set (reader);
             guint i;
 
             g_print ("SET COUNTERS: pid=%d time=%"G_GINT64_FORMAT"\n", set->frame.pid, set->frame.time);


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