8322 nl: misleading-indentation
[unleashed/tickless.git] / usr / src / cmd / sgs / link_audit / common / perfcnt.ksh
blob0528d2ed64d6c5f90eb718af9d2fd5e77a3336ae
1 #!/bin/ksh
3 # CDDL HEADER START
5 # The contents of this file are subject to the terms of the
6 # Common Development and Distribution License (the "License").
7 # You may not use this file except in compliance with the License.
9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 # or http://www.opensolaris.org/os/licensing.
11 # See the License for the specific language governing permissions
12 # and limitations under the License.
14 # When distributing Covered Code, include this CDDL HEADER in each
15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 # If applicable, add the following below this CDDL HEADER, with the
17 # fields enclosed by brackets "[]" replaced with your own identifying
18 # information: Portions Copyright [yyyy] [name of copyright owner]
20 # CDDL HEADER END
24 # Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
27 usage() {
28 echo "usage: perfcnt -[$optlet] utility [utility arguments]"
29 echo " -f <bindfromlist>"
30 echo " A colon seperated list of libraries that are to be"
31 echo " traced. Only calls from these libraries will be"
32 echo " traced. The default is to trace all calls."
33 echo " -t <bindtolist>"
34 echo " A colon seperated list of libraries that are to be"
35 echo " traced. Only calls to these libraries will be"
36 echo " traced. The default is to trace all calls."
37 echo " -l <perfcntlib>"
38 echo " Specify an alternate perfcnt.so to use."
41 bindto=""
42 bindfrom=""
43 perfcntlib32="/opt/SUNWonld/lib/32/perfcnt.so.1"
44 perfcntlib64="/opt/SUNWonld/lib/64/perfcnt.so.1"
46 optlet="f:t:l:"
48 if [[ $# -lt 1 ]]; then
49 usage
50 exit 1
53 while getopts $optlet c
55 case $c in
57 bindfrom="$OPTARG"
60 bindto="$OPTARG"
63 perfcntlib32="$OPTARG"
64 perfcntlib64="$OPTARG"
66 \?)
67 usage
68 exit 1
70 esac
71 done
72 shift `expr $OPTIND - 1`
75 # Build environment variables
78 PERFCNT_BINDTO="$bindto" \
79 PERFCNT_BINDFROM="$bindfrom" \
80 LD_AUDIT_32="$perfcntlib32" \
81 LD_AUDIT_64="$perfcntlib64" \
84 exit 0