1266988Smarkj# 2266988Smarkj# CDDL HEADER START 3266988Smarkj# 4266988Smarkj# The contents of this file are subject to the terms of the 5266988Smarkj# Common Development and Distribution License (the "License"). 6266988Smarkj# You may not use this file except in compliance with the License. 7266988Smarkj# 8266988Smarkj# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9266988Smarkj# or http://www.opensolaris.org/os/licensing. 10266988Smarkj# See the License for the specific language governing permissions 11266988Smarkj# and limitations under the License. 12266988Smarkj# 13266988Smarkj# When distributing Covered Code, include this CDDL HEADER in each 14266988Smarkj# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15266988Smarkj# If applicable, add the following below this CDDL HEADER, with the 16266988Smarkj# fields enclosed by brackets "[]" replaced with your own identifying 17266988Smarkj# information: Portions Copyright [yyyy] [name of copyright owner] 18266988Smarkj# 19266988Smarkj# CDDL HEADER END 20266988Smarkj# 21266988Smarkj 22266988Smarkj# 23266988Smarkj# Copyright (c) 2013, Joyent, Inc. All rights reserved. 24266988Smarkj# 25266988Smarkj 26266988Smarkjif [ $# != 1 ]; then 27266988Smarkj echo expected one argument: '<'dtrace-path'>' 28266988Smarkj exit 2 29266988Smarkjfi 30266988Smarkj 31266988Smarkjdtrace=$1 32266988SmarkjDIR=/var/tmp/dtest.$$ 33266988Smarkj 34266988Smarkjmkdir $DIR 35266988Smarkjcd $DIR 36266988Smarkj 37266988Smarkjcat > test.c <<EOF 38266988Smarkjvoid 39266988Smarkjfoo() 40266988Smarkj{} 41266988SmarkjEOF 42266988Smarkj 43266988Smarkjcat > doogle.d <<EOF 44266988Smarkjprovider doogle { 45266988Smarkj probe bagnoogle(); 46266988Smarkj}; 47266988SmarkjEOF 48266988Smarkj 49266988Smarkjcc -c test.c 50266988Smarkj$dtrace -G -32 -s doogle.d test.o -o doogle.d.o 51266988Smarkj 52266988Smarkjif [ $? -eq 0 ]; then 53266988Smarkj print -u2 "dtrace succeeded despite having no probe sites" 54266988Smarkj exit 1 55266988Smarkjfi 56266988Smarkj 57266988Smarkjcd / 58266988Smarkj/usr/bin/rm -rf $DIR 59266988Smarkjexit 0 60