4 # The contents of this file are subject to the terms of the
5 # Common Development and Distribution License (the "License").
6 # You may not use this file except in compliance with the License.
8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 # or http://www.opensolaris.org/os/licensing.
10 # See the License for the specific language governing permissions
11 # and limitations under the License.
13 # When distributing Covered Code, include this CDDL HEADER in each
14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 # If applicable, add the following below this CDDL HEADER, with the
16 # fields enclosed by brackets "[]" replaced with your own identifying
17 # information: Portions Copyright [yyyy] [name of copyright owner]
23 # Copyright 2007 Sun Microsystems, Inc. All rights reserved.
24 # Use is subject to license terms.
26 # ident "%Z%%M% %I% %E% SMI"
31 # Get the list of services whose processes have USDT probes. Ideally
32 # it would be possible to unload the fasttrap provider while USDT
33 # probes exist -- once that fix is integrated, this hack can go away
34 # We create two lists -- one of regular SMF services and one of legacy
35 # services -- since each must be enabled and disabled using a specific
39 perl -ne 'print "$1\n" if (/^\s*\S+\s+\S*\D(\d+)\s+/);' | \
40 sort | uniq | tr '\n' ',')
42 ctids=$(ps -p $pids -o ctid | tail +2 | sort | uniq)
48 line=$(svcs -o fmri,ctid | grep " $ct\$")
49 svc=$(echo $line | cut -d' ' -f1)
51 if [[ $(svcs -Ho STA $svc) == "LRC" ]]; then
52 lrc=$(svcs -Ho SVC $svc | tr _ '?')
61 svcadm disable -ts $svc
67 # Does it seem a little paternalistic that lsvcrun requires
68 # this environment variable to be set? I'd say so...
70 SMF_RESTARTER=svc:/system/svc/restarter:default \
71 /lib/svc/bin/lsvcrun $lrc stop
82 svcadm enable -ts $svc
87 SMF_RESTARTER=svc:/system/svc/restarter:default \
88 /lib/svc/bin/lsvcrun $lrc start
91 if [ ! $success ]; then
92 echo $tst: could not unload dtrace
99 $dtrace -s /dev/stdin <<EOF
103 @a[probefunc] = count();
116 $dtrace -s /dev/stdin <<EOF
118 #pragma D option statusrate=1ms
135 printf("success; ttl is %d", ttl);
142 printf("error -- total should be non-zero");
149 echo expected one argument: '<'dtrace-path'>'
162 while [ "$waited" -lt 5 ]; do
165 if [ "$seconds" -ne "$last" ]; then
174 if [ "$status" -ne 0 ]; then
175 echo $tst: first dtrace failed
185 while [ "$waited" -lt 10 ]; do
188 if [ "$seconds" -ne "$last" ]; then