All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH] Make crash02 verbose in standard runfile
@ 2019-12-13 13:37 Martin Doucha
  2019-12-13 16:48 ` Petr Vorel
  0 siblings, 1 reply; 4+ messages in thread
From: Martin Doucha @ 2019-12-13 13:37 UTC (permalink / raw)
  To: ltp

Verbose output from crash02 will be useful for actually reporting bugs
triggered by the test. With default verbosity level, it's difficult to figure
out which syscall arguments crashed the system even if you know the random seed
and can easily re-run `crash02 -xv 2` on a system that uses the same rand()
implementation.

Signed-off-by: Martin Doucha <mdoucha@suse.cz>
---
 runtest/crashme                |  2 +-
 testcases/misc/crash/crash02.c | 13 ++++++-------
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/runtest/crashme b/runtest/crashme
index a4c5b41cc..14750749d 100644
--- a/runtest/crashme
+++ b/runtest/crashme
@@ -7,7 +7,7 @@ f00f f00f
 crash01 crash01
 # Generate random code and execute it. Read f00f comment,
 # this test lockup SunOS,WindowsNT,etc. in seconds..
-crash02 crash02
+crash02 crash02 -v 2
 # Generate random syscalls and execute them, less probability
 # to hose your system, but still.
 mem01 mem01 -r
diff --git a/testcases/misc/crash/crash02.c b/testcases/misc/crash/crash02.c
index 00fee3493..29d05f82e 100644
--- a/testcases/misc/crash/crash02.c
+++ b/testcases/misc/crash/crash02.c
@@ -430,13 +430,12 @@ void try_one_crash(int try_num)
 	arg6 = rand_long();
 	arg7 = rand_long();
 
-	if (x_opt) {
-		if (verbose_level >= 1)
-			printf("%04d: syscall(%ld, %#lx, %#lx, %#lx, %#lx, "
-			       "%#lx, %#lx, %#lx)\n",
-			       try_num, sysno, arg1, arg2, arg3, arg4, arg5,
-			       arg6, arg7);
-	} else {
+	if (verbose_level >= 1)
+		printf("%04d: syscall(%ld, %#lx, %#lx, %#lx, %#lx, %#lx, "
+		       "%#lx, %#lx)\n", try_num, sysno, arg1, arg2, arg3,
+		       arg4, arg5, arg6, arg7);
+
+	if (!x_opt) {
 		syscall(sysno, arg1, arg2, arg3, arg4, arg5, arg6, arg7);
 		record_errno(errno);
 	}
-- 
2.24.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [LTP] [PATCH] Make crash02 verbose in standard runfile
  2019-12-13 13:37 [LTP] [PATCH] Make crash02 verbose in standard runfile Martin Doucha
@ 2019-12-13 16:48 ` Petr Vorel
  2019-12-17 11:28   ` [LTP] [PATCH v2] " Martin Doucha
  0 siblings, 1 reply; 4+ messages in thread
From: Petr Vorel @ 2019-12-13 16:48 UTC (permalink / raw)
  To: ltp

Hi Martin,

> Verbose output from crash02 will be useful for actually reporting bugs
> triggered by the test. With default verbosity level, it's difficult to figure
> out which syscall arguments crashed the system even if you know the random seed
> and can easily re-run `crash02 -xv 2` on a system that uses the same rand()
> implementation.

Reviewed-by: Petr Vorel <pvorel@suse.cz>

BTW help for -x is (and was before this patch) misleading because "hexdump
random code instead" is now for -v2 even without -x (and before it required
-v2). But that's a detail, so I'd be for merging it.

Kind regards,
Petr

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [LTP] [PATCH v2] Make crash02 verbose in standard runfile
  2019-12-13 16:48 ` Petr Vorel
@ 2019-12-17 11:28   ` Martin Doucha
  2019-12-18  7:07     ` Petr Vorel
  0 siblings, 1 reply; 4+ messages in thread
From: Martin Doucha @ 2019-12-17 11:28 UTC (permalink / raw)
  To: ltp

Verbose output from crash02 will be useful for actually reporting bugs
triggered by the test. With default verbosity level, it's difficult to figure
out which syscall arguments crashed the system even if you know the random seed
and can easily re-run `crash02 -xv 2` on a system that uses the same rand()
implementation.

Signed-off-by: Martin Doucha <mdoucha@suse.cz>
---
Changes in v2: Bring -x implementation in line with usage description.

 runtest/crashme                |  2 +-
 testcases/misc/crash/crash02.c | 13 ++++++-------
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/runtest/crashme b/runtest/crashme
index a4c5b41cc..14750749d 100644
--- a/runtest/crashme
+++ b/runtest/crashme
@@ -7,7 +7,7 @@ f00f f00f
 crash01 crash01
 # Generate random code and execute it. Read f00f comment,
 # this test lockup SunOS,WindowsNT,etc. in seconds..
-crash02 crash02
+crash02 crash02 -v 2
 # Generate random syscalls and execute them, less probability
 # to hose your system, but still.
 mem01 mem01 -r
diff --git a/testcases/misc/crash/crash02.c b/testcases/misc/crash/crash02.c
index 00fee3493..cddedc102 100644
--- a/testcases/misc/crash/crash02.c
+++ b/testcases/misc/crash/crash02.c
@@ -430,13 +430,12 @@ void try_one_crash(int try_num)
 	arg6 = rand_long();
 	arg7 = rand_long();
 
-	if (x_opt) {
-		if (verbose_level >= 1)
-			printf("%04d: syscall(%ld, %#lx, %#lx, %#lx, %#lx, "
-			       "%#lx, %#lx, %#lx)\n",
-			       try_num, sysno, arg1, arg2, arg3, arg4, arg5,
-			       arg6, arg7);
-	} else {
+	if (x_opt || verbose_level >= 1)
+		printf("%04d: syscall(%ld, %#lx, %#lx, %#lx, %#lx, %#lx, "
+		       "%#lx, %#lx)\n", try_num, sysno, arg1, arg2, arg3,
+		       arg4, arg5, arg6, arg7);
+
+	if (!x_opt) {
 		syscall(sysno, arg1, arg2, arg3, arg4, arg5, arg6, arg7);
 		record_errno(errno);
 	}
-- 
2.24.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [LTP] [PATCH v2] Make crash02 verbose in standard runfile
  2019-12-17 11:28   ` [LTP] [PATCH v2] " Martin Doucha
@ 2019-12-18  7:07     ` Petr Vorel
  0 siblings, 0 replies; 4+ messages in thread
From: Petr Vorel @ 2019-12-18  7:07 UTC (permalink / raw)
  To: ltp

Hi Martin,

> Changes in v2: Bring -x implementation in line with usage description.
Thanks for addressing this.

Patch merged.

Kind regards,
Petr

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-12-18  7:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-13 13:37 [LTP] [PATCH] Make crash02 verbose in standard runfile Martin Doucha
2019-12-13 16:48 ` Petr Vorel
2019-12-17 11:28   ` [LTP] [PATCH v2] " Martin Doucha
2019-12-18  7:07     ` Petr Vorel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.