libsysprof: externalize access to frames array

This can be useful to optimize some walking paths in other layers.
This commit is contained in:
Christian Hergert
2023-08-14 15:05:25 -07:00
parent ffcd9e4cae
commit 45f08e07c9
2 changed files with 15 additions and 6 deletions

View File

@ -28,6 +28,12 @@
G_BEGIN_DECLS
typedef struct _SysprofDocumentFramePointer
{
guint64 offset : 48;
guint64 length : 16;
} SysprofDocumentFramePointer;
typedef struct _SysprofDocumentTimedValue
{
gint64 time;
@ -74,5 +80,6 @@ SysprofSymbol *_sysprof_document_thread_symbol (SysprofDocument *self,
int pid,
int tid);
SysprofSymbol *_sysprof_document_kernel_symbol (SysprofDocument *self);
GArray *_sysprof_document_get_frames (SysprofDocument *self);
G_END_DECLS

View File

@ -106,12 +106,6 @@ struct _SysprofDocument
guint needs_swap : 1;
};
typedef struct _SysprofDocumentFramePointer
{
guint64 offset : 48;
guint64 length : 16;
} SysprofDocumentFramePointer;
enum {
PROP_0,
PROP_ALLOCATIONS,
@ -2676,3 +2670,11 @@ sysprof_document_save_finish (SysprofDocument *self,
return g_task_propagate_boolean (G_TASK (result), error);
}
GArray *
_sysprof_document_get_frames (SysprofDocument *self)
{
g_return_val_if_fail (SYSPROF_IS_DOCUMENT (self), NULL);
return g_array_ref (self->frames);
}