summaryrefslogtreecommitdiff
path: root/external/cddl/dtracetoolkit/dist/Examples/py_cputime_example.txt
blob: 2f25922adc2ae8e3d5b711342058910f4b81ee61 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
The following are examples of py_cputime.d.

This script traces the on-CPU time of JavaScript functions and prints a
report. Here it traces the example program, Code/Python/func_slow.py

# py_cputime.d
Tracing... Hit Ctrl-C to end.
^C

Count,
   FILE                 TYPE       NAME                                COUNT
   UserDict.py          func       ?                                       1
   UserDict.py          func       DictMixin                               1
   UserDict.py          func       IterableUserDict                        1
   UserDict.py          func       UserDict                                1
   UserDict.py          func       __init__                                1
   __init__.py          func       ?                                       1
   __init__.py          func       CodecRegistryError                      1
   __init__.py          func       normalize_encoding                      1
   __init__.py          func       search_function                         1
   aliases.py           func       ?                                       1
   ascii.py             func       ?                                       1
   ascii.py             func       Codec                                   1
   ascii.py             func       StreamConverter                         1
   ascii.py             func       StreamReader                            1
   ascii.py             func       StreamWriter                            1
   ascii.py             func       getregentry                             1
   codecs.py            func       ?                                       1
   codecs.py            func       Codec                                   1
   codecs.py            func       StreamReader                            1
   codecs.py            func       StreamReaderWriter                      1
   codecs.py            func       StreamRecoder                           1
   codecs.py            func       StreamWriter                            1
   copy_reg.py          func       ?                                       1
   func_slow.py         func       ?                                       1
   func_slow.py         func       func_a                                  1
   func_slow.py         func       func_b                                  1
   func_slow.py         func       func_c                                  1
   linecache.py         func       ?                                       1
   os.py                func       ?                                       1
   os.py                func       _Environ                                1
   os.py                func       __init__                                1
   os.py                func       _get_exports_list                       1
   posixpath.py         func       ?                                       1
   posixpath.py         func       basename                                1
   posixpath.py         func       dirname                                 1
   site.py              func       ?                                       1
   site.py              func       _Helper                                 1
   site.py              func       _Printer                                1
   site.py              func       _init_pathinfo                          1
   site.py              func       abs__file__                             1
   site.py              func       addsitepackages                         1
   site.py              func       aliasmbcs                               1
   site.py              func       execsitecustomize                       1
   site.py              func       main                                    1
   site.py              func       removeduppaths                          1
   site.py              func       setcopyright                            1
   site.py              func       setencoding                             1
   site.py              func       sethelper                               1
   site.py              func       setquit                                 1
   stat.py              func       ?                                       1
   types.py             func       ?                                       1
   types.py             func       _C                                      1
   warnings.py          func       ?                                       1
   warnings.py          func       _OptionError                            1
   warnings.py          func       _processoptions                         1
   posixpath.py         func       exists                                  2
   posixpath.py         func       split                                   2
   site.py              func       addsitedir                              2
   warnings.py          func       simplefilter                            2
   copy_reg.py          func       constructor                             3
   copy_reg.py          func       pickle                                  3
   site.py              func       __init__                                3
   site.py              func       addpackage                              3
   stat.py              func       S_IFMT                                  6
   stat.py              func       S_ISDIR                                 6
   posixpath.py         func       isdir                                   8
   os.py                func       _exists                                10
   <string>             func       ?                                      11
   posixpath.py         func       normcase                               14
   site.py              func       makepath                               14
   posixpath.py         func       join                                   20
   posixpath.py         func       abspath                                22
   posixpath.py         func       isabs                                  22
   posixpath.py         func       normpath                               22
   -                    total      -                                     230

Exclusive function on-CPU times (us),
   FILE                 TYPE       NAME                                TOTAL
   ascii.py             func       StreamWriter                            1
   __init__.py          func       CodecRegistryError                      1
   ascii.py             func       StreamReader                            1
   site.py              func       setencoding                             1
   warnings.py          func       _OptionError                            1
   UserDict.py          func       IterableUserDict                        1
   site.py              func       aliasmbcs                               1
   warnings.py          func       _processoptions                         1
   types.py             func       _C                                      1
   ascii.py             func       getregentry                             1
   site.py              func       _Helper                                 2
   ascii.py             func       Codec                                   2
   ascii.py             func       StreamConverter                         2
   site.py              func       sethelper                               2
   codecs.py            func       Codec                                   2
   UserDict.py          func       __init__                                3
   posixpath.py         func       dirname                                 3
   posixpath.py         func       basename                                3
   site.py              func       _Printer                                3
   os.py                func       _Environ                                3
   codecs.py            func       StreamWriter                            3
   site.py              func       setquit                                 3
   copy_reg.py          func       constructor                             3
   codecs.py            func       StreamRecoder                           4
   codecs.py            func       StreamReaderWriter                      5
   codecs.py            func       StreamReader                            5
   os.py                func       __init__                                6
   func_slow.py         func       ?                                       6
   __init__.py          func       normalize_encoding                      7
   site.py              func       __init__                                7
   linecache.py         func       ?                                       7
   warnings.py          func       simplefilter                            7
   stat.py              func       S_IFMT                                  9
   stat.py              func       ?                                      10
   copy_reg.py          func       pickle                                 12
   posixpath.py         func       split                                  12
   posixpath.py         func       normcase                               15
   stat.py              func       S_ISDIR                                17
   site.py              func       addsitepackages                        20
   UserDict.py          func       ?                                      20
   site.py              func       setcopyright                           23
   site.py              func       main                                   24
   <string>             func       ?                                      28
   UserDict.py          func       UserDict                               31
   site.py              func       _init_pathinfo                         33
   posixpath.py         func       exists                                 35
   ascii.py             func       ?                                      38
   posixpath.py         func       isabs                                  42
   aliases.py           func       ?                                      43
   site.py              func       removeduppaths                         51
   site.py              func       abs__file__                            56
   codecs.py            func       ?                                      75
   types.py             func       ?                                      83
   posixpath.py         func       join                                   85
   site.py              func       makepath                               97
   posixpath.py         func       abspath                                99
   os.py                func       _get_exports_list                     132
   __init__.py          func       search_function                       142
   warnings.py          func       ?                                     171
   UserDict.py          func       DictMixin                             182
   posixpath.py         func       ?                                     192
   copy_reg.py          func       ?                                     196
   posixpath.py         func       normpath                              209
   posixpath.py         func       isdir                                 255
   site.py              func       addpackage                            375
   site.py              func       addsitedir                            506
   site.py              func       execsitecustomize                     540
   site.py              func       ?                                     725
   os.py                func       _exists                               802
   os.py                func       ?                                    1138
   __init__.py          func       ?                                    1199
   func_slow.py         func       func_a                             229669
   func_slow.py         func       func_b                             456371
   func_slow.py         func       func_c                             686056
   -                    total      -                                 1379951

