diff --git a/cr-dump.c b/cr-dump.c index 39afb4eb4..5ef7d611f 100644 --- a/cr-dump.c +++ b/cr-dump.c @@ -439,7 +439,7 @@ static int dump_task_mappings(pid_t pid, const struct list_head *vma_area_list, e.start = vma->start; e.end = vma->end; - e.shmid = vma_area->shmid; + e.shmid = vma_area->vma.shmid; pr_info("shmem: s: %16lx e: %16lx shmid: %16lx\n", e.start, e.end, e.shmid); diff --git a/include/crtools.h b/include/crtools.h index 62c5ce4d6..13c074861 100644 --- a/include/crtools.h +++ b/include/crtools.h @@ -151,7 +151,6 @@ void free_mappings(struct list_head *vma_area_list); struct vma_area { struct list_head list; struct vma_entry vma; - unsigned long shmid; int vm_file_fd; }; diff --git a/include/image.h b/include/image.h index 284744084..b10ce20bf 100644 --- a/include/image.h +++ b/include/image.h @@ -113,6 +113,7 @@ struct vma_entry { u64 start; u64 end; u64 pgoff; + u64 shmid; u32 prot; u32 flags; u32 status; diff --git a/include/util.h b/include/util.h index 915a3b53f..9899cca6b 100644 --- a/include/util.h +++ b/include/util.h @@ -157,7 +157,6 @@ extern void pr_vma(unsigned int loglevel, const struct vma_area *vma_area); ({ \ struct vma_area *p__ = xzalloc(sizeof(*p__)); \ if (p__) { \ - p__->shmid = -1; \ p__->vm_file_fd = -1; \ p__->vma.fd = -1; \ } \ diff --git a/proc_parse.c b/proc_parse.c index 220e4defd..f416567a0 100644 --- a/proc_parse.c +++ b/proc_parse.c @@ -135,7 +135,7 @@ int parse_maps(pid_t pid, struct list_head *vma_area_list, bool use_map_files) goto err_bogus_mapping; vma_area->vma.flags |= MAP_ANONYMOUS; vma_area->vma.status |= VMA_ANON_SHARED; - vma_area->shmid = st_buf.st_ino; + vma_area->vma.shmid = st_buf.st_ino; if (!strcmp(file_path, "/SYSV")) { pr_info("path: %s\n", file_path); @@ -153,7 +153,7 @@ int parse_maps(pid_t pid, struct list_head *vma_area_list, bool use_map_files) */ if (vma_area->vma.flags & MAP_SHARED) { vma_area->vma.status |= VMA_ANON_SHARED; - vma_area->shmid = ino; + vma_area->vma.shmid = ino; } else { vma_area->vma.status |= VMA_ANON_PRIVATE; }