Trace Library Calls With ltrace

Log dynamic library calls and summarize where time goes.

LinuxdevelopercliDiagnosticsLow risk
Run ltrace -c ./program to print a summary of library calls and their times.

01Command

Command
$ ltrace -c ./my-program

02What it does

ltrace intercepts calls into shared libraries such as malloc, strlen and printf, complementing strace's syscall view. It answers questions about allocation and string handling that source inspection cannot, and is a terminal-native diagnostic.

03Risk

RiskLow risk
Requirementssudo apt install ltrace
!Warning: Only works for dynamically linked binaries, and output can be very large on busy programs.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

Last verified: 2026-10-13 · Category: Developer

06Related solutions