test: Handle dtrace:::ERROR arg3 specially
PATCH v2 24/38 test: Handle dtrace:::ERROR arg3 specially
From: Eugene Loh <[email protected]>
The ERROR probe's arg3 reports the culprit PC, whose value can vary with minor implementation changes. On the one hand, we do not want tests to be overly sensitive to this value. On the other hand, we do at least want to check the value is reasonable.
Therefore:
*) Change tests that dump ERROR's args to omit arg3.
*) Add a new test that checks that ERROR's arg3 is reasonable.
Signed-off-by Eugene Loh <[email protected]>
--- test/unittest/error/tst.DTRACEFLT_UNKNOWN.d | 6 +- test/unittest/error/tst.DTRACEFLT_UNKNOWN.r | 2 +- .../regression/tst.DTRACEFLT_BADADDR.d_path.d | 8 +- .../regression/tst.DTRACEFLT_BADADDR.d_path.r | 2 +- test/unittest/variables/bvar/tst.arg3-ERROR.d | 92 +++++++++++++++++++ 5 files changed, 101 insertions(+), 9 deletions(-) create mode 100644 test/unittest/variables/bvar/tst.arg3-ERROR.d
test/unittest/error/tst.DTRACEFLT_UNKNOWN.d +3 -3
@@ -1,6 +1,6 @@ /* * Oracle Linux DTrace. - * Copyright (c) 2006, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2024, Oracle and/or its affiliates. All rights reserved. * Licensed under the Universal Permissive License v 1.0 as shown at * http://oss.oracle.com/licenses/upl. */
@@ -19,8 +19,8 @@ ERROR { - printf("The arguments are %u %u %u %u %u\n", - arg1, arg2, arg3, arg4, arg5); + printf("The arguments are %u %u PC %u %u\n", + arg1, arg2, arg4, arg5); printf("The value of arg4 = %u\n", DTRACEFLT_UNKNOWN); exit(0); }
test/unittest/error/tst.DTRACEFLT_UNKNOWN.r +1 -1
@@ -1,4 +1,4 @@ -The arguments are 2 2 4 1 64 +The arguments are 2 2 PC 1 64 The value of arg4 = 0 -- @@stderr --
test/unittest/regression/tst.DTRACEFLT_BADADDR.d_path.d +4 -4
@@ -1,10 +1,10 @@ /* * Oracle Linux DTrace. - * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. * Licensed under the Universal Permissive License v 1.0 as shown at * http://oss.oracle.com/licenses/upl. */ -/* @@xfail: dtv2 */ +/* @@xfail: dtv2 d_path */ /* * ASSERTION:
@@ -18,8 +18,7 @@ ERROR { - printf("The arguments are %u %u %u %u %u\n", - arg1, arg2, arg3, arg4, arg5); + printf("The arguments are %u %u PC %u %u\n", arg1, arg2, arg4, arg5); printf("The value of arg4 should be %u\n", DTRACEFLT_BADADDR); printf("The value of arg5 should be %u\n", 0x18); exit(0);
@@ -29,4 +28,5 @@ BEGIN { d = d_path((struct path *)0x18); trace(d); + exit(1); }
test/unittest/regression/tst.DTRACEFLT_BADADDR.d_path.r +1 -1
@@ -1,4 +1,4 @@ -The arguments are 2 1 28 1 24 +The arguments are 2 1 PC 1 24 The value of arg4 should be 1 The value of arg5 should be 24
test/unittest/variables/bvar/tst.arg3-ERROR.d new file +92 -0
92 lines not on this page · raw message
Signature · 1 line
2.43.5
PATCH v2 25/38 test: Clean up tests still expecting obsolete "at DIF offset NN"
From: Eugene Loh <[email protected]>
Also, the numbering of EPIDs has changed.
Signed-off-by Eugene Loh <[email protected]>
Reviewed-by Kris Van Hees <[email protected]>
--- test/demo/dtrace/error.d | 1 - test/demo/dtrace/error.r | 2 +- test/unittest/assocs/tst.invalidref.r | 4 ++-- test/unittest/drops/drp.DTRACEDROP_DBLERROR.r | 2 +- test/unittest/error/tst.DTRACEFLT_UNKNOWN.d | 1 - test/unittest/error/tst.DTRACEFLT_UNKNOWN.r | 4 ++-- test/unittest/error/tst.DTRACEFLT_UNKNOWN.sparc64.r | 5 ----- test/unittest/pointers/err.BadAlign.d | 1 - test/unittest/pointers/err.BadAlign.r | 2 +- test/unittest/pointers/err.InvalidAddress2.d | 1 - test/unittest/pointers/err.InvalidAddress2.r | 2 +- test/unittest/pointers/err.InvalidAddress3.r | 2 +- test/unittest/pointers/err.InvalidAddress4.d | 1 - test/unittest/pointers/err.InvalidAddress4.r | 2 +- test/unittest/regression/tst.DTRACEFLT_BADADDR.d_path.r | 4 ++-- 15 files changed, 12 insertions(+), 22 deletions(-) delete mode 100644 test/unittest/error/tst.DTRACEFLT_UNKNOWN.sparc64.r
test/demo/dtrace/error.d +0 -1
@@ -5,7 +5,6 @@ * http://oss.oracle.com/licenses/upl. */ -/* @@xfail: dtv2 */ /* @@trigger: none */ BEGIN
test/demo/dtrace/error.r +1 -1
@@ -3,4 +3,4 @@ -- @@stderr -- dtrace: script 'test/demo/dtrace/error.d' matched 2 probes -dtrace: error on enabled probe ID 1 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at DIF offset 16 at BPF pc NNN +dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN
test/unittest/assocs/tst.invalidref.r +2 -2
@@ -1,4 +1,4 @@ -- @@stderr -- -dtrace: error on enabled probe ID (ID: profile:::tick-1s): invalid address ({ptr}) in action #2 at DIF offset 64 at BPF pc NNN -dtrace: error on enabled probe ID (ID: profile:::tick-1s): invalid address ({ptr}) in action #2 at DIF offset 64 at BPF pc NNN +dtrace: error on enabled probe ID (ID: profile:::tick-1s): invalid address ({ptr}) in action #2 at BPF pc NNN +dtrace: error on enabled probe ID (ID: profile:::tick-1s): invalid address ({ptr}) in action #2 at BPF pc NNN
test/unittest/drops/drp.DTRACEDROP_DBLERROR.r +1 -1
@@ -4,4 +4,4 @@ -- @@stderr -- dtrace: script 'test/unittest/drops/drp.DTRACEDROP_DBLERROR.d' matched 3 probes dtrace: [DTRACEDROP_DBLERROR] 1 error in ERROR probe enabling -dtrace: error on enabled probe ID 1 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at DIF offset 16 at BPF pc NNN +dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN
test/unittest/error/tst.DTRACEFLT_UNKNOWN.d +0 -1
@@ -4,7 +4,6 @@ * Licensed under the Universal Permissive License v 1.0 as shown at * http://oss.oracle.com/licenses/upl. */ -/* @@xfail: dtv2 */ /* * ASSERTION:
test/unittest/error/tst.DTRACEFLT_UNKNOWN.r +2 -2
@@ -1,5 +1,5 @@ -The arguments are 2 2 PC 1 64 +The arguments are 3 1 PC 1 64 The value of arg4 = 0 -- @@stderr -- -dtrace: error on enabled probe ID 2 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #2 at DIF offset 4 at BPF pc NNN +dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN
test/unittest/error/tst.DTRACEFLT_UNKNOWN.sparc64.r deleted +0 -5
@@ -1,5 +0,0 @@ -The arguments are 2 2 4 1 0 -The value of arg4 = 0 - --- @@stderr -- -dtrace: error on enabled probe ID 2 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #2 at DIF offset 4
test/unittest/pointers/err.BadAlign.d +0 -1
@@ -4,7 +4,6 @@ * Licensed under the Universal Permissive License v 1.0 as shown at * http://oss.oracle.com/licenses/upl. */ -/* @@xfail: dtv2 */ /* * ASSERTION: This test reproduces the alignment error.
test/unittest/pointers/err.BadAlign.r +1 -1
@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 1 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #2 at DIF offset 4 +dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN
test/unittest/pointers/err.InvalidAddress2.d +0 -1
@@ -4,7 +4,6 @@ * Licensed under the Universal Permissive License v 1.0 as shown at * http://oss.oracle.com/licenses/upl. */ -/* @@xfail: dtv2 */ /* * ASSERTION: D pointers do not allow invalid pointer accesses.
test/unittest/pointers/err.InvalidAddress2.r +1 -1
@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 1 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #4 at DIF offset 8 +dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN
test/unittest/pointers/err.InvalidAddress3.r +1 -1
@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 1 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #2 at DIF offset 8 +dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN
test/unittest/pointers/err.InvalidAddress4.d +0 -1
@@ -4,7 +4,6 @@ * Licensed under the Universal Permissive License v 1.0 as shown at * http://oss.oracle.com/licenses/upl. */ -/* @@xfail: dtv2 */ /* * ASSERTION: Demonstrating valid memory access.
test/unittest/pointers/err.InvalidAddress4.r +1 -1
@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 1 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #4 at DIF offset 8 +dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN
test/unittest/regression/tst.DTRACEFLT_BADADDR.d_path.r +2 -2
@@ -1,6 +1,6 @@ -The arguments are 2 1 PC 1 24 +The arguments are 3 1 PC 1 24 The value of arg4 should be 1 The value of arg5 should be 24 -- @@stderr -- -dtrace: error on enabled probe ID 2 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at DIF offset 28 at BPF pc NNN +dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN
Signature · 1 line
2.43.5