]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/blob - cddl/contrib/dtracetoolkit/Examples/php_cpudist_example.txt
Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.
[FreeBSD/stable/10.git] / cddl / contrib / dtracetoolkit / Examples / php_cpudist_example.txt
1 The following are examples of php_cpudist.d.
2
3 This script traces the on-CPU time of PHP functions and prints a report
4 containing distribution plots per subroutine. Here it traces the example 
5 program Code/Php/func_abc.php.
6
7 # php_cpudist.d
8 Tracing... Hit Ctrl-C to end.
9 ^C
10
11 Exclusive function on-CPU times (us),
12    func_abc.php, func, func_a 
13            value  ------------- Distribution ------------- count    
14                8 |                                         0        
15               16 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1        
16               32 |                                         0        
17
18    func_abc.php, func, func_b 
19            value  ------------- Distribution ------------- count    
20                8 |                                         0        
21               16 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1        
22               32 |                                         0        
23
24    func_abc.php, func, func_c 
25            value  ------------- Distribution ------------- count    
26                8 |                                         0        
27               16 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1        
28               32 |                                         0        
29
30    func_abc.php, func, sleep 
31            value  ------------- Distribution ------------- count    
32                8 |                                         0        
33               16 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 3        
34               32 |                                         0        
35
36
37 Inclusive function on-CPU times (us),
38    func_abc.php, func, func_c 
39            value  ------------- Distribution ------------- count    
40               16 |                                         0        
41               32 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1        
42               64 |                                         0        
43
44    func_abc.php, func, sleep 
45            value  ------------- Distribution ------------- count    
46                8 |                                         0        
47               16 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 3        
48               32 |                                         0        
49
50    func_abc.php, func, func_b 
51            value  ------------- Distribution ------------- count    
52               32 |                                         0        
53               64 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1        
54              128 |                                         0        
55
56    func_abc.php, func, func_a 
57            value  ------------- Distribution ------------- count    
58               64 |                                         0        
59              128 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1        
60              256 |                                         0        
61
62 In total, 3 subroutines were called, one each of func_a(), func_b() and
63 func_c(), and sleep was called 3 times.  You can see this reflected in the
64 "count" column on the right.
65
66 The exclusive subroutine elapsed times show that each subroutine spent
67 between 16 and 31 microseconds on CPU. This time excludes the time spent in
68 other subroutines.
69
70 The inclusive subroutine elapsed times show that func_c() took between 32 
71 microseconds and 63 microseconds on CPU; sleep ran three times and each time 
72 took between 16 and 31 microseconds on CPU; func_b() took between 64 and 127 
73 microseconds on CPU; and func_a() took between 128 and 255 microseconds on
74 CPU.  This time includes the time spent in other subroutines called, and since 
75 func_a() called func_b() which called func_c(), these times make sense.
76
77 These elapsed times are the on CPU time from when the subroutine began to
78 when it completed.
79
80 On-CPU times are useful for showing who is causing the CPUs to be busy.
81 See Notes/ALLelapsed_notes.txt for more details. Also see
82 Notes/ALLexclusive_notes.txt and Notes/ALLinclusive_notes.txt for a
83 detailed explanation of exclusive vs inclusive subroutine time.
84