1 .TH DYLIBPROF 1 "March 19, 2002" "Apple Computer, Inc."
3 dylibprof \- control the shared pc sampling of a dynamic shared library
5 dylibprof [\-e | \-d] | [\-c | \-r | \-b | \-h | \-p [\-o <file>] <dylib>]
7 Dylibprof along with the server /usr/libexec/profileServer allows shared
8 program counter sampling of a dynamic shared library across all the programs
13 /usr/libexec/profileServer must be running. So first start
14 /usr/libexec/profileServer and leave it running in the back ground:
16 % /usr/libexec/profileServer >& /dev/console &
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.
24 If you need to profile from boot up for all processes then the following line
25 can be added to /etc/bootstrap.conf:
27 server "/usr/libexec/profileServer" services NSProfileServer NSProfileControl;
29 Before any dynamic shared library can be sampled sampling must be enabled as
35 It can then later be disabled when no more sampling is to be done with:
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:
43 % dylibprof \-c /System/Library/Frameworks/System.framework/Versions/B/System
46 Then begin the sampling:
48 % dylibprof \-b /System/Library/Frameworks/System.framework/Versions/B/System
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.
54 Then to halt the sampling:
56 % dylibprof \-h /System/Library/Frameworks/System.framework/Versions/B/System
59 The profiling output file (a gmon.out file) can be created with:
61 % dylibprof \-p \-o /tmp/gmon.out /System/Library/Frameworks/System.framework/Versions/B/System
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:
68 % gprof \-S /System/Library/Frameworks/System.framework/Versions/B/System /tmp/gmon.out
70 When no more sampling for this library is to be done the sample buffer can be
73 % dylibprof \-r /System/Library/Frameworks/System.framework/Versions/B/System
79 Enable shared program counter sampling for dynamic libraries.
82 Disable shared program counter sampling for dynamic libraries.
85 Create a pc sample buffer for the library.
88 Begin sampling for programs subsequently launched using the library.
91 Halt sampling for programs subsequently launched using the library.
94 Produce a profiling output file (a gmon.out file) for the library.
97 Remove the pc sample buffer for the library.
102 instead of gmon.out when producing the profiling output file with the
110 /var/tmp/profile/profile.XXXXXX
111 the sample buffer file