libsysprof-analyze: treat overlay as SysprofMount

This creates a synthesized SysprofMount for the overlays so that we can
process them as we walk the other mounts.
This commit is contained in:
Christian Hergert
2023-05-22 18:36:27 -07:00
parent 754e5df789
commit 1469e8691a
5 changed files with 75 additions and 51 deletions

View File

@ -24,20 +24,6 @@
#include "sysprof-mount-private.h"
struct _SysprofMount
{
GObject parent_instance;
int mount_id;
int parent_mount_id;
int device_major;
int device_minor;
GRefString *root;
GRefString *mount_point;
GRefString *mount_source;
GRefString *filesystem_type;
GRefString *superblock_options;
};
enum {
PROP_0,
PROP_DEVICE_MAJOR,
@ -239,6 +225,27 @@ finish:
return g_steal_pointer (&self);
}
SysprofMount *
_sysprof_mount_new_for_overlay (SysprofStrings *strings,
const char *mount_point,
const char *host_path,
int layer)
{
SysprofMount *self;
g_return_val_if_fail (strings != NULL, NULL);
g_return_val_if_fail (mount_point != NULL, NULL);
g_return_val_if_fail (host_path != NULL, NULL);
self = g_object_new (SYSPROF_TYPE_MOUNT, NULL);
self->mount_point = sysprof_strings_get (strings, mount_point);
self->root = sysprof_strings_get (strings, "/");
self->mount_source = sysprof_strings_get (strings, host_path);
self->is_overlay = TRUE;
return self;
}
int
sysprof_mount_get_device_major (SysprofMount *self)
{