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;
|
GObject parent;
|
||||||
GMappedFile *mapped_file;
|
GMappedFile *mapped_file;
|
||||||
const SysprofCaptureFrame *frame;
|
const SysprofCaptureFrame *frame;
|
||||||
|
gint64 time_offset;
|
||||||
guint32 frame_len : 16;
|
guint32 frame_len : 16;
|
||||||
guint32 needs_swap : 1;
|
guint32 needs_swap : 1;
|
||||||
guint32 padding : 15;
|
guint32 padding : 15;
|
||||||
guint32 time_offset;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _SysprofDocumentFrameClass
|
struct _SysprofDocumentFrameClass
|
||||||
|
|||||||
@ -147,7 +147,6 @@ _sysprof_document_frame_new (GMappedFile *mapped_file,
|
|||||||
gint64 end_time)
|
gint64 end_time)
|
||||||
{
|
{
|
||||||
SysprofDocumentFrame *self;
|
SysprofDocumentFrame *self;
|
||||||
gint64 time_offset;
|
|
||||||
GType gtype;
|
GType gtype;
|
||||||
|
|
||||||
switch (frame->type)
|
switch (frame->type)
|
||||||
@ -220,10 +219,7 @@ _sysprof_document_frame_new (GMappedFile *mapped_file,
|
|||||||
self->frame_len = frame_len;
|
self->frame_len = frame_len;
|
||||||
self->needs_swap = !!needs_swap;
|
self->needs_swap = !!needs_swap;
|
||||||
|
|
||||||
time_offset = CLAMP (sysprof_document_frame_get_time (self) - begin_time, 0, G_MAXINT64);
|
self->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;
|
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user