mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
libsysprof-analyze: remove 32-bit time_offset optimization
This simply isn't worth the memory saves for the loss of precision. Just use a 64-bit and store the actual time offset.
This commit is contained in:
@ -31,10 +31,10 @@ struct _SysprofDocumentFrame
|
||||
GObject parent;
|
||||
GMappedFile *mapped_file;
|
||||
const SysprofCaptureFrame *frame;
|
||||
gint64 time_offset;
|
||||
guint32 frame_len : 16;
|
||||
guint32 needs_swap : 1;
|
||||
guint32 padding : 15;
|
||||
guint32 time_offset;
|
||||
};
|
||||
|
||||
struct _SysprofDocumentFrameClass
|
||||
|
||||
@ -147,7 +147,6 @@ _sysprof_document_frame_new (GMappedFile *mapped_file,
|
||||
gint64 end_time)
|
||||
{
|
||||
SysprofDocumentFrame *self;
|
||||
gint64 time_offset;
|
||||
GType gtype;
|
||||
|
||||
switch (frame->type)
|
||||
@ -220,10 +219,7 @@ _sysprof_document_frame_new (GMappedFile *mapped_file,
|
||||
self->frame_len = frame_len;
|
||||
self->needs_swap = !!needs_swap;
|
||||
|
||||
time_offset = CLAMP (sysprof_document_frame_get_time (self) - begin_time, 0, G_MAXINT64);
|
||||
|
||||
/* loose precision here after about 71 minutes */
|
||||
self->time_offset = (guint)time_offset;
|
||||
self->time_offset = CLAMP (sysprof_document_frame_get_time (self) - begin_time, 0, G_MAXINT64);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user