Sobes.tech
Senior

How to see which system calls are being executed by a running application?

sobes.tech AI

Answer from AI

To see which system calls a running application performs, you can use the strace utility in Linux. It allows you to trace all system calls made by a process.

Example of usage:

strace -p <PID>

where <PID> is the process identifier.

If you want to run a program and immediately trace its system calls:

strace ./your_program

For more detailed analysis, you can use options such as:

  • -f — to trace child processes
  • -e trace= — to filter by system call type, for example, -e trace=file for file operations

There are also other tools, such as dtrace (on some systems), perf, ltrace (for tracing library calls), but strace is the most common and straightforward method.