mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-11 23:51:06 +00:00
libsysprof-analyze: use pid list to load mountinfo
This commit is contained in:
@ -347,7 +347,7 @@ sysprof_document_load_mountinfo (SysprofDocument *self,
|
|||||||
g_assert (contents != NULL);
|
g_assert (contents != NULL);
|
||||||
g_assert (contents[contents_len] == 0);
|
g_assert (contents[contents_len] == 0);
|
||||||
|
|
||||||
process_info = _sysprof_document_process_info (self, pid, FALSE);
|
process_info = _sysprof_document_process_info (self, pid, TRUE);
|
||||||
|
|
||||||
g_assert (process_info != NULL);
|
g_assert (process_info != NULL);
|
||||||
g_assert (process_info->mount_namespace != NULL);
|
g_assert (process_info->mount_namespace != NULL);
|
||||||
@ -367,23 +367,26 @@ sysprof_document_load_mountinfo (SysprofDocument *self,
|
|||||||
static void
|
static void
|
||||||
sysprof_document_load_mountinfos (SysprofDocument *self)
|
sysprof_document_load_mountinfos (SysprofDocument *self)
|
||||||
{
|
{
|
||||||
GHashTableIter hiter;
|
GtkBitsetIter iter;
|
||||||
gpointer key, value;
|
guint pid;
|
||||||
|
|
||||||
g_assert (SYSPROF_IS_DOCUMENT (self));
|
g_assert (SYSPROF_IS_DOCUMENT (self));
|
||||||
|
|
||||||
g_hash_table_iter_init (&hiter, self->pid_to_process_info);
|
if (gtk_bitset_iter_init_first (&iter, self->pids, &pid))
|
||||||
while (g_hash_table_iter_next (&hiter, &key, &value))
|
|
||||||
{
|
{
|
||||||
int pid = GPOINTER_TO_INT (key);
|
do
|
||||||
g_autofree char *path = g_strdup_printf ("/proc/%d/mountinfo", pid);
|
|
||||||
g_autoptr(SysprofDocumentFile) file = sysprof_document_lookup_file (self, path);
|
|
||||||
|
|
||||||
if (file != NULL)
|
|
||||||
{
|
{
|
||||||
g_autoptr(GBytes) bytes = sysprof_document_file_dup_bytes (file);
|
g_autofree char *path = g_strdup_printf ("/proc/%u/mountinfo", pid);
|
||||||
sysprof_document_load_mountinfo (self, pid, bytes);
|
g_autoptr(SysprofDocumentFile) file = sysprof_document_lookup_file (self, path);
|
||||||
|
|
||||||
|
if (file != NULL)
|
||||||
|
{
|
||||||
|
g_autoptr(GBytes) bytes = sysprof_document_file_dup_bytes (file);
|
||||||
|
|
||||||
|
sysprof_document_load_mountinfo (self, pid, bytes);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
while (gtk_bitset_iter_next (&iter, &pid));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user