[CRIU] [PATCH 1/3] criu: dump loginuid & oom_score_adj values

Andrew Vagin avagin at virtuozzo.com
Tue Dec 8 04:26:18 PST 2015


On Tue, Dec 08, 2015 at 03:22:00PM +0300, Dmitry Safonov wrote:
> On 12/08/2015 03:10 PM, Andrew Vagin wrote:
> >On Mon, Dec 07, 2015 at 05:17:08PM +0300, Dmitry Safonov wrote:
> >>https://jira.sw.ru/browse/PSBM-41993
> >>
> >>Signed-off-by: Dmitry Safonov <dsafonov at odin.com>
> >>---
> >>  cr-dump.c            | 11 +++++++++++
> >>  include/proc_parse.h |  2 ++
> >>  proc_parse.c         | 38 ++++++++++++++++++++++++++++++++++++++
> >>  protobuf/core.proto  |  5 +++++
> >>  4 files changed, 56 insertions(+)
> >>
> >>diff --git a/cr-dump.c b/cr-dump.c
> >>index 5cc375d..06cf428 100644
> >>--- a/cr-dump.c
> >>+++ b/cr-dump.c
> >>@@ -323,6 +323,15 @@ static int dump_task_rlimits(int pid, TaskRlimitsEntry *rls)
> >>  	return 0;
> >>  }
> >>+static void dump_pid_misc(pid_t pid, TaskCoreEntry *tc)
> >>+{
> >>+	pr_info("dumping /proc/%d/{oom_score_adj,loginuid}\n", pid);
> >>+	tc->loginuid = parse_pid_loginuid(pid);
> >parse_pid_loginuid can return an error. Do we have to handle it?
> It's usefull if handle dump_pid_misc ret code, below
> 
> >
> >>+	tc->has_loginuid = true;
> >>+	tc->oom_score_adj = parse_pid_oom_score_adj(pid);
> >>+	tc->has_oom_score_adj = true;
> >>+}
> >>+
> >>  static int dump_filemap(pid_t pid, struct vma_area *vma_area,
> >>  		const struct cr_imgset *imgset)
> >>  {
> >>@@ -702,6 +711,8 @@ static int dump_task_core_all(struct pstree_item *item,
> >>  	if (ret)
> >>  		goto err;
> >>+	dump_pid_misc(pid, core->tc);
> >Why do we not hanle errors of dump_pid_misc()?
> I suggest that it's not critical to stop dumping core. Is it?

In this case, we need to add a comment which will explain why it isn't
critical.

> 
> >


More information about the CRIU mailing list