summaryrefslogtreecommitdiffstats
path: root/cddl/contrib/dtracetoolkit/Examples/php_syscolors_example.txt
blob: 96b26a8877df46c9971c560b8b26ee8703b08377 (plain)
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
The following are examples of php_syscolors.d.

This is a simple script to trace the flow of PHP functions and system
calls made, and renders the output in color ("colour") using terminal
escape sequences (which you can tweak by modifying the script).

Here it traces the example program, Code/Php/func_abc.php.

WARNING: This output is full of terminal escape sequences, so if you are
trying to view this through an editor or web browser - it may look awful.
Try viewing this using "more" (although, depending on your terminal, it
still may look awful).

# php_syscolors.d
C    PID/TID   DELTA(us)              FILE:LINE TYPE     -- NAME
0  18426/1             8      func_abc.php:22   func     -> func_a
0  18426/1            41      func_abc.php:18   func       -> sleep
0  18426/1            15                 ":-    syscall      -> nanosleep
0  18426/1       1008700                 ":-    syscall      <- nanosleep
0  18426/1            30      func_abc.php:18   func       <- sleep
0  18426/1            42      func_abc.php:19   func       -> func_b
0  18426/1            28      func_abc.php:11   func         -> sleep
0  18426/1            14                 ":-    syscall        -> nanosleep
0  18426/1       1010083                 ":-    syscall        <- nanosleep
0  18426/1            29      func_abc.php:11   func         <- sleep
0  18426/1            43      func_abc.php:12   func         -> func_c
0  18426/1            28      func_abc.php:5    func           -> sleep
0  18426/1            14                 ":-    syscall          -> nanosleep
0  18426/1       1009794                 ":-    syscall          <- nanosleep
0  18426/1            28      func_abc.php:5    func           <- sleep
0  18426/1            34      func_abc.php:6    func         <- func_c
0  18426/1            18      func_abc.php:13   func       <- func_b
0  18426/1            17      func_abc.php:20   func     <- func_a
0  18426/1            21                 ":-    syscall  -> fchdir
0  18426/1            19                 ":-    syscall  <- fchdir
0  18426/1             9                 ":-    syscall  -> close
0  18426/1            13                 ":-    syscall  <- close
0  18426/1            35                 ":-    syscall  -> semsys
0  18426/1            12                 ":-    syscall  <- semsys
0  18426/1             7                 ":-    syscall  -> semsys
0  18426/1             7                 ":-    syscall  <- semsys
0  18426/1            66                 ":-    syscall  -> setitimer
0  18426/1             8                 ":-    syscall  <- setitimer
0  18426/1            39                 ":-    syscall  -> read
0  18426/1            14                 ":-    syscall  <- read
0  18426/1            11                 ":-    syscall  -> writev
0  18426/1            22                 ":-    syscall  <- writev
0  18426/1            23                 ":-    syscall  -> write
0  18426/1           110                 ":-    syscall  <- write
0  18426/1            61                 ":-    syscall  -> pollsys

In this excerpt:
0  18426/1            43      func_abc.php:12   func         -> func_c
0  18426/1            28      func_abc.php:5    func           -> sleep
0  18426/1            14                 ":-    syscall          -> nanosleep
0  18426/1       1009794                 ":-    syscall          <- nanosleep
0  18426/1            28      func_abc.php:5    func           <- sleep
0  18426/1            34      func_abc.php:6    func         <- func_c

we can see that we are at Line 12 of the program which invokes func_c.  func_c
then invokes sleep, which uses the syscall nanosleep.  Approximately one
second later nanosleep returns, then sleep finishes, then func_c finishes.

OpenPOWER on IntegriCloud