Commit 985990de authored by Pavel Emelyanov's avatar Pavel Emelyanov Committed by Cyrill Gorcunov

crtools: Show 6 page va-s per line in [Pages] section

Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@gmail.com>
parent 92a08bb2
...@@ -27,6 +27,8 @@ ...@@ -27,6 +27,8 @@
#include "image.h" #include "image.h"
#define DEF_PAGES_PER_LINE 6
#ifndef CONFIG_X86_64 #ifndef CONFIG_X86_64
# error No x86-32 support yet # error No x86-32 support yet
#endif #endif
...@@ -283,6 +285,8 @@ static void show_core(struct cr_fdset *cr_fdset) ...@@ -283,6 +285,8 @@ static void show_core(struct cr_fdset *cr_fdset)
} }
if (final_vma_entry(&ve)) { if (final_vma_entry(&ve)) {
int ppl = 0;
pr_info("\n\t---[Pages]---\n"); pr_info("\n\t---[Pages]---\n");
while (1) { while (1) {
ret = read(fd_core, &va, sizeof(va)); ret = read(fd_core, &va, sizeof(va));
...@@ -294,7 +298,17 @@ static void show_core(struct cr_fdset *cr_fdset) ...@@ -294,7 +298,17 @@ static void show_core(struct cr_fdset *cr_fdset)
} }
if (va == 0) if (va == 0)
goto out; goto out;
pr_info("page va: %16lx\n", va);
if (ppl == 0)
pr_info("\t");
pr_info("%16lx ", va);
ppl++;
if (ppl == DEF_PAGES_PER_LINE) {
pr_info("\n");
ppl = 0;
}
lseek(fd_core, PAGE_SIZE, SEEK_CUR); lseek(fd_core, PAGE_SIZE, SEEK_CUR);
} }
} }
...@@ -305,7 +319,7 @@ static void show_core(struct cr_fdset *cr_fdset) ...@@ -305,7 +319,7 @@ static void show_core(struct cr_fdset *cr_fdset)
} }
out: out:
pr_info("----------------------------------------\n"); pr_info("\n----------------------------------------\n");
} }
static void show_pstree_from_file(int fd, char *name) static void show_pstree_from_file(int fd, char *name)
......
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