]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.sbin/pmcannotate/pmcannotate.8
zfs: merge openzfs/zfs@f795e90a1
[FreeBSD/FreeBSD.git] / usr.sbin / pmcannotate / pmcannotate.8
1 .\" Copyright (c) 2008 Nokia Corporation
2 .\" All rights reserved.
3 .\"
4 .\" This software was developed by Attilio Rao for the IPSO project under
5 .\" contract to Nokia Corporation.
6 .\"
7 .\" Redistribution and use in source and binary forms, with or without
8 .\" modification, are permitted provided that the following conditions
9 .\" are met:
10 .\" 1. Redistributions of source code must retain the above copyright
11 .\"    notice, this list of conditions and the following disclaimer.
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\"    notice, this list of conditions and the following disclaimer in the
14 .\"    documentation and/or other materials provided with the distribution.
15 .\"
16 .\" This software is provided by the authors ``as is'' and
17 .\" any express or implied warranties, including, but not limited to, the
18 .\" implied warranties of merchantability and fitness for a particular purpose
19 .\" are disclaimed.  in no event shall the authors be liable
20 .\" for any direct, indirect, incidental, special, exemplary, or consequential
21 .\" damages (including, but not limited to, procurement of substitute goods
22 .\" or services; loss of use, data, or profits; or business interruption)
23 .\" however caused and on any theory of liability, whether in contract, strict
24 .\" liability, or tort (including negligence or otherwise) arising in any way
25 .\" out of the use of this software, even if advised of the possibility of
26 .\" such damage.
27 .\"
28 .Dd November 20, 2008
29 .Dt PMCANNOTATE 8
30 .Os
31 .Sh NAME
32 .Nm pmcannotate
33 .Nd "sources printout with inlined profiling"
34 .Sh SYNOPSIS
35 .Nm
36 .Op Fl a
37 .Op Fl h
38 .Op Fl k Ar pathname
39 .Op Fl l Ar level
40 .Ar pmcout.out binaryobj
41 .Sh DESCRIPTION
42 The
43 .Nm
44 utility can produce both C sources or assembly sources of a program with
45 a line-by-line based profiling.
46 The profiling information is retrieved through a
47 .Xr pmcstat 8
48 raw output while the program operations are retrieved through the
49 .Xr objdump 1
50 tool.
51 .Pp
52 When calling
53 .Nm
54 the raw output is passed through the
55 .Ar pmcout.out
56 argument, while the program is passed through the
57 .Ar binaryobj
58 argument.
59 .Pp
60 As long as
61 .Nm
62 relies on
63 .Xr objdump 1
64 and
65 .Xr pmcstat 8
66 to work, it will fail if one of them is not available.
67 .Sh OPTIONS
68 The following options are available:
69 .Bl -tag -width indent
70 .It Fl a
71 Shows the program profiling inlined in the assembly code only.
72 No C information involving C sources is provided.
73 .It Fl h
74 Prints out information about the usage of the tool.
75 .It Fl l Ar level
76 Changes the lower bound (expressed in percentage) for traced functions
77 that will be printed out in the report.
78 The default value is 0.5%.
79 .It Fl k Ar kerneldir
80 Set the pathname of the kernel directory to argument
81 .Ar kerneldir .
82 This directory specifies where
83 .Nm
84 should look for the kernel and its modules.
85 The default is
86 .Pa /boot/kernel .
87 .El
88 .Sh LIMITATIONS
89 As long as
90 .Nm
91 relies on the
92 .Xr objdump 1
93 utility to retrieve the C code, the program needs to be compiled with
94 debugging options.
95 Sometimes, in particular with heavy optimization levels, the
96 .Xr objdump 1
97 utility embeds the code of inlining functions directly in the callers,
98 making an output difficult to read.
99 The x86 version reports the sampling from pmcstat collecting the following
100 instruction in regard of the interrupted one.
101 This means that the samples may be attributed to the line below the one
102 of interest.
103 .Sh SEE ALSO
104 .Xr objdump 1 ,
105 .Xr pmcstat 8
106 .Sh AUTHORS
107 .An Attilio Rao Aq Mt attilio@FreeBSD.org