To find a thread ID that crashed crash-worker checked if
/proc/<pid>/tasks/<pid>/wchan contains pipe_wait or do_coredump.
Additionally it should check if pipe_write is there, because since
kernel 5.10 this content is for the thread that crashed.
Change-Id: Ic45913306d4f5b39ae704abdd58bbd79fef5e7cd
buf[cnt] = 0;
close(fd);
- if (strncmp("do_coredump", buf, sizeof(buf)) == 0 || strncmp("pipe_wait", buf, sizeof(buf)) == 0)
+ if (strncmp("do_coredump", buf, sizeof(buf)) == 0 ||
+ strncmp("pipe_wait", buf, sizeof(buf)) == 0 ||
+ strncmp("pipe_write", buf, sizeof(buf)) == 0)
return tid;
else
- return 0;
+ return -1;
}
/**