-
-
Notifications
You must be signed in to change notification settings - Fork 1
Linux ltrace Guide
Mattscreative edited this page Dec 5, 2025
·
2 revisions
Complete beginner-friendly guide to ltrace on Linux, covering Arch Linux, CachyOS, and other distributions including library call tracing, function calls, and debugging.
Arch/CachyOS:
# Install ltrace
sudo pacman -S ltraceDebian/Ubuntu:
sudo apt install ltraceFedora:
sudo dnf install ltraceBasic usage:
# Trace command
ltrace ls
# Shows library function callsRunning process:
# Trace running process
ltrace -p PID
# -p = PID (traces process by PID)View calls:
# Show library calls
ltrace ls
# Shows:
# - printf()
# - malloc()
# - strcmp()
# - etc.Statistics:
# Summary statistics
ltrace -c ls
# -c = count (shows summary)Specific functions:
# Filter functions
ltrace -e malloc ls
# -e = trace (only malloc() calls)Multiple functions:
# Multiple filters
ltrace -e malloc,free ls
# Traces multiple functionsCheck installation:
# Check ltrace
which ltrace
# Install if missing
sudo pacman -S ltraceThis guide covered ltrace usage, library call tracing, and debugging for Arch Linux, CachyOS, and other distributions.
- strace Guide - System call tracing
- Process Management - Process monitoring
- Debugging - Debugging tools
-
ltrace Documentation:
man ltrace
This guide covers Arch Linux, CachyOS, and other Linux distributions. For distribution-specific details, refer to your distribution's documentation.