aboutsummaryrefslogtreecommitdiff
path: root/cddl/contrib/dtracetoolkit/Examples/php_cpudist_example.txt
blob: 6da7d29d8f4d6a8f2920ed714802b2fa843bb8cb (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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
The following are examples of php_cpudist.d.

This script traces the on-CPU time of PHP functions and prints a report
containing distribution plots per subroutine. Here it traces the example 
program Code/Php/func_abc.php.

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

Exclusive function on-CPU times (us),
   func_abc.php, func, func_a 
           value  ------------- Distribution ------------- count    
               8 |                                         0        
              16 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1        
              32 |                                         0        

   func_abc.php, func, func_b 
           value  ------------- Distribution ------------- count    
               8 |                                         0        
              16 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1        
              32 |                                         0        

   func_abc.php, func, func_c 
           value  ------------- Distribution ------------- count    
               8 |                                         0        
              16 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1        
              32 |                                         0        

   func_abc.php, func, sleep 
           value  ------------- Distribution ------------- count    
               8 |                                         0        
              16 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 3        
              32 |                                         0        


Inclusive function on-CPU times (us),
   func_abc.php, func, func_c 
           value  ------------- Distribution ------------- count    
              16 |                                         0        
              32 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1        
              64 |                                         0        

   func_abc.php, func, sleep 
           value  ------------- Distribution ------------- count    
               8 |                                         0        
              16 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 3        
              32 |                                         0        

   func_abc.php, func, func_b 
           value  ------------- Distribution ------------- count    
              32 |                                         0        
              64 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1        
             128 |                                         0        

   func_abc.php, func, func_a 
           value  ------------- Distribution ------------- count    
              64 |                                         0        
             128 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1        
             256 |                                         0        

In total, 3 subroutines were called, one each of func_a(), func_b() and
func_c(), and sleep was called 3 times.  You can see this reflected in the
"count" column on the right.

The exclusive subroutine elapsed times show that each subroutine spent
between 16 and 31 microseconds on CPU. This time excludes the time spent in
other subroutines.

The inclusive subroutine elapsed times show that func_c() took between 32 
microseconds and 63 microseconds on CPU; sleep ran three times and each time 
took between 16 and 31 microseconds on CPU; func_b() took between 64 and 127 
microseconds on CPU; and func_a() took between 128 and 255 microseconds on
CPU.  This time includes the time spent in other subroutines called, and since 
func_a() called func_b() which called func_c(), these times make sense.

These elapsed times are the on CPU time from when the subroutine began to
when it completed.

On-CPU times are useful for showing who is causing the CPUs to be busy.
See Notes/ALLelapsed_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.