aboutsummaryrefslogtreecommitdiff
path: root/cddl/contrib/dtracetoolkit/Examples/js_cputime_example.txt
blob: dff42fdca9fa1b77d3a5490f7731f3a1b14075b0 (plain) (blame)
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
The following are examples of js_cputime.d.

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

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

Count,
   FILE                 TYPE       NAME                                COUNT
   func_clock.html      func       func_a                                  5
   func_clock.html      func       func_b                                  5
   func_clock.html      func       func_c                                  5
   func_clock.html      func       setTimeout                              5
   func_clock.html      func       start                                   5
   func_clock.html      obj-new    Date                                    5
   func_clock.html      func       getElementById                         20
   -                    total      -                                      50

Elapsed times (us),
   FILE                 TYPE       NAME                                TOTAL
   -                    total      -                                      37
   func_clock.html      obj-new    Date                                   37

Exclusive function on-CPU times (us),
   FILE                 TYPE       NAME                                TOTAL
   func_clock.html      func       setTimeout                            316
   func_clock.html      func       getElementById                        588
   func_clock.html      func       start                                4734
   func_clock.html      func       func_a                              83465
   func_clock.html      func       func_b                             166613
   func_clock.html      func       func_c                             247683
   -                    total      -                                  503402

Inclusive function on-CPU times (us),
   FILE                 TYPE       NAME                                TOTAL
   func_clock.html      func       setTimeout                            316
   func_clock.html      func       getElementById                        588
   func_clock.html      func       func_c                             247872
   func_clock.html      func       func_b                             414601
   func_clock.html      func       func_a                             498142
   func_clock.html      func       start                              503439

You can see the results are printed in four sections.

The first section reports how many times each subroutine was called, and it's
type.

The second section reports on the on-CPU time of anything that was not of type
"func", in this case the only elements reported here are Date obj-new.

The exclusive subroutine on-CPU times shows, amongst other results, that func_a 
spent around 83,000 microseconds on-CPU.  This time excludes time spent in 
other subroutines.

The inclusive subroutine on-CPU times show that func_a spent around 0.5
seconds on-CPU.  This includes the time spent in other subroutines
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.