tst.BufsizeMega.d.ksh revision 23b5c241225a8ade2b6b9f06ebb891ee459e3b02
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi#!/bin/ksh -p
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi#
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi# CDDL HEADER START
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi#
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi# The contents of this file are subject to the terms of the
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi# Common Development and Distribution License (the "License").
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi# You may not use this file except in compliance with the License.
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi#
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi# or http://www.opensolaris.org/os/licensing.
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi# See the License for the specific language governing permissions
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi# and limitations under the License.
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi#
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi# When distributing Covered Code, include this CDDL HEADER in each
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi# If applicable, add the following below this CDDL HEADER, with the
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi# fields enclosed by brackets "[]" replaced with your own identifying
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi# information: Portions Copyright [yyyy] [name of copyright owner]
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi#
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi# CDDL HEADER END
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi#
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi
2c2c41837e330b002c4220a39638150db504fe0evi#
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi# Use is subject to license terms.
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi#
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi#ident "%Z%%M% %I% %E% SMI"
2c2c41837e330b002c4220a39638150db504fe0evi
2c2c41837e330b002c4220a39638150db504fe0evi##
2c2c41837e330b002c4220a39638150db504fe0evi#
2c2c41837e330b002c4220a39638150db504fe0evi# ASSERTION:
2c2c41837e330b002c4220a39638150db504fe0evi# The trace buffer size can include any of the size suffixes k, m, g or t
2c2c41837e330b002c4220a39638150db504fe0evi#
2c2c41837e330b002c4220a39638150db504fe0evi# SECTION: dtrace Utility/-b Option
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi#
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi##
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi
40cb5e5daa7b80bb70fcf8dadfb20f9281566331viscript()
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi{
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi $dtrace -b 1m -b 2m -s /dev/stdin <<EOF
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi BEGIN
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi {
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi printf("This test should compile.\n");
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi exit(0);
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi }
40cb5e5daa7b80bb70fcf8dadfb20f9281566331viEOF
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi}
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi
40cb5e5daa7b80bb70fcf8dadfb20f9281566331viif [ $# != 1 ]; then
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi echo expected one argument: '<'dtrace-path'>'
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi exit 2
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vifi
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vidtrace=$1
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi
40cb5e5daa7b80bb70fcf8dadfb20f9281566331viscript
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vistatus=$?
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi
40cb5e5daa7b80bb70fcf8dadfb20f9281566331viif [ "$status" -ne 0 ]; then
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi echo $tst: dtrace failed
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vifi
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi
40cb5e5daa7b80bb70fcf8dadfb20f9281566331viexit $status
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi