1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-03-28 02:50:41 +03:00

tests: sysrq only when stuck with no output.

If we are stuck in user for too long without output,
grab kernel stack traces.
If we just produce too many lines of output, it's
not probably kernel related bug.
This commit is contained in:
Zdenek Kabelac 2013-12-05 12:32:27 +01:00
parent c7b733cd6c
commit b494881e68

View File

@ -406,11 +406,18 @@ static void run(int i, char *f) {
if ((fullbuffer && fullbuffer++ == 8000) ||
(no_write > 180 * 2)) /* a 3 minute timeout */
{
system("echo t > /proc/sysrq-trigger");
timeout:
kill(pid, SIGINT);
sleep(5); /* wait a bit for a reaction */
if ((w = waitpid(pid, &st, WNOHANG)) == 0) {
if (no_write > 180 * 2)
/*
* Kernel traces needed, when stuck for
* too long in userspace without producing
* any output, in other case it should be
* user space problem
*/
system("echo t > /proc/sysrq-trigger");
collect_debug = 1;
kill(-pid, SIGKILL);
w = pid; // waitpid(pid, &st, NULL);