Training courses

Kernel and Embedded Linux

Bootlin training courses

Embedded Linux, kernel,
Yocto Project, Buildroot, real-time,
graphics, boot time, debugging...

Bootlin logo

Elixir Cross Referencer

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.