diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2013-12-05 12:32:27 +0100 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2013-12-05 12:40:47 +0100 |
commit | b494881e685da3ada4a42a17a33d4fe67f3ca784 (patch) | |
tree | 285b4ded08db7eb99a2a875bebe694a3bd252852 | |
parent | c7b733cd6cbc69e4a681b17ca4e89eb9fcd6d31f (diff) | |
download | lvm2-b494881e685da3ada4a42a17a33d4fe67f3ca784.tar.gz |
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.
-rw-r--r-- | test/lib/harness.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/test/lib/harness.c b/test/lib/harness.c index 5591f7721..c4dd3daf0 100644 --- a/test/lib/harness.c +++ b/test/lib/harness.c @@ -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); |