libsysprof-analyze: add document type for samples

This commit is contained in:
Christian Hergert
2023-04-25 17:10:12 -07:00
parent a47627e5b9
commit ca83cd6b40
6 changed files with 186 additions and 3 deletions

View File

@ -21,6 +21,7 @@
#include "config.h"
#include "sysprof-document-frame-private.h"
#include "sysprof-document-sample.h"
G_DEFINE_TYPE (SysprofDocumentFrame, sysprof_document_frame, G_TYPE_OBJECT)
@ -117,10 +118,13 @@ _sysprof_document_frame_new (GMappedFile *mapped_file,
guint16 frame_len,
gboolean needs_swap)
{
GType gtype = SYSPROF_TYPE_DOCUMENT_FRAME;
SysprofDocumentFrame *self;
self = g_object_new (SYSPROF_TYPE_DOCUMENT_FRAME, NULL);
if (frame->type == SYSPROF_CAPTURE_FRAME_SAMPLE)
gtype = SYSPROF_TYPE_DOCUMENT_SAMPLE;
self = g_object_new (gtype, NULL);
self->mapped_file = g_mapped_file_ref (mapped_file);
self->frame = frame;
self->frame_len = frame_len;