Commit b840ce4a authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov

restore: attach to threads of the root task in case of rst_sibling

In case of rst_sibling, we are tracing the root task, but we are tracing
only the leader thread, so we must attach to other threads to stop them.
Reported-by: 's avatarRoss Boucher <rboucher@gmail.com>
Cc: Ross Boucher <rboucher@gmail.com>
Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
Tested-by: 's avatarRoss Boucher <rboucher@gmail.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent cefe22bd
...@@ -1594,7 +1594,7 @@ static int attach_to_tasks(bool root_seized, enum trace_flags *flag) ...@@ -1594,7 +1594,7 @@ static int attach_to_tasks(bool root_seized, enum trace_flags *flag)
for (i = 0; i < item->nr_threads; i++) { for (i = 0; i < item->nr_threads; i++) {
pid = item->threads[i].real; pid = item->threads[i].real;
if (item != root_item || !root_seized) { if (item != root_item || !root_seized || i != 0) {
if (ptrace(PTRACE_ATTACH, pid, 0, 0)) { if (ptrace(PTRACE_ATTACH, pid, 0, 0)) {
pr_perror("Can't attach to %d", pid); pr_perror("Can't attach to %d", pid);
return -1; return -1;
......
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