summaryrefslogtreecommitdiff
path: root/external/cddl/dtracetoolkit/dist/Examples/pl_syscalls_example.txt
blob: 8cd509401708e1afca08d9a71d1af1bf5edf1361 (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
The following are examples of pl_syscalls.d.

This is a simple script to count executed Perl subroutines and system calls.
Here it traces an example program, Code/Perl/func_abc.pl.

   # pl_syscalls.d -c ./func_abc.pl 
   Function A
   Tracing... Hit Ctrl-C to end.
   Function B
   Function C
   
   Calls for PID 305173,
   
    FILE                             TYPE       NAME                      COUNT
    func_abc.pl                      sub        func_a                        1
    func_abc.pl                      sub        func_b                        1
    func_abc.pl                      sub        func_c                        1
    func_abc.pl                      syscall    fcntl                         1
    func_abc.pl                      syscall    getrlimit                     1
    func_abc.pl                      syscall    mmap                          1
    func_abc.pl                      syscall    munmap                        1
    func_abc.pl                      syscall    rexit                         1
    func_abc.pl                      syscall    schedctl                      1
    func_abc.pl                      syscall    sigpending                    1
    func_abc.pl                      syscall    sysi86                        1
    func_abc.pl                      syscall    getgid                        2
    func_abc.pl                      syscall    getpid                        2
    func_abc.pl                      syscall    getuid                        2
    func_abc.pl                      syscall    sigaction                     2
    func_abc.pl                      syscall    sysconfig                     2
    func_abc.pl                      syscall    fstat64                       3
    func_abc.pl                      syscall    nanosleep                     3
    func_abc.pl                      syscall    read                          3
    func_abc.pl                      syscall    setcontext                    3
    func_abc.pl                      syscall    write                         3
    func_abc.pl                      syscall    close                         4
    func_abc.pl                      syscall    ioctl                         4
    func_abc.pl                      syscall    open64                        4
    func_abc.pl                      syscall    llseek                        5
    func_abc.pl                      syscall    gtime                         7
    func_abc.pl                      syscall    brk                          20

While tracing, three subroutines were called - func_a(), func_b() and func_c().
There were numerous system calls made, including 20 brk()'s, 7 gtime()'s
and 5 llseek()'s.

This script can provide an insight to how an application is interacting
with the system, by providing both application subroutine calls and
system calls in the same output.