HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

truss — Troubleshooting tool for tracing system calls. SunOS equivalent of strace. More information: <https:

Submitted by: @import:tldr-pages··
0
Viewed 0 times
troubleshootingcommandclitoolfortrusstracingsystem
linux

Problem

How to use the truss command: Troubleshooting tool for tracing system calls. SunOS equivalent of strace. More information: <https://www.unix.com/man-page/linux/1/truss>.

Solution

truss — Troubleshooting tool for tracing system calls. SunOS equivalent of strace. More information: <https://www.unix.com/man-page/linux/1/truss>.

Start tracing a program by executing it, following all child processes:
truss -f {{program}}


Start tracing a specific process by its PID:
truss -p {{pid}}


Start tracing a program by executing it, showing arguments and environment variables:
truss -a -e {{program}}


Count time, calls, and errors for each system call and report a summary on program exit:
truss -c -p {{pid}}


Trace a process filtering output by system call:
truss -p {{pid}} -t {{system_call_name}}

Code Snippets

Start tracing a program by executing it, following all child processes

truss -f {{program}}

Start tracing a specific process by its PID

truss -p {{pid}}

Start tracing a program by executing it, showing arguments and environment variables

truss -a -e {{program}}

Count time, calls, and errors for each system call and report a summary on program exit

truss -c -p {{pid}}

Trace a process filtering output by system call

truss -p {{pid}} -t {{system_call_name}}

Context

tldr-pages: sunos/truss

Revisions (0)

No revisions yet.