1 .\" Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
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]
23 .TH dumpbind 1 "18 Nov 1996"
25 dumpbind \- dump the bindings found in a bindings.so.1 output file
37 parses the output file created by the
40 library and displays a summary of all of the bindings that are
46 library which monitors the bindings of function calls and stores
47 the data in a common buffer pointed to by BT_OUTPUT. Because this
48 library tracks procedure calls via the
51 interface this library will record which functions are called as part of
52 the execution of a program. This differs from the
54 example which performs a static analysis of all of the bindings that are
55 recorded in a program without actually executing it. Also note that it
56 is safe to use the same BT_BUFFER for multiple processes running
57 concurrently. This means that a whole suite of applications can be
58 run and the interfaces that are used as part of that suite are recorded.
62 library is enabled by the setting of the following environment variables.
66 set this to the value of the bindings.so.1
68 library. By setting this environment variable the gathering of
69 bindings data is enabled.
72 set this to the name of the common output buffer which will be maintained
73 during the data gathering period. If this is not set the
74 output buffer will default to
75 .I /tmp/bindings.data.
78 a colon separated list of libraries that are to be traced. Only calls from
79 these libraries will be traced. The default is to trace all calls.
82 a colon separated list of libraries that are to be traced. Only calls to
83 these libraries will be traced. The default is to trace all calls.
87 display output in parseable format.
90 query mutex_locks in bindings buffer and display there current status. This is
91 when querying a problem with the bindings buffer.
94 clear all mutex_locks currently held in the bindings buffer.
97 set master mutex_lock in bindings buffer. This will cause any processes
98 currently using this bindings buffer to hang until the lock is freed.
101 print hash bucket usage statistics for the bindings buffer.
104 Here is a sample of gathering data using the
107 library and then the examination of that data with the
113 polyslo 131% export BT_OUTPUT=/tmp/bindings.data
114 polyslo 3563% LD_AUDIT=/opt/SUNWonld/lib/bindings.so.1
115 polyslo 3564% export LD_AUDIT
116 polyslo 3565% ls /usr/ccs/bin
117 admin gprof.flat.blurb nrform strip.orig
118 ar help prof symorder
121 cdc lex ranlib unifdef
122 comb lorder regcmp val
126 error mcs.orig sccsdiff yaccpar
128 gprof ncform stanswer
129 gprof.callg.blurb nm strip
130 polyslo 3566% nm /usr/lib/libdl.so.1
135 [Index] Value Size Type Bind Other Shndx Name
138 [27] | 1788| 8|FUNC |GLOB |0 |7 |_dladdr
139 [32] | 1772| 8|FUNC |GLOB |0 |7 |_dlclose
140 [44] | 1796| 8|FUNC |GLOB |0 |7 |_dldump
141 [29] | 1780| 8|FUNC |GLOB |0 |7 |_dlerror
142 [26] | 1732| 8|FUNC |GLOB |0 |7 |_dlinfo
143 [17] | 1740| 8|FUNC |LOCL |0 |7 |_dlmap
144 [24] | 1748| 8|FUNC |GLOB |0 |7 |_dlmopen
145 [23] | 1756| 8|FUNC |GLOB |0 |7 |_dlopen
146 [48] | 1764| 8|FUNC |GLOB |0 |7 |_dlsym
147 [38] | 0| 0|OBJT |GLOB |0 |ABS |_edata
148 [21] | 1824| 0|OBJT |GLOB |0 |8 |_end
149 [42] | 1820| 0|OBJT |GLOB |0 |8 |_etext
150 [30] | 1804| 8|FUNC |GLOB |0 |7 |_ld_concurrency
151 [34] | 1812| 8|FUNC |GLOB |0 |7 |bind_guard
152 [47] | 1820| 4|OBJT |GLOB |0 |8 |dbg_mask
153 [20] | 0| 0|FILE |LOCL |0 |ABS |dl.c
154 [43] | 1788| 8|FUNC |WEAK |0 |7 |dladdr
155 [22] | 1772| 8|FUNC |WEAK |0 |7 |dlclose
156 [31] | 1796| 8|FUNC |WEAK |0 |7 |dldump
157 [45] | 1780| 8|FUNC |WEAK |0 |7 |dlerror
159 polyslo 136% unset LD_AUDIT
163 Unsetting LD_AUDIT has turned off the bindings data gathering
164 and the output can now safely be examined by dumpbind.
168 polyslo 3567% unset LD_AUDIT
169 polyslo 3568% dumpbind /tmp/bindings.data
170 Bindings Summary Report
172 Library Symbol Call Count
173 ------------------------------------------------------------------------
174 /usr/lib/libc.so.1 textdomain 2
175 /usr/lib/libelf.so.1 elf_kind 1
176 /usr/lib/libc.so.1 munmap 1
177 /usr/lib/libc.so.1 strlen 353
178 /usr/lib/libc.so.1 .urem 3
179 /usr/lib/libc.so.1 iswprint 444
180 /usr/lib/libc.so.1 .udiv 11
181 /usr/lib/libc.so.1 time 1
182 /usr/lib/libc.so.1 .mul 361
183 /usr/lib/libc.so.1 closedir 1
184 /usr/lib/libc.so.1 _rw_read_held 36
185 /usr/lib/libelf.so.1 elf_strptr 34
186 /usr/lib/libc.so.1 lstat64 1
187 /usr/lib/libc.so.1 _realbufend 1203
188 /usr/lib/libc.so.1 qsort 3
189 /usr/lib/libc.so.1 _write 64
190 /usr/lib/libelf.so.1 _elf32_fsize 7
191 /usr/lib/libc.so.1 close 1
192 /usr/lib/libelf.so.1 elf_begin 1
193 /usr/lib/libelf.so.1 elf_version 1
194 /usr/lib/libc.so.1 _isatty 2
195 /usr/lib/libc.so.1 mmap 1
196 /usr/lib/libelf.so.1 elf_end 1
197 /usr/lib/libc.so.1 printf 628
198 /usr/lib/libc.so.1 calloc 2
200 /usr/lib/libc.so.1 __flsbuf 511
201 /usr/lib/libc.so.1 _close 1
202 /usr/lib/libc.so.1 _doprnt 630
203 /usr/lib/libc.so.1 ___errno 3
204 /usr/lib/libc.so.1 .umul 23
205 /usr/lib/libc.so.1 _thr_main 7
206 /usr/lib/libc.so.1 open 1
207 /usr/lib/libc.so.1 _sbrk_unlocked 8
208 /usr/lib/libc.so.1 mutex_lock 1
209 /usr/lib/libc.so.1 _setbufend 2
210 /usr/lib/libc.so.1 sprintf 2
211 /usr/lib/libc.so.1 setlocale 2
212 /usr/lib/libelf.so.1 elf_nextscn 15
213 /usr/lib/ld.so.1 dlsym 2
214 /usr/lib/libelf.so.1 _elf_getscn 34
215 /usr/lib/libc.so.1 _sbrk 8
216 /usr/lib/libc.so.1 _open64 1
217 /usr/lib/libc.so.1 _mutex_lock 88
218 /usr/lib/libc.so.1 exit 2
219 /usr/lib/libc.so.1 ioctl 1
220 /usr/lib/libc.so.1 getenv 17
221 /usr/lib/libc.so.1 _mutex_held 36
222 ------------------------------------------------------------------------
223 Symbol Count: 87 Call Count: 8272