libsysprof-analyze: make SysprofMount public API

And expose it via sysprof_document_process_list_mounts() so that when
inspecting processes we can see what binaries were mapped as well as what
the filesystem looked like to locate those mapped paths.
This commit is contained in:
Christian Hergert
2023-05-11 14:37:02 -07:00
parent 352fa617c0
commit 7c37120edf
8 changed files with 138 additions and 22 deletions

View File

@ -22,6 +22,7 @@
#include "sysprof-document-frame-private.h"
#include "sysprof-document-process-private.h"
#include "sysprof-mount.h"
struct _SysprofDocumentProcess
{
@ -110,7 +111,7 @@ sysprof_document_process_get_command_line (SysprofDocumentProcess *self)
* sysprof_document_process_list_memory_maps:
* @self: a #SysprofDocumentProcess
*
* Lists the #SysprofDocumentMmap that are associated with the document.
* Lists the #SysprofDocumentMmap that are associated with the process.
*
* Returns: (transfer full): a #GListModel of #SysprofDocumentMmap
*/
@ -125,6 +126,25 @@ sysprof_document_process_list_memory_maps (SysprofDocumentProcess *self)
return g_object_ref (G_LIST_MODEL (self->process_info->address_layout));
}
/**
* sysprof_document_process_list_mounts:
* @self: a #SysprofDocumentProcess
*
* Lists the #SysprofMount that are associated with the process.
*
* Returns: (transfer full): a #GListModel of #SysprofMount
*/
GListModel *
sysprof_document_process_list_mounts (SysprofDocumentProcess *self)
{
g_return_val_if_fail (SYSPROF_IS_DOCUMENT_PROCESS (self), NULL);
if (self->process_info == NULL)
return G_LIST_MODEL (g_list_store_new (SYSPROF_TYPE_MOUNT));
return g_object_ref (G_LIST_MODEL (self->process_info->mount_namespace));
}
void
_sysprof_document_process_set_info (SysprofDocumentProcess *self,
SysprofProcessInfo *process_info)