Commit 92a08bb2 authored by Pavel Emelyanov's avatar Pavel Emelyanov Committed by Cyrill Gorcunov

crtools: Show shmem dump file contents

Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@gmail.com>
parent 8b80bba7
...@@ -149,6 +149,35 @@ err: ...@@ -149,6 +149,35 @@ err:
return; return;
} }
static void show_shmem(struct cr_fdset *cr_fdset)
{
struct shmem_entry e;
int fd_shmem, ret;
pr_info("\n");
pr_info("CR_FD_SHMEM: %s\n", cr_fdset->desc[CR_FD_SHMEM].name);
pr_info("----------------------------------------\n");
fd_shmem = cr_fdset->desc[CR_FD_SHMEM].fd;
lseek(fd_shmem, MAGIC_OFFSET, SEEK_SET);
while (1) {
ret = read(fd_shmem, &e, sizeof(e));
if (!ret)
goto err;
if (ret != sizeof(e)) {
pr_perror("Can't read fdinfo entry");
goto err;
}
pr_info("0x%lx-0x%lx id %lu\n", e.start, e.end, e.shmid);
}
err:
pr_info("----------------------------------------\n");
}
static void show_files(struct cr_fdset *cr_fdset) static void show_files(struct cr_fdset *cr_fdset)
{ {
struct fdinfo_entry e; struct fdinfo_entry e;
...@@ -467,6 +496,7 @@ int cr_show(unsigned long pid, struct cr_options *opts) ...@@ -467,6 +496,7 @@ int cr_show(unsigned long pid, struct cr_options *opts)
show_pipes(cr_fdset); show_pipes(cr_fdset);
show_files(cr_fdset); show_files(cr_fdset);
show_shmem(cr_fdset);
if (opts->leader_only) if (opts->leader_only)
break; break;
......
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