1 Following are examples of running tcl_cputime.d.
3 Here it runs while we execute Code/Tcl/func_slow.tcl
6 Tracing... Hit Ctrl-C to end.
22 Top 10 exclusive on-CPU times (us),
24 16038 cmd namespace 130
30 16038 proc func_a 535521
31 16038 proc func_b 1071082
32 16038 proc func_c 1619323
35 Top 10 inclusive on-CPU times (us),
38 16038 cmd uplevel 1367
39 16038 proc tclInit 1865
40 16038 cmd tclInit 2180
41 16038 proc func_c 1619360
42 16038 cmd func_c 1619404
43 16038 proc func_b 2690525
44 16038 cmd func_b 2690568
45 16038 proc func_a 3226247
46 16038 cmd func_a 3226275
48 We can see that the output is in three sections. The first section represents
49 the ten most commonly executed commands while the script is tracing.
51 The exclusive function on-CPU times show that func_a spent around 0.5 seconds
52 on-CPU, func_b spent about 1.0 seconds, and func_c, 1.6 seconds. This excludes
53 time spent in other procedures or commands.
55 The inclusive function on-CPU times show the time spent by these procedures in
56 total, including the time spent in other functions called, and since func_a
57 called func_b which called func_c, these times make sense.
59 These on-CPU times are the time the thread spent running on a CPU, from when
60 the function began to when it completed. This does not include time
61 spent off-CPU time such as sleeping for I/O or waiting for scheduling.
63 On-CPU times are useful for showing who is causing the CPUs to be busy.
64 See Notes/ALLoncpu_notes.txt for more details. Also see
65 Notes/ALLexclusive_notes.txt and Notes/ALLinclusive_notes.txt for a
66 detailed explanation of exclusive vs inclusive function time.