Skip to content

Commit

Permalink
test: Convert tick-* probes to BEGIN probes for count-not-quiet test
Browse files Browse the repository at this point in the history
The tick-* mechanism can be fickle on some platforms.  Do not use
it for this test, which is intended simply to check that aggregations
do not result in data-recording actions.

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 fe7148f commit bd521b5
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 11 deletions.
32 changes: 23 additions & 9 deletions test/unittest/aggs/tst.count_notquiet.d
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Oracle Linux DTrace.
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021, 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.
*/
Expand All @@ -11,11 +11,25 @@
* SECTION: Aggregations/Aggregations
*/

tick-100ms
{
@a = count();
}
tick-1005ms
{
exit(0);
}
/* three default actions */
BEGIN { }
BEGIN { }
BEGIN { }

/* one explicit action */
BEGIN { trace("hello world"); }

/* ten non-data-recording actions */
BEGIN { @a = count(); }
BEGIN { @a = count(); }
BEGIN { @a = count(); }
BEGIN { @a = count(); }
BEGIN { @a = count(); }
BEGIN { @a = count(); }
BEGIN { @a = count(); }
BEGIN { @a = count(); }
BEGIN { @a = count(); }
BEGIN { @a = count(); }

/* exit */
BEGIN { exit(0); }
8 changes: 6 additions & 2 deletions test/unittest/aggs/tst.count_notquiet.r
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
FUNCTION:NAME
:tick-1005ms
:BEGIN
:BEGIN
:BEGIN
:BEGIN hello world
:BEGIN

10
-- @@stderr --
dtrace: script 'test/unittest/aggs/tst.count_notquiet.d' matched 2 probes
dtrace: script 'test/unittest/aggs/tst.count_notquiet.d' matched 15 probes

0 comments on commit bd521b5

Please sign in to comment.