Browse Docs

๐Ÿ› Tracing (strace / ltrace / gstack)

Strace - trace system calls

1strace -tt -p 24503
2
3strace -o strace01.out -e open -f bash --login -i   # see the files opened during a bash connection.
4    # -o redirects the output / -e filters the system calls / -f follows forks (child processes)
5
6strace -f <binary_script> 2> trace.log :  stdout -> the binary command result, stderr -> the binary's system calls.

Ltrace - trace library calls

ltrace traces shared-library calls (like strace, but at the library-call level).

gstack (SUSE) - investigate a process

1gstack `ps -ef | grep nimserver_agent | grep -v grep | awk -F" " '{print $2}'` > /opt/oss/server/var/logs/nimserver_agent1.stack
Sunday, October 4, 2026 Saturday, August 12, 2023