mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
libsysprof-analyze: give access to memory maps from process
And add it to test tool to ensure it works.
This commit is contained in:
@ -47,10 +47,24 @@ main (int argc,
|
||||
for (guint i = 0; i < n_items; i++)
|
||||
{
|
||||
g_autoptr(SysprofDocumentProcess) process = g_list_model_get_item (processes, i);
|
||||
g_autoptr(GListModel) memory_maps = sysprof_document_process_list_memory_maps (process);
|
||||
guint n_maps;
|
||||
|
||||
g_print ("%d: %s\n",
|
||||
sysprof_document_frame_get_pid (SYSPROF_DOCUMENT_FRAME (process)),
|
||||
sysprof_document_process_get_command_line (process));
|
||||
|
||||
n_maps = g_list_model_get_n_items (memory_maps);
|
||||
|
||||
for (guint j = 0; j < n_maps; j++)
|
||||
{
|
||||
g_autoptr(SysprofDocumentMmap) map = g_list_model_get_item (memory_maps, j);
|
||||
|
||||
g_print (" [0x%"G_GINT64_MODIFIER"x:0x%"G_GINT64_MODIFIER"x] %s\n",
|
||||
sysprof_document_mmap_get_start_address (map),
|
||||
sysprof_document_mmap_get_end_address (map),
|
||||
sysprof_document_mmap_get_file (map));
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user