libsysprof-analyze: include time as fractions for marks

This allows more easily calculating the horizontal position of marks and
their duration from charts.
This commit is contained in:
Christian Hergert
2023-06-15 16:14:32 -07:00
parent 7568c31fcf
commit 6dcb5e5fdd
5 changed files with 73 additions and 22 deletions

View File

@ -42,11 +42,24 @@ struct _SysprofDocumentFrameClass
GObjectClass parent_class;
};
struct _SysprofDocumentMark
{
SysprofDocumentFrame parent_instance;
double begin_fraction;
double end_fraction;
};
struct _SysprofDocumentMarkClass
{
SysprofDocumentFrameClass parent_class;
};
SysprofDocumentFrame *_sysprof_document_frame_new (GMappedFile *mapped,
const SysprofCaptureFrame *frame,
guint16 frame_len,
gboolean needs_swap,
gint64 clock_at_start);
gint64 begin_time,
gint64 end_time);
#define SYSPROF_DOCUMENT_FRAME_ENDPTR(obj) \
(&((const guint8 *)SYSPROF_DOCUMENT_FRAME(obj)->frame)[SYSPROF_DOCUMENT_FRAME(obj)->frame_len])