Skip to content

Commit

Permalink
test: Convert tick-* probes to ioctl:entry for more tests
Browse files Browse the repository at this point in the history
There are currently reliability issues in the kernel for tick-* probes.
Meanwhile, many tests have historically relied on tick-* for test
construction, even though they simply needed any probe to fire "many
times" -- which probe fires is immaterial to the test.

In patches
    80a539a test: Account for unreliable tick firing
    8b98970 test: Fix race condition in many-fire tests
many tests were converted from tick-* probes to ioctl:entry probes (and
adding the appropriate trigger).  Not all tests that "incidentally" use
tick-* probes were converted, to mitigate disruption to the test suite and
because many tests do not use tick-* very aggressively.

Nevertheless, a few more tests have been failing egregiously in extensive
testing due to this problem.  They use tick-* "moderately" (e.g., one or more
dozen times).

Convert more tests from tick-* to ioctl:entry.

Signed-off-by: Eugene Loh <eugene.loh@oracle.com>
Reviewed-by: Kris Van Hees <kris.van.hees@oracle.com>
  • Loading branch information
euloh authored and kvanhees committed May 24, 2023
1 parent 07a56e2 commit fd7f8e4
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 36 deletions.
18 changes: 10 additions & 8 deletions test/unittest/aggs/tst.lquantzero.d
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
/*
* Oracle Linux DTrace.
* Copyright (c) 2006, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2006, 2023, 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.
*/
/* @@trigger: bogus-ioctl */

#pragma D option quiet

Expand All @@ -14,20 +15,21 @@ BEGIN
val = (-a * b) + a;
}

tick-1ms
syscall::ioctl:entry
/pid == $target/
{
incr = val % b;
val += a;
}

tick-1ms
/val == 0/
syscall::ioctl:entry
/pid == $target && val == 0/
{
val += a;
}

tick-1ms
/incr != 0/
syscall::ioctl:entry
/pid == $target && incr != 0/
{
i++;
@one[i] = lquantize(0, 10, 20, 1, incr);
Expand All @@ -39,8 +41,8 @@ tick-1ms
@seven[i] = lquantize(0, -10, -2, 1, incr);
}

tick-1ms
/incr == 0/
syscall::ioctl:entry
/pid == $target && incr == 0/
{
printf("Zero below the range:\n");
printa(@one);
Expand Down
18 changes: 10 additions & 8 deletions test/unittest/aggs/tst.negorder.d
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
/*
* Oracle Linux DTrace.
* Copyright (c) 2006, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2006, 2023, 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.
*/
/* @@trigger: bogus-ioctl */

#pragma D option quiet

Expand All @@ -14,20 +15,21 @@ BEGIN
val = (-a * b) + a;
}

tick-1ms
syscall::ioctl:entry
/pid == $target/
{
incr = val % b;
val += a;
}

tick-1ms
/val == 0/
syscall::ioctl:entry
/pid == $target && val == 0/
{
val += a;
}

tick-1ms
/incr != 0/
syscall::ioctl:entry
/pid == $target && incr != 0/
{
i++;
@quanty[i] = quantize(1, incr);
Expand All @@ -37,8 +39,8 @@ tick-1ms
@minny[i] = min(incr);
}

tick-1ms
/incr == 0/
syscall::ioctl:entry
/pid == $target && incr == 0/
{
printf("Ordering of quantize() with some negative weights:\n");
printa(@quanty);
Expand Down
10 changes: 6 additions & 4 deletions test/unittest/funcs/substr/tst.substrminate.d
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
/*
* Oracle Linux DTrace.
* Copyright (c) 2008, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2023, 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.
*/
/* @@trigger: bogus-ioctl */

#pragma D option quiet
#pragma D option aggsortkey
Expand All @@ -13,13 +14,14 @@
* substr() subroutine.
*/

tick-1ms
/i++ > 10/
syscall::ioctl:entry
/pid == $target && i++ > 10/
{
exit(0);
}

tick-1ms
syscall::ioctl:entry
/pid == $target/
{
@[substr((i & 1) ? "Bryan is smart" : "he's not a dummy", 0,
(i & 1) ? 8 : 18)] = count();
Expand Down
11 changes: 6 additions & 5 deletions test/unittest/funcs/tst.basename.d
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
/*
* Oracle Linux DTrace.
* Copyright (c) 2006, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2006, 2023, 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.
*/
/* @@trigger: bogus-ioctl */

#pragma D option quiet

Expand Down Expand Up @@ -41,8 +42,8 @@ BEGIN
printf("#!/bin/bash\n\n");
}

tick-1ms
/i < end/
syscall::ioctl:entry
/pid == $target && i < end/
{
printf("if [ `basename \"%s\"` != \"%s\" ]; then\n",
dir[i], basename(dir[i]));
Expand All @@ -59,8 +60,8 @@ tick-1ms
i++;
}

tick-1ms
/i == end/
syscall::ioctl:entry
/pid == $target && i == end/
{
exit(0);
}
10 changes: 6 additions & 4 deletions test/unittest/multiaggs/tst.sort.d
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
/*
* Oracle Linux DTrace.
* Copyright (c) 2006, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2006, 2023, 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.
*/
/* @@trigger: bogus-ioctl */

#pragma D option quiet

tick-1ms
syscall::ioctl:entry
/pid == $target/
{
i++;
@a[i] = sum(100 - (i / 2));
Expand All @@ -16,8 +18,8 @@ tick-1ms
@d[i] = sum(100 - (i / 16));
}

tick-1ms
/i == 100/
syscall::ioctl:entry
/pid == $target && i == 100/
{
printa("%10d %@10d %@10d %@10d %@10d\n", @a, @b, @c, @d);
printa("%10d %@10d %@10d %@10d %@10d\n", @d, @c, @b, @a);
Expand Down
15 changes: 8 additions & 7 deletions test/unittest/multiaggs/tst.sortpos.d
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
/*
* Oracle Linux DTrace.
* Copyright (c) 2006, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2006, 2023, 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.
*/
/* @@trigger: bogus-ioctl */

#pragma D option quiet

Expand All @@ -12,8 +13,8 @@ BEGIN
j = 0;
}

tick-1ms
/i < 100/
syscall::ioctl:entry
/pid == $target && i < 100/
{
i++;
@a[i] = sum(i);
Expand All @@ -22,8 +23,8 @@ tick-1ms
@d[i] = sum((75 + i) % 100);
}

tick-1ms
/i == 100 && j < 10/
syscall::ioctl:entry
/pid == $target && i == 100 && j < 10/
{
printf("Sorted at position %d:\n", j);
setopt("aggsortpos", lltostr(j));
Expand All @@ -32,8 +33,8 @@ tick-1ms
j++;
}

tick-1ms
/i == 100 && j == 10/
syscall::ioctl:entry
/pid == $target && i == 100 && j == 10/
{
exit(0);
}

0 comments on commit fd7f8e4

Please sign in to comment.