tst.libchain.ksh revision 303975
1270114Sse#
286694Sache# CDDL HEADER START
386694Sache#
486694Sache# The contents of this file are subject to the terms of the
586694Sache# Common Development and Distribution License (the "License").
686694Sache# You may not use this file except in compliance with the License.
786694Sache#
886694Sache# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
986694Sache# or http://www.opensolaris.org/os/licensing.
1086694Sache# See the License for the specific language governing permissions
1186694Sache# and limitations under the License.
1286694Sache#
1386694Sache# When distributing Covered Code, include this CDDL HEADER in each
1486694Sache# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1586694Sache# If applicable, add the following below this CDDL HEADER, with the
1686694Sache# fields enclosed by brackets "[]" replaced with your own identifying
1786694Sache# information: Portions Copyright [yyyy] [name of copyright owner]
1886694Sache#
1986694Sache# CDDL HEADER END
20270114Sse#
21270114Sse
22270114Sse#
2386694Sache# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
24270114Sse# Use is subject to license terms.
2586694Sache#
26270114Sse# ident	"%Z%%M%	%I%	%E% SMI"
27270114Sse
2886694Sacheif [ $# != 1 ]; then
2986694Sache	echo expected one argument: '<'dtrace-path'>'
30270114Sse	exit 2
31270114Ssefi
32270114Sse
33270114Sselibdir=${TMPDIR:-/tmp}/libdep.$$
34270114Ssedtrace=$1
35270114Sse
36270114Ssesetup_libs()
37270114Sse{
38270114Sse        mkdir $libdir
39270114Sse        cat > $libdir/liba.$$.d <<EOF
40270114Sse#pragma D depends_on library libb.$$.d
41270114Sse
42270114Sseinline int foo = bar;
43270114SseEOF
44270114Sse        cat > $libdir/libb.$$.d <<EOF
45270114Sse#pragma D depends_on module doogle_knows_all_probes
46270114Sse
47270114Sseinline int bar = 0xd0061e;
4886694SacheEOF
4986694Sache}
5086694Sache
5186694Sache
5286694Sachesetup_libs
5386694Sache
54270114Sse$dtrace -L$libdir -e
5586694Sache
56270114Ssestatus=$?
57270114Sserm -rf $libdir
58270114Ssereturn $status
5986694Sache