libsysprof-analyze: add helper for native byte order

This commit is contained in:
Christian Hergert
2023-05-03 17:07:19 -07:00
parent f550394b62
commit c0ade7da01
2 changed files with 13 additions and 4 deletions

View File

@ -24,7 +24,8 @@
G_BEGIN_DECLS
char *_sysprof_document_ref_string (SysprofDocument *self,
const char *name);
gboolean _sysprof_document_is_native (SysprofDocument *self);
char *_sysprof_document_ref_string (SysprofDocument *self,
const char *name);
G_END_DECLS

View File

@ -122,8 +122,8 @@ sysprof_document_init (SysprofDocument *self)
static gboolean
sysprof_document_load (SysprofDocument *self,
int capture_fd,
GError **error)
int capture_fd,
GError **error)
{
goffset pos;
gsize len;
@ -326,3 +326,11 @@ sysprof_document_symbolize_finish (SysprofDocument *self,
return g_task_propagate_pointer (G_TASK (result), error);
}
gboolean
_sysprof_document_is_native (SysprofDocument *self)
{
g_return_val_if_fail (SYSPROF_IS_DOCUMENT (self), FALSE);
return self->needs_swap == FALSE;
}