1 The following are examples of php_cpudist.d.
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.
8 Tracing... Hit Ctrl-C to end.
11 Exclusive function on-CPU times (us),
12 func_abc.php, func, func_a
13 value ------------- Distribution ------------- count
15 16 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1
18 func_abc.php, func, func_b
19 value ------------- Distribution ------------- count
21 16 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1
24 func_abc.php, func, func_c
25 value ------------- Distribution ------------- count
27 16 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1
30 func_abc.php, func, sleep
31 value ------------- Distribution ------------- count
33 16 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 3
37 Inclusive function on-CPU times (us),
38 func_abc.php, func, func_c
39 value ------------- Distribution ------------- count
41 32 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1
44 func_abc.php, func, sleep
45 value ------------- Distribution ------------- count
47 16 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 3
50 func_abc.php, func, func_b
51 value ------------- Distribution ------------- count
53 64 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1
56 func_abc.php, func, func_a
57 value ------------- Distribution ------------- count
59 128 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1
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.
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
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.
77 These elapsed times are the on CPU time from when the subroutine began to
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.