ac20c57d6652cecf7859e3346336b9a48e5d5f82jhaslam# CDDL HEADER START
ac20c57d6652cecf7859e3346336b9a48e5d5f82jhaslam# The contents of this file are subject to the terms of the
ac20c57d6652cecf7859e3346336b9a48e5d5f82jhaslam# Common Development and Distribution License (the "License").
ac20c57d6652cecf7859e3346336b9a48e5d5f82jhaslam# You may not use this file except in compliance with the License.
ac20c57d6652cecf7859e3346336b9a48e5d5f82jhaslam# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
ac20c57d6652cecf7859e3346336b9a48e5d5f82jhaslam# See the License for the specific language governing permissions
ac20c57d6652cecf7859e3346336b9a48e5d5f82jhaslam# and limitations under the License.
ac20c57d6652cecf7859e3346336b9a48e5d5f82jhaslam# When distributing Covered Code, include this CDDL HEADER in each
ac20c57d6652cecf7859e3346336b9a48e5d5f82jhaslam# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
ac20c57d6652cecf7859e3346336b9a48e5d5f82jhaslam# If applicable, add the following below this CDDL HEADER, with the
ac20c57d6652cecf7859e3346336b9a48e5d5f82jhaslam# fields enclosed by brackets "[]" replaced with your own identifying
ac20c57d6652cecf7859e3346336b9a48e5d5f82jhaslam# information: Portions Copyright [yyyy] [name of copyright owner]
ac20c57d6652cecf7859e3346336b9a48e5d5f82jhaslam# CDDL HEADER END
ac20c57d6652cecf7859e3346336b9a48e5d5f82jhaslam# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
ac20c57d6652cecf7859e3346336b9a48e5d5f82jhaslam# Use is subject to license terms.
ac20c57d6652cecf7859e3346336b9a48e5d5f82jhaslam# ident "%Z%%M% %I% %E% SMI"
ac20c57d6652cecf7859e3346336b9a48e5d5f82jhaslam# This script verifies that user-land stacks can be walked safely
ac20c57d6652cecf7859e3346336b9a48e5d5f82jhaslam# when the trapstat(1M) utility is running. An arbitrary program, w(1),
ac20c57d6652cecf7859e3346336b9a48e5d5f82jhaslam# is started once a second to ensure stacks can be walked at all stages
ac20c57d6652cecf7859e3346336b9a48e5d5f82jhaslam# of the process lifecycle.
ac20c57d6652cecf7859e3346336b9a48e5d5f82jhaslam @[ustackdepth] = count();
ac20c57d6652cecf7859e3346336b9a48e5d5f82jhaslam while [ $cnt -lt 10 ]; do
ac20c57d6652cecf7859e3346336b9a48e5d5f82jhaslamif [ $# != 1 ]; then
ac20c57d6652cecf7859e3346336b9a48e5d5f82jhaslam# Sleep while the above script fires into life. To guard against dtrace dying
ac20c57d6652cecf7859e3346336b9a48e5d5f82jhaslam# and us sleeping forever we allow 15 secs for this to happen. This should be
ac20c57d6652cecf7859e3346336b9a48e5d5f82jhaslam# enough for even the slowest systems.
ac20c57d6652cecf7859e3346336b9a48e5d5f82jhaslamwhile [ ! -f $dtraceout ]; do
ac20c57d6652cecf7859e3346336b9a48e5d5f82jhaslam echo "dtrace failed to start. Exiting."