edb348833aaacfa1176e502ad38875fd0b2717abAdam H. Leventhal#!/usr/bin/ksh
edb348833aaacfa1176e502ad38875fd0b2717abAdam H. Leventhal#
edb348833aaacfa1176e502ad38875fd0b2717abAdam H. Leventhal# CDDL HEADER START
edb348833aaacfa1176e502ad38875fd0b2717abAdam H. Leventhal#
edb348833aaacfa1176e502ad38875fd0b2717abAdam H. Leventhal# The contents of this file are subject to the terms of the
edb348833aaacfa1176e502ad38875fd0b2717abAdam H. Leventhal# Common Development and Distribution License (the "License").
edb348833aaacfa1176e502ad38875fd0b2717abAdam H. Leventhal# You may not use this file except in compliance with the License.
edb348833aaacfa1176e502ad38875fd0b2717abAdam H. Leventhal#
edb348833aaacfa1176e502ad38875fd0b2717abAdam H. Leventhal# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
edb348833aaacfa1176e502ad38875fd0b2717abAdam H. Leventhal# or http://www.opensolaris.org/os/licensing.
edb348833aaacfa1176e502ad38875fd0b2717abAdam H. Leventhal# See the License for the specific language governing permissions
edb348833aaacfa1176e502ad38875fd0b2717abAdam H. Leventhal# and limitations under the License.
edb348833aaacfa1176e502ad38875fd0b2717abAdam H. Leventhal#
edb348833aaacfa1176e502ad38875fd0b2717abAdam H. Leventhal# When distributing Covered Code, include this CDDL HEADER in each
edb348833aaacfa1176e502ad38875fd0b2717abAdam H. Leventhal# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
edb348833aaacfa1176e502ad38875fd0b2717abAdam H. Leventhal# If applicable, add the following below this CDDL HEADER, with the
edb348833aaacfa1176e502ad38875fd0b2717abAdam H. Leventhal# fields enclosed by brackets "[]" replaced with your own identifying
edb348833aaacfa1176e502ad38875fd0b2717abAdam H. Leventhal# information: Portions Copyright [yyyy] [name of copyright owner]
edb348833aaacfa1176e502ad38875fd0b2717abAdam H. Leventhal#
edb348833aaacfa1176e502ad38875fd0b2717abAdam H. Leventhal# CDDL HEADER END
edb348833aaacfa1176e502ad38875fd0b2717abAdam H. Leventhal#
edb348833aaacfa1176e502ad38875fd0b2717abAdam H. Leventhal
edb348833aaacfa1176e502ad38875fd0b2717abAdam H. Leventhal#
edb348833aaacfa1176e502ad38875fd0b2717abAdam H. Leventhal# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
edb348833aaacfa1176e502ad38875fd0b2717abAdam H. Leventhal# Use is subject to license terms.
edb348833aaacfa1176e502ad38875fd0b2717abAdam H. Leventhal#
edb348833aaacfa1176e502ad38875fd0b2717abAdam H. Leventhal
edb348833aaacfa1176e502ad38875fd0b2717abAdam H. Leventhal#
edb348833aaacfa1176e502ad38875fd0b2717abAdam H. Leventhal# Copyright (c) 2012 by Delphix. All rights reserved.
edb348833aaacfa1176e502ad38875fd0b2717abAdam H. Leventhal#
edb348833aaacfa1176e502ad38875fd0b2717abAdam H. Leventhal
edb348833aaacfa1176e502ad38875fd0b2717abAdam H. Leventhalif [ $# != 1 ]; then
edb348833aaacfa1176e502ad38875fd0b2717abAdam H. Leventhal echo expected one argument: '<'dtrace-path'>'
edb348833aaacfa1176e502ad38875fd0b2717abAdam H. Leventhal exit 2
edb348833aaacfa1176e502ad38875fd0b2717abAdam H. Leventhalfi
edb348833aaacfa1176e502ad38875fd0b2717abAdam H. Leventhal
edb348833aaacfa1176e502ad38875fd0b2717abAdam H. Leventhaldtrace=$1
edb348833aaacfa1176e502ad38875fd0b2717abAdam H. Leventhal
edb348833aaacfa1176e502ad38875fd0b2717abAdam H. Leventhal#
edb348833aaacfa1176e502ad38875fd0b2717abAdam H. Leventhal# Verify that USDT objects built with -xlazyload fire by default when using
edb348833aaacfa1176e502ad38875fd0b2717abAdam H. Leventhal# the DTrace audit library.
edb348833aaacfa1176e502ad38875fd0b2717abAdam H. Leventhal#
edb348833aaacfa1176e502ad38875fd0b2717abAdam H. Leventhal
edb348833aaacfa1176e502ad38875fd0b2717abAdam H. LeventhalLD_AUDIT_32=/usr/lib/dtrace/libdtrace_forceload.so ./tst.lazyprobe.exe &
edb348833aaacfa1176e502ad38875fd0b2717abAdam H. Leventhalid=$!
edb348833aaacfa1176e502ad38875fd0b2717abAdam H. Leventhal
edb348833aaacfa1176e502ad38875fd0b2717abAdam H. Leventhalret=1
edb348833aaacfa1176e502ad38875fd0b2717abAdam H. Leventhal
edb348833aaacfa1176e502ad38875fd0b2717abAdam H. Leventhal$dtrace -Z -s /dev/stdin <<-EOF
edb348833aaacfa1176e502ad38875fd0b2717abAdam H. Leventhal lazyprobe*:::fire
edb348833aaacfa1176e502ad38875fd0b2717abAdam H. Leventhal {
edb348833aaacfa1176e502ad38875fd0b2717abAdam H. Leventhal exit(0);
edb348833aaacfa1176e502ad38875fd0b2717abAdam H. Leventhal }
edb348833aaacfa1176e502ad38875fd0b2717abAdam H. Leventhal tick-10hz
edb348833aaacfa1176e502ad38875fd0b2717abAdam H. Leventhal /i++ > 20/
edb348833aaacfa1176e502ad38875fd0b2717abAdam H. Leventhal {
edb348833aaacfa1176e502ad38875fd0b2717abAdam H. Leventhal exit(1);
edb348833aaacfa1176e502ad38875fd0b2717abAdam H. Leventhal }
edb348833aaacfa1176e502ad38875fd0b2717abAdam H. LeventhalEOF
edb348833aaacfa1176e502ad38875fd0b2717abAdam H. Leventhalret=$?
edb348833aaacfa1176e502ad38875fd0b2717abAdam H. Leventhal
edb348833aaacfa1176e502ad38875fd0b2717abAdam H. Leventhalkill -9 $id
edb348833aaacfa1176e502ad38875fd0b2717abAdam H. Leventhal
edb348833aaacfa1176e502ad38875fd0b2717abAdam H. Leventhalexit $ret