Inclusive function on-CPU times (us),
   FILE                 TYPE       NAME                                TOTAL
   ascii.py             func       StreamWriter                            1
   __init__.py          func       CodecRegistryError                      1
   ascii.py             func       StreamReader                            1
   site.py              func       setencoding                             1
   warnings.py          func       _OptionError                            1
   UserDict.py          func       IterableUserDict                        1
   site.py              func       aliasmbcs                               1
   warnings.py          func       _processoptions                         1
   types.py             func       _C                                      1
   ascii.py             func       getregentry                             1
   site.py              func       _Helper                                 2
   ascii.py             func       Codec                                   2
   ascii.py             func       StreamConverter                         2
   site.py              func       sethelper                               2
   codecs.py            func       Codec                                   2
   UserDict.py          func       __init__                                3
   site.py              func       _Printer                                3
   os.py                func       _Environ                                3
   codecs.py            func       StreamWriter                            3
   site.py              func       setquit                                 3
   copy_reg.py          func       constructor                             3
   codecs.py            func       StreamRecoder                           4
   codecs.py            func       StreamReaderWriter                      5
   codecs.py            func       StreamReader                            5
   __init__.py          func       normalize_encoding                      7
   site.py              func       __init__                                7
   linecache.py         func       ?                                       7
   warnings.py          func       simplefilter                            7
   stat.py              func       S_IFMT                                  9
   os.py                func       __init__                                9
   posixpath.py         func       basename                                9
   posixpath.py         func       dirname                                10
   stat.py              func       ?                                      10
   posixpath.py         func       split                                  12
   posixpath.py         func       normcase                               15
   copy_reg.py          func       pickle                                 15
   stat.py              func       S_ISDIR                                26
   UserDict.py          func       UserDict                               31
   posixpath.py         func       exists                                 35
   posixpath.py         func       isabs                                  42
   aliases.py           func       ?                                      43
   site.py              func       setcopyright                           44
   ascii.py             func       ?                                      45
   types.py             func       ?                                      85
   posixpath.py         func       join                                   85
   codecs.py            func       ?                                      97
   os.py                func       _get_exports_list                     132
   site.py              func       removeduppaths                        171
   UserDict.py          func       DictMixin                             182
   site.py              func       abs__file__                           184
   warnings.py          func       ?                                     190
   __init__.py          func       search_function                       196
   posixpath.py         func       ?                                     202
   posixpath.py         func       normpath                              209
   UserDict.py          func       ?                                     235
   posixpath.py         func       isdir                                 281
   copy_reg.py          func       ?                                     288
   posixpath.py         func       abspath                               351
   site.py              func       _init_pathinfo                        392
   site.py              func       makepath                              395
   site.py              func       execsitecustomize                     540
   os.py                func       _exists                               819
   <string>             func       ?                                     973
   __init__.py          func       ?                                    1341
   site.py              func       addpackage                           1470
   site.py              func       addsitepackages                      1562
   site.py              func       addsitedir                           2420
   site.py              func       main                                 2546
   os.py                func       ?                                    2839
   site.py              func       ?                                    6118
   func_slow.py         func       func_c                             686056
   func_slow.py         func       func_b                            1142427
   func_slow.py         func       func_a                            1372097
   func_slow.py         func       ?                                 1372104

You can see the results are printed in three sections.

The first section reports how many times each function was called.

The exclusive function on-CPU times shows, amongst other results that func_a
spent around 0.22 seconds on-CPU.  This times excludes time spent in
other functions.

The inclusive function on-CPU times show that func_a spent around 1.4
seconds on-CPU.  This includes the time spent in other functions called.

These on-CPU times are the time the thread spent running on a CPU, from when
the subroutine began to when it completed. This does not include time
spent off-CPU time such as sleeping for I/O or waiting for scheduling.

On-CPU times are useful for showing who is causing the CPUs to be busy.
See Notes/ALLoncpu_notes.txt for more details. Also see
Notes/ALLexclusive_notes.txt and Notes/ALLinclusive_notes.txt for a
detailed explanation of exclusive vs inclusive subroutine time.