1*c9d6cd77Sjhaslam#!/bin/ksh -p 2*c9d6cd77Sjhaslam# 3*c9d6cd77Sjhaslam# CDDL HEADER START 4*c9d6cd77Sjhaslam# 5*c9d6cd77Sjhaslam# The contents of this file are subject to the terms of the 6*c9d6cd77Sjhaslam# Common Development and Distribution License (the "License"). 7*c9d6cd77Sjhaslam# You may not use this file except in compliance with the License. 8*c9d6cd77Sjhaslam# 9*c9d6cd77Sjhaslam# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10*c9d6cd77Sjhaslam# or http://www.opensolaris.org/os/licensing. 11*c9d6cd77Sjhaslam# See the License for the specific language governing permissions 12*c9d6cd77Sjhaslam# and limitations under the License. 13*c9d6cd77Sjhaslam# 14*c9d6cd77Sjhaslam# When distributing Covered Code, include this CDDL HEADER in each 15*c9d6cd77Sjhaslam# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16*c9d6cd77Sjhaslam# If applicable, add the following below this CDDL HEADER, with the 17*c9d6cd77Sjhaslam# fields enclosed by brackets "[]" replaced with your own identifying 18*c9d6cd77Sjhaslam# information: Portions Copyright [yyyy] [name of copyright owner] 19*c9d6cd77Sjhaslam# 20*c9d6cd77Sjhaslam# CDDL HEADER END 21*c9d6cd77Sjhaslam# 22*c9d6cd77Sjhaslam 23*c9d6cd77Sjhaslam# 24*c9d6cd77Sjhaslam# Copyright 2007 Sun Microsystems, Inc. All rights reserved. 25*c9d6cd77Sjhaslam# Use is subject to license terms. 26*c9d6cd77Sjhaslam# 27*c9d6cd77Sjhaslam# ident "%Z%%M% %I% %E% SMI" 28*c9d6cd77Sjhaslam# 29*c9d6cd77Sjhaslam 30*c9d6cd77Sjhaslam# 31*c9d6cd77Sjhaslam# This test verifies that it's possible to add new pid probes to an existing 32*c9d6cd77Sjhaslam# pid provider. 33*c9d6cd77Sjhaslam# 34*c9d6cd77Sjhaslam 35*c9d6cd77Sjhaslamif [ $# != 1 ]; then 36*c9d6cd77Sjhaslam echo expected one argument: '<'dtrace-path'>' 37*c9d6cd77Sjhaslam exit 2 38*c9d6cd77Sjhaslamfi 39*c9d6cd77Sjhaslam 40*c9d6cd77Sjhaslamdtrace=$1 41*c9d6cd77Sjhaslam 42*c9d6cd77Sjhaslamsleep 60 & 43*c9d6cd77Sjhaslampid=$! 44*c9d6cd77Sjhaslam 45*c9d6cd77Sjhaslam$dtrace -n pid$pid:libc::entry -n 'tick-1s{exit(0);}' 46*c9d6cd77Sjhaslamstatus=$? 47*c9d6cd77Sjhaslam 48*c9d6cd77Sjhaslamif [ $status -gt 0 ]; then 49*c9d6cd77Sjhaslam exit $status; 50*c9d6cd77Sjhaslamfi 51*c9d6cd77Sjhaslam 52*c9d6cd77Sjhaslam$dtrace -n pid$pid:libc::return -n 'tick-1s{exit(0);}' 53*c9d6cd77Sjhaslamstatus=$? 54*c9d6cd77Sjhaslam 55*c9d6cd77Sjhaslamif [ $status -gt 0 ]; then 56*c9d6cd77Sjhaslam exit $status; 57*c9d6cd77Sjhaslamfi 58*c9d6cd77Sjhaslam 59*c9d6cd77Sjhaslamkill $pid 60*c9d6cd77Sjhaslam 61*c9d6cd77Sjhaslamexit $status 62