From 625ad48dfdfa88612131728ff853a2fda38cfddc Mon Sep 17 00:00:00 2001 From: Andrey Vagin Date: Thu, 19 Dec 2013 16:59:41 +0400 Subject: [PATCH] dump: don't restore a state of threads It is not needed, because stat is a property of task, so we can restore a state of task and it should be enough. Signed-off-by: Andrey Vagin Signed-off-by: Pavel Emelyanov --- cr-dump.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cr-dump.c b/cr-dump.c index 3010c4eb8..041090e96 100644 --- a/cr-dump.c +++ b/cr-dump.c @@ -786,8 +786,10 @@ static void unseize_task_and_threads(const struct pstree_item *item, int st) { int i; - for (i = 0; i < item->nr_threads; i++) - unseize_task(item->threads[i].real, st); /* item->pid will be here */ + unseize_task(item->pid.real, st); /* item->pid will be here */ + + for (i = 1; i < item->nr_threads; i++) + ptrace(PTRACE_DETACH, item->threads[i].real, NULL, NULL); } static void pstree_switch_state(struct pstree_item *root_item, int st)