crash-stack: Change "ThreadID" heuristic to work on aarch64 37/128837/1
authorKarol Lewandowski <k.lewandowsk@samsung.com>
Thu, 11 May 2017 13:47:18 +0000 (15:47 +0200)
committerKarol Lewandowski <k.lewandowsk@samsung.com>
Thu, 11 May 2017 13:47:18 +0000 (15:47 +0200)
Commit 82e3caa86 ("crash-stack: Find crashed tid by wchan")
introduced heuristic method of finding correct thread id, if
it was not passed by the kernel as parameter to crash-manager.

This commit modifies this heuristic to also consider "pipe_wait"
function in kernel to signify crashed thread.  This is what was
observed to be true on aarch64.

Change-Id: Iefa6d028f459ff9491f8e184433f913f39a096eb

src/crash-stack/crash-stack.c

index 587e9324e5ec5aa917492a9b9519cc8eae31ec90..fd7bfbf4593b421179da80c8b92d0766d7d70438 100644 (file)
@@ -854,7 +854,7 @@ static int check_thread_wchan(int pid, int tid)
        buf[cnt] = 0;
        close(fd);
 
-       if (strncmp("do_coredump", buf, sizeof(buf)) == 0)
+       if (strncmp("do_coredump", buf, sizeof(buf)) == 0 || strncmp("pipe_wait", buf, sizeof(buf)) == 0)
                return tid;
        else
                return 0;