Skip to content

Commit

Permalink
usdt: testsuite updates
Browse files Browse the repository at this point in the history
A lot of tests can be enabled now, but a lot are still XFAIL: anything
that relies on is-enabled probes, systemwide probing, globbing of USDT
probe names, or args which are non-integral are guaranteed broken.

We add one new test to make sure that you can run a probe-containing
program and then repeatedly probe it from multiple dtraces in turn
without them messing up each others' probes in any way: the probes
linger from one dtrace to the next.  (Doing it from multiple dtraces in
*parallel* may well not work yet, as no specific code has been written
to make it work: that's planned for the next phase.)

Signed-off-by: Nick Alcock <nick.alcock@oracle.com>
Reviewed-by: Kris Van Hees <kris.van.hees@oracle.com>
  • Loading branch information
nickalcock authored and kvanhees committed Oct 27, 2022
1 parent 95ac5e2 commit 7ad418c
Show file tree
Hide file tree
Showing 30 changed files with 162 additions and 52 deletions.
2 changes: 1 addition & 1 deletion test/triggers/Build
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ EXTERNAL_64BIT_TRIGGERS = testprobe readwholedir mmap bogus-ioctl open delaydie
ustack-tst-spin ustack-tst-mtspin \
visible-constructor visible-constructor-static visible-constructor-static-unstripped

# EXTERNAL_64BIT_SDT_TRIGGERS = usdt-tst-argmap usdt-tst-args usdt-tst-forker usdt-tst-special
EXTERNAL_64BIT_SDT_TRIGGERS = usdt-tst-argmap usdt-tst-args usdt-tst-forker usdt-tst-special
EXTERNAL_64BIT_TRIGGERS += $(EXTERNAL_64BIT_SDT_TRIGGERS)

EXTERNAL_32BIT_TRIGGERS := visible-constructor-32
Expand Down
2 changes: 1 addition & 1 deletion test/unittest/pid/tst.provregex3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# USDT probes as well as pid probes (e.g., p*d$target matches both
# pid$target and pyramid$target.)
#
# @@xfail: dtv2
# @@xfail: dtv2 (wildcarded usdt probes not yet implemented)

if [ $# != 1 ]; then
echo expected one argument: '<'dtrace-path'>'
Expand Down
16 changes: 16 additions & 0 deletions test/unittest/usdt/tst.args-alt.aarch64.x
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/sh

read MAJOR MINOR <<< `uname -r | grep -Eo '^[0-9]+\.[0-9]+' | tr '.' ' '`
if [ $MAJOR -gt 5 ]; then
exit 0
fi
if [ $MAJOR -eq 5 -a $MINOR -gt 4 ]; then
exit 0
fi
# Technically, Linux 5.4 should also work, but there seem to be problems with
# UEK6.
echo "usdt probes have bad arg8/arg9 on pre-5.5 kernels on ARM"
exit 1
3 changes: 1 addition & 2 deletions test/unittest/usdt/tst.args-alt.d
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
/*
* Oracle Linux DTrace.
* Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2022, 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 */
/* @@trigger: usdt-tst-args */
/* @@trigger-timing: before */
/* @@runtest-opts: $_pid */
Expand Down
3 changes: 1 addition & 2 deletions test/unittest/usdt/tst.args.d
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
/*
* Oracle Linux DTrace.
* Copyright (c) 2006, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2006, 2022, 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 */
/* @@trigger: usdt-tst-args */
/* @@trigger-timing: before */
/* @@runtest-opts: $_pid */
Expand Down
2 changes: 0 additions & 2 deletions test/unittest/usdt/tst.dlclose1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
#
# The first USDT provider check should find test_prov$pid.
# The second should not.
#
# @@xfail: dtv2 (USDT probes)

dtrace=$1
CC=/usr/bin/gcc
Expand Down
5 changes: 3 additions & 2 deletions test/unittest/usdt/tst.dlclose2.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#!/bin/bash
#
# Oracle Linux DTrace.
# Copyright (c) 2006, 2020, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2006, 2022, 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, no wildcard usdt probes yet
#
PATH=/usr/bin:/usr/sbin:$PATH
# @@xfail: dtv2

if [ $# != 1 ]; then
echo expected one argument: '<'dtrace-path'>'
Expand Down
4 changes: 3 additions & 1 deletion test/unittest/usdt/tst.dlclose3.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#!/bin/bash
#
# Oracle Linux DTrace.
# Copyright (c) 2007, 2021, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2007, 2022, 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, needs dtprobed synchronization with running dtraces
# @@tags: unstable

#
# This test verifies that performing a dlclose(3dl) on a library doesn't
Expand Down
1 change: 0 additions & 1 deletion test/unittest/usdt/tst.dlclose3.x

This file was deleted.

4 changes: 2 additions & 2 deletions test/unittest/usdt/tst.eliminate.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/bash
#
# Oracle Linux DTrace.
# Copyright (c) 2007, 2020, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2007, 2022, 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: Linux ld does not seem to supoprt STV_ELIMINATE
# @@xfail: Linux ld does not seem to support STV_ELIMINATE
#
# Make sure temporary symbols generated due to DTrace probes in static
# functions are removed in the final link step.
Expand Down
4 changes: 2 additions & 2 deletions test/unittest/usdt/tst.enable.d
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
* Oracle Linux DTrace.
* Copyright (c) 2006, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2006, 2022, 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, no is-enabled probes yet */
/* @@trigger: usdt-tst-special 2 */

#pragma D option quiet
Expand Down
4 changes: 2 additions & 2 deletions test/unittest/usdt/tst.enable_and.d
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
* Oracle Linux DTrace.
* Copyright (c) 2006, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2006, 2022, 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, no is-enabled probes yet */
/* @@trigger: usdt-tst-special 5 */

#pragma D option quiet
Expand Down
4 changes: 2 additions & 2 deletions test/unittest/usdt/tst.enable_and_2.d
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
* Oracle Linux DTrace.
* Copyright (c) 2006, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2006, 2022, 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, no is-enabled probes yet */
/* @@trigger: usdt-tst-special 6 */

#pragma D option quiet
Expand Down
3 changes: 1 addition & 2 deletions test/unittest/usdt/tst.enable_or.d
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
/*
* Oracle Linux DTrace.
* Copyright (c) 2006, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2006, 2022, 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 */
/* @@trigger: usdt-tst-special 3 */

#pragma D option quiet
Expand Down
4 changes: 2 additions & 2 deletions test/unittest/usdt/tst.enable_or_2.d
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
* Oracle Linux DTrace.
* Copyright (c) 2006, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2006, 2022, 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, no is-enabled probes yet */
/* @@trigger: usdt-tst-special 4 */

#pragma D option quiet
Expand Down
4 changes: 2 additions & 2 deletions test/unittest/usdt/tst.enable_return.d
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
* Oracle Linux DTrace.
* Copyright (c) 2006, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2006, 2022, 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, no is-enabled probes yet */
/* @@trigger: usdt-tst-special 8 */

#pragma D option quiet
Expand Down
4 changes: 2 additions & 2 deletions test/unittest/usdt/tst.enable_stmt.d
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
* Oracle Linux DTrace.
* Copyright (c) 2006, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2006, 2022, 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, no is-enabled probes yet */
/* @@trigger: usdt-tst-special 7 */

#pragma D option quiet
Expand Down
4 changes: 2 additions & 2 deletions test/unittest/usdt/tst.enabled.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#!/bin/bash
#
# Oracle Linux DTrace.
# Copyright (c) 2006, 2020, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2006, 2022, 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.
#
if [ $# != 1 ]; then
echo expected one argument: '<'dtrace-path'>'
exit 2
fi
# @@xfail: dtv2
# @@xfail: dtv2, no is-enabled probes yet

dtrace=$1
CC=/usr/bin/gcc
Expand Down
4 changes: 1 addition & 3 deletions test/unittest/usdt/tst.enabled2.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
#!/bin/bash
#
# Oracle Linux DTrace.
# Copyright (c) 2008, 2020, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2008, 2022, 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.
#
# This test is primarily intended to verify a fix for SPARC, but there's no
# harm in running it on other platforms. Here, we verify that is-enabled
# probes don't interfere with return values from previously invoked functions.
#
# @@xfail: dtv2

if [ $# != 1 ]; then
echo expected one argument: '<'dtrace-path'>'
Expand Down
5 changes: 3 additions & 2 deletions test/unittest/usdt/tst.entryreturn.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
#!/bin/bash
#
# Oracle Linux DTrace.
# Copyright (c) 2007, 2020, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2007, 2022, 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.
#
if [ $# != 1 ]; then
echo expected one argument: '<'dtrace-path'>'
exit 2
fi
# @@xfail: dtv2

# @@xfail: dtv2, no wildcard usdt probes yet

dtrace=$1
CC=/usr/bin/gcc
Expand Down
4 changes: 2 additions & 2 deletions test/unittest/usdt/tst.fork.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#!/bin/bash
#
# Oracle Linux DTrace.
# Copyright (c) 2006, 2020, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2006, 2022, 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, no real probe-in-forked-child support yet
if [ $# != 1 ]; then
echo expected one argument: '<'dtrace-path'>'
exit 2
fi
# @@xfail: dtv2

dtrace=$1
CC=/usr/bin/gcc
Expand Down
3 changes: 1 addition & 2 deletions test/unittest/usdt/tst.guess32.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
#!/bin/bash
#
# Oracle Linux DTrace.
# Copyright (c) 2006, 2020, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2006, 2022, 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

if [ $# != 1 ]; then
echo expected one argument: '<'dtrace-path'>'
Expand Down
3 changes: 1 addition & 2 deletions test/unittest/usdt/tst.guess64.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
#!/bin/bash
#
# Oracle Linux DTrace.
# Copyright (c) 2006, 2020, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2006, 2022, 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.
#
if [ $# != 1 ]; then
echo expected one argument: '<'dtrace-path'>'
exit 2
fi
# @@xfail: dtv2

dtrace=$1
CC=/usr/bin/gcc
Expand Down
8 changes: 8 additions & 0 deletions test/unittest/usdt/tst.lingering.r
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
test:main:go

test:main:go2

test:main:go2

test:main:go

0 comments on commit 7ad418c

Please sign in to comment.