2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-09-04 16:25:31 +00:00

zdtm: Print /proc/locks in lock tests to investigate random failures

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Pavel Emelyanov
2015-02-25 12:44:44 +04:00
parent e10b3ef407
commit 90b2c9b472
5 changed files with 17 additions and 1 deletions

View File

@@ -85,7 +85,11 @@ static int check_file_locks()
if (!fp_locks) if (!fp_locks)
return -1; return -1;
test_msg("C: %d/%d/%d\n", inodes[0], inodes[1], inodes[2]);
while (fgets(buf, sizeof(buf), fp_locks)) { while (fgets(buf, sizeof(buf), fp_locks)) {
test_msg("c: %s", buf);
if (strstr(buf, "->")) if (strstr(buf, "->"))
continue; continue;

View File

@@ -27,7 +27,11 @@ static int check_file_locks()
if (!fp_locks) if (!fp_locks)
return -1; return -1;
test_msg("C: %d\n", pid);
while (fgets(buf, sizeof(buf), fp_locks)) { while (fgets(buf, sizeof(buf), fp_locks)) {
test_msg("c: %s", buf);
if (strstr(buf, "->")) if (strstr(buf, "->"))
continue; continue;

View File

@@ -27,7 +27,11 @@ static int check_file_locks(int alt_pid)
if (!fp_locks) if (!fp_locks)
return -1; return -1;
test_msg("C: %d/%d\n", pid, alt_pid);
while (fgets(buf, sizeof(buf), fp_locks)) { while (fgets(buf, sizeof(buf), fp_locks)) {
test_msg("c: %s", buf);
if (strstr(buf, "->")) if (strstr(buf, "->"))
continue; continue;

View File

@@ -27,7 +27,11 @@ static int check_file_locks(int alt_pid, int fd)
if (!fp_locks) if (!fp_locks)
return -1; return -1;
test_msg("C: %d/%d\n", pid, alt_pid);
while (fgets(buf, sizeof(buf), fp_locks)) { while (fgets(buf, sizeof(buf), fp_locks)) {
test_msg("c: %s", buf);
if (strstr(buf, "->")) if (strstr(buf, "->"))
continue; continue;

View File

@@ -42,7 +42,7 @@ int main(int argc, char **argv)
if (flock(fd2, LOCK_SH) == 0) if (flock(fd2, LOCK_SH) == 0)
pass(); pass();
else else
fail("Flock file locks check failed"); fail("Flock file locks check failed (%d)", errno);
close(fd); close(fd);
close(fd2); close(fd2);