ranlib: fix it
[odcctools-svp.git] / man / dylibprof.1
blob304cfa588cff2c966e56d20b394a82f0cdb0488b
1 .TH DYLIBPROF 1 "March 19, 2002" "Apple Computer, Inc."
2 .SH NAME
3 dylibprof \- control the shared pc sampling of a dynamic shared library
4 .SH SYNOPSIS
5 dylibprof [\-e | \-d] | [\-c | \-r | \-b | \-h | \-p [\-o <file>] <dylib>]
6 .SH DESCRIPTION
7 Dylibprof along with the server /usr/libexec/profileServer allows shared
8 program counter sampling of a dynamic shared library across all the programs
9 that use the library.
10 .PP
11 To use
12 .IR dylibprof (1),
13 /usr/libexec/profileServer must be running.  So first start
14 /usr/libexec/profileServer and leave it running in the back ground:
15 .nf
16         % /usr/libexec/profileServer >& /dev/console &
17 .fi
18 .PP
19 /usr/libexec/profileServer starts up with shared pc sampling disabled.  It should
20 not be left running with shared pc sampling enabled if no sampling is being
21 done as every launch of a program that uses the dynamic linker is effected.
22 This is true even to a small extent if there no libraries being sampled.
23 .PP
24 If you need to profile from boot up for all processes then the following line
25 can be added to /etc/bootstrap.conf:
26 .nf
27         server "/usr/libexec/profileServer" services NSProfileServer NSProfileControl;
28 .PP
29 Before any dynamic shared library can be sampled sampling must be enabled as
30 follows:
31 .nf
32         % dylibprof \-e
33 .fi
34 .PP
35 It can then later be disabled when no more sampling is to be done with:
36 .nf
37         % dylibprof \-d
38 .fi
39 .SH EXAMPLE
40 To sample the dynamic shared library /System/Library/Frameworks/System.framework/Versions/B/System for example requires
41 the following steps.  First create a sample buffer for the library:
42 .nf
43         % dylibprof \-c /System/Library/Frameworks/System.framework/Versions/B/System
44 .fi
45 .PP
46 Then begin the sampling:
47 .nf
48         % dylibprof \-b /System/Library/Frameworks/System.framework/Versions/B/System
49 .fi
50 After this programs launched using this library will be part of the shared
51 pc sampling.  Typically what would be done is to then use the system normally
52 for a number of hours.
53 .PP
54 Then to halt the sampling:
55 .nf
56         % dylibprof \-h /System/Library/Frameworks/System.framework/Versions/B/System
57 .fi
58 .PP
59 The profiling output file (a gmon.out file) can be created with:
60 .nf
61         % dylibprof \-p \-o /tmp/gmon.out /System/Library/Frameworks/System.framework/Versions/B/System
62 .fi
63 .PP
64 Using the profiling output file and the library a profile listing and a time
65 based order file (time.order) can be created with:
66 .IR gprof (1):
67 .nf
68         % gprof \-S /System/Library/Frameworks/System.framework/Versions/B/System /tmp/gmon.out
69 .PP
70 When no more sampling for this library is to be done the sample buffer can be
71 removed with:
72 .nf
73         % dylibprof \-r /System/Library/Frameworks/System.framework/Versions/B/System
74 .fi
75 .PP
76 The options are:
77 .TP
78 .B  \-e
79 Enable shared program counter sampling for dynamic libraries.
80 .TP
81 .B  \-d
82 Disable shared program counter sampling for dynamic libraries.
83 .TP
84 .B  \-c
85 Create a pc sample buffer for the library.
86 .TP
87 .B  \-b
88 Begin sampling for programs subsequently launched using the library.
89 .TP
90 .B  \-h
91 Halt sampling for programs subsequently launched using the library.
92 .TP
93 .B  \-p
94 Produce a profiling output file (a gmon.out file) for the library.
95 .TP
96 .B  \-r
97 Remove the pc sample buffer for the library.
98 .TP
99 .BI  \-o " name"
100 Use the file
101 .I name
102 instead of gmon.out when producing the profiling output file with the
103 .B \-p
104 above.
105 .SH FILES
106 .ta 2.5i
107 gmon.out        
108 profile output file
110 /var/tmp/profile/profile.XXXXXX 
111 the sample buffer file
112 .SH "SEE ALSO"
113 gprof(1)