ltrace
debuggingLinux
The ltrace command is one of the most frequently used commands in Linux/Unix-like operating systems. ltrace A library call tracer
Quick Reference
Command Name:
ltrace
Category:
debugging
Platform:
Linux
Basic Usage:
ltrace [options] [arguments]
Common Use Cases
Syntax
ltrace [options] [command [arg...]]
Options
Option | Description |
---|---|
-c |
Count time and calls for each library call and report a summary |
-C |
Decode low-level names into user-level names |
-d |
Debug mode |
-e expr |
Choose which library calls to trace using a regular expression |
-f |
Trace child processes as they are created |
-l filename |
Only trace calls to functions within the specified library |
-L |
Don't display library calls |
-n nr |
Set the maximum nesting level for function calls |
-o filename |
Write the trace output to a file instead of stderr |
-p pid |
Attach to the process with the specified PID |
-r |
Print relative timestamps |
-s strsize |
Set the maximum string size to display |
-S |
Trace system calls as well as library calls |
-t |
Print absolute timestamps |
-T |
Show the time spent in each library call |
-u username |
Run command with the permissions of username |
-x expr |
Select which library calls NOT to trace using a regular expression |
Examples
How to Use These Examples
The examples below show common ways to use the ltrace
command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.
# Basic Examples Basic
ltrace ls