Commit a0ce7967 authored by Pavel Emelyanov's avatar Pavel Emelyanov

show: Fix -D mode showing

Threads' IDs were not initialized on img load.
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 58f0955d
......@@ -265,6 +265,7 @@ static void pstree_handler(int fd, void *obj, int collect)
{
PstreeEntry *e = obj;
struct pstree_item *item = NULL;
int i;
if (!collect)
return;
......@@ -275,12 +276,15 @@ static void pstree_handler(int fd, void *obj, int collect)
item->pid.virt = e->pid;
item->nr_threads = e->n_threads;
item->threads = xzalloc(sizeof(u32) * e->n_threads);
item->threads = xzalloc(sizeof(struct pid) * e->n_threads);
if (!item->threads) {
xfree(item);
return;
}
for (i = 0; i < item->nr_threads; i++)
item->threads[i].virt = e->threads[i];
list_add_tail(&item->sibling, &pstree_list);
}
......@@ -464,7 +468,7 @@ static int cr_show_all(struct cr_options *opts)
if (item->threads[i].virt == item->pid.virt)
continue;
fd_th = open_image_ro(CR_FD_CORE, item->threads[i]);
fd_th = open_image_ro(CR_FD_CORE, item->threads[i].virt);
if (fd_th < 0)
goto out;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment