]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/blob - cddl/contrib/dtracetoolkit/Examples/pl_syscalls_example.txt
MFC r368207,368607:
[FreeBSD/stable/10.git] / cddl / contrib / dtracetoolkit / Examples / pl_syscalls_example.txt
1 The following are examples of pl_syscalls.d.
2
3 This is a simple script to count executed Perl subroutines and system calls.
4 Here it traces an example program, Code/Perl/func_abc.pl.
5
6    # pl_syscalls.d -c ./func_abc.pl 
7    Function A
8    Tracing... Hit Ctrl-C to end.
9    Function B
10    Function C
11    
12    Calls for PID 305173,
13    
14     FILE                             TYPE       NAME                      COUNT
15     func_abc.pl                      sub        func_a                        1
16     func_abc.pl                      sub        func_b                        1
17     func_abc.pl                      sub        func_c                        1
18     func_abc.pl                      syscall    fcntl                         1
19     func_abc.pl                      syscall    getrlimit                     1
20     func_abc.pl                      syscall    mmap                          1
21     func_abc.pl                      syscall    munmap                        1
22     func_abc.pl                      syscall    rexit                         1
23     func_abc.pl                      syscall    schedctl                      1
24     func_abc.pl                      syscall    sigpending                    1
25     func_abc.pl                      syscall    sysi86                        1
26     func_abc.pl                      syscall    getgid                        2
27     func_abc.pl                      syscall    getpid                        2
28     func_abc.pl                      syscall    getuid                        2
29     func_abc.pl                      syscall    sigaction                     2
30     func_abc.pl                      syscall    sysconfig                     2
31     func_abc.pl                      syscall    fstat64                       3
32     func_abc.pl                      syscall    nanosleep                     3
33     func_abc.pl                      syscall    read                          3
34     func_abc.pl                      syscall    setcontext                    3
35     func_abc.pl                      syscall    write                         3
36     func_abc.pl                      syscall    close                         4
37     func_abc.pl                      syscall    ioctl                         4
38     func_abc.pl                      syscall    open64                        4
39     func_abc.pl                      syscall    llseek                        5
40     func_abc.pl                      syscall    gtime                         7
41     func_abc.pl                      syscall    brk                          20
42
43 While tracing, three subroutines were called - func_a(), func_b() and func_c().
44 There were numerous system calls made, including 20 brk()'s, 7 gtime()'s
45 and 5 llseek()'s.
46
47 This script can provide an insight to how an application is interacting
48 with the system, by providing both application subroutine calls and
49 system calls in the same output.
50