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 perfcnt 1 "18 Nov 1996"
25 perfcnt \- trace the amount of time spent in each function call
37 ] executable [executable arguments ...]
43 executes the specified command and tracks the amount of time
44 that is spent in each procedure call.
46 traces all of the procedure calls that occur between dynamic objects
48 .I Procedure Linkage Table, so only those procedure calls which are
50 .I Procedure Linkage Table
54 has the limitation that it does not work with a threaded program nor
55 any programs which use procedures which are dependent upon the
61 .BI \-f " bindfromlist"
62 A colon separated list of libraries that are to be
63 traced. Only calls from these libraries will be traced. The default
64 is to trace all calls.
67 A colon separated list of libraries taht are to be traced.
68 Only calls to these libraries will be traced. The default is
72 specify an alternate perfcnt.so
76 The example tracks the usage of the libelf.so.1 library when performing
81 % perfcnt -t/usr/lib/libelf.so.1 nm /usr/lib/libc.so.1
84 [Index] Value Size Type Bind Other Shndx Name
86 [457] | 0| 0|NOTY |LOCL |0 |UNDEF |
87 [2] | 148| 0|SECT |LOCL |0 |1 |
88 [3] | 15232| 0|SECT |LOCL |0 |2 |
89 [4] | 45120| 0|SECT |LOCL |0 |3 |
90 [5] | 64024| 0|SECT |LOCL |0 |4 |
92 [1893] | 347660| 88|FUNC |LOCL |0 |12 |ypstub_perror
93 [1895] | 347280| 380|FUNC |LOCL |0 |12 |ypstub_sperror
94 [714] | 663472| 8|OBJT |LOCL |0 |22 |zero
99 SYMBOL c_count tim avg. tim tot. %
100 ---------------------------------------------------------------------
101 elf_getscn 1 4.03 4.03 0.01%
102 elf_kind 1 4.36 4.36 0.01%
103 _elf32_fsize 7 50.80 7.26 0.09%
104 _elf32_xlatetom 6 67.47 11.24 0.11%
105 elf_version 1 72.50 72.50 0.12%
106 elf32_getshdr 33 77.42 2.35 0.13%
107 elf_nextscn 33 83.36 2.53 0.14%
108 elf_end 1 131.91 131.91 0.22%
109 elf_getdata 2 138.74 69.37 0.23%
110 elf_begin 1 171.74 171.74 0.29%
111 elf32_getehdr 1 214.81 214.81 0.36%
112 _elf_getscn 4254 9755.89 2.29 16.38%
113 elf_strptr 4254 48784.97 11.47 81.91%
114 ---------------------------------------------------------------------
122 command is a demonstration of the
124 interface of the run-time linker (which is documented in
126 \), and it is not useful in all environments. This program
127 will not work with a threaded application and should not be
128 used with one. Also, in order to track the
129 time spent in a procedure both the
130 entry and exit of the procedure must be tracked. Because this causes
131 an additional stack frame to be created for each procedure call
132 it is not compatible with all library routines.
133 More details on this can be found in the