diff --git a/cr-dump.c b/cr-dump.c index 9eaa774ed..0f90d55be 100644 --- a/cr-dump.c +++ b/cr-dump.c @@ -463,12 +463,11 @@ err: return ret; } -static int dump_task_mm(struct parasite_ctl *ctl, const struct proc_pid_stat *stat, +static int dump_task_mm(pid_t pid, const struct proc_pid_stat *stat, const struct parasite_dump_misc *misc, const struct cr_fdset *fdset) { MmEntry mme = MM_ENTRY__INIT; int ret = -1; - pid_t pid = ctl->pid.real; mme.mm_start_code = stat->start_code; mme.mm_end_code = stat->end_code; @@ -644,15 +643,13 @@ int dump_thread_core(int pid, CoreEntry *core, const struct parasite_dump_thread return ret; } -static int dump_task_core_all(struct parasite_ctl *ctl, - CoreEntry *core, +static int dump_task_core_all(pid_t pid, CoreEntry *core, const struct proc_pid_stat *stat, const struct parasite_dump_misc *misc, const struct cr_fdset *cr_fdset) { int fd_core = fdset_fd(cr_fdset, CR_FD_CORE); int ret = -1; - pid_t pid = ctl->pid.real; pr_info("\n"); pr_info("Dumping core (pid: %d)\n", pid); @@ -1500,13 +1497,13 @@ static int dump_one_task(struct pstree_item *item) goto err_cure; } - ret = dump_task_mm(parasite_ctl, &pps_buf, &misc, cr_fdset); + ret = dump_task_mm(pid, &pps_buf, &misc, cr_fdset); if (ret) { pr_err("Dump mm (pid: %d) failed with %d\n", pid, ret); goto err_cure; } - ret = dump_task_core_all(parasite_ctl, item->core[0], &pps_buf, &misc, cr_fdset); + ret = dump_task_core_all(pid, item->core[0], &pps_buf, &misc, cr_fdset); if (ret) { pr_err("Dump core (pid: %d) failed with %d\n", pid, ret); goto err_cure;