[sysprof] capture: only use <=32 bit bit fields



commit e63c267192cd577face6bf77b67e7afb0f4041a4
Author: Christian Hergert <chergert redhat com>
Date:   Mon May 6 15:08:36 2019 -0700

    capture: only use <=32 bit bit fields

 lib/capture/sp-capture-types.h  | 12 ++++++++----
 lib/capture/sp-capture-writer.c |  9 ++++++---
 2 files changed, 14 insertions(+), 7 deletions(-)
---
diff --git a/lib/capture/sp-capture-types.h b/lib/capture/sp-capture-types.h
index 1d6cd1d..1a5c1d9 100644
--- a/lib/capture/sp-capture-types.h
+++ b/lib/capture/sp-capture-types.h
@@ -94,7 +94,8 @@ typedef struct
   gint32  pid;
   gint64  time;
   guint8  type;
-  guint64 padding : 56;
+  guint32 padding1;
+  guint32 padding2 : 24;
   guint8  data[0];
 } SpCaptureFrame;
 
@@ -125,7 +126,8 @@ typedef struct
 {
   SpCaptureFrame   frame;
   guint16          n_addrs;
-  guint64          padding : 48;
+  guint32          padding1;
+  guint32          padding2 : 16;
   SpCaptureAddress addrs[0];
 } SpCaptureSample;
 
@@ -159,7 +161,8 @@ typedef struct
 {
   SpCaptureFrame   frame;
   guint16          n_counters;
-  guint64          padding : 48;
+  guint32          padding1;
+  guint32          padding2 : 16;
   SpCaptureCounter counters[0];
 } SpCaptureFrameCounterDefine;
 
@@ -178,7 +181,8 @@ typedef struct
 {
   SpCaptureFrame         frame;
   guint16                n_values;
-  guint64                padding : 48;
+  guint32                padding1;
+  guint32                padding2 : 16;
   SpCaptureCounterValues values[0];
 } SpCaptureFrameCounterSet;
 
diff --git a/lib/capture/sp-capture-writer.c b/lib/capture/sp-capture-writer.c
index 994b34d..9cb6380 100644
--- a/lib/capture/sp-capture-writer.c
+++ b/lib/capture/sp-capture-writer.c
@@ -117,7 +117,8 @@ sp_capture_writer_frame_init (SpCaptureFrame     *frame_,
   frame_->pid = pid;
   frame_->time = time_;
   frame_->type = type;
-  frame_->padding = 0;
+  frame_->padding1 = 0;
+  frame_->padding2 = 0;
 }
 
 static void
@@ -1076,7 +1077,8 @@ sp_capture_writer_define_counters (SpCaptureWriter        *self,
                                 pid,
                                 time,
                                 SP_CAPTURE_FRAME_CTRDEF);
-  def->padding = 0;
+  def->padding1 = 0;
+  def->padding2 = 0;
   def->n_counters = n_counters;
 
   for (i = 0; i < n_counters; i++)
@@ -1137,7 +1139,8 @@ sp_capture_writer_set_counters (SpCaptureWriter             *self,
                                 pid,
                                 time,
                                 SP_CAPTURE_FRAME_CTRSET);
-  set->padding = 0;
+  set->padding1 = 0;
+  set->padding2 = 0;
   set->n_values = n_groups;
 
   for (i = 0, group = 0, field = 0; i < n_counters; i++)


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