libsysprof-analyze: introduce SysprofDocumentLoader

and thereby make a bunch of the exposed API on SysprofDocument private.
Instead we'll push some of that to the loader but for now the tests can
keep doing what their doing using the private API.

The goal here is to not expose a SysprofDocument pointer until the document
has been loaded and symbolized via the loader API. Then we can lookup
symbols directly from the document w/o intermediary objects.
This commit is contained in:
Christian Hergert
2023-05-12 15:38:16 -07:00
parent 9f6e16e373
commit 3350ad61eb
12 changed files with 543 additions and 49 deletions

View File

@ -35,22 +35,6 @@ G_BEGIN_DECLS
SYSPROF_AVAILABLE_IN_ALL
G_DECLARE_FINAL_TYPE (SysprofDocument, sysprof_document, SYSPROF, DOCUMENT, GObject)
SYSPROF_AVAILABLE_IN_ALL
SysprofDocument *sysprof_document_new (const char *filename,
GError **error);
SYSPROF_AVAILABLE_IN_ALL
SysprofDocument *sysprof_document_new_from_fd (int capture_fd,
GError **error);
SYSPROF_AVAILABLE_IN_ALL
void sysprof_document_symbolize_async (SysprofDocument *self,
SysprofSymbolizer *symbolizer,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
SYSPROF_AVAILABLE_IN_ALL
SysprofDocumentSymbols *sysprof_document_symbolize_finish (SysprofDocument *self,
GAsyncResult *result,
GError **error);
SYSPROF_AVAILABLE_IN_ALL
SysprofDocumentFile *sysprof_document_lookup_file (SysprofDocument *self,
const char *path);