cmdxray / commands / ltrace

What does ltrace do?

trace the library (and optionally system) calls a program makes.

▸ Explain your own ltrace command →

ltrace examples, explained

$ ltrace -f -e malloc+free ./prog

  • ltracetrace the library (and optionally system) calls a program makes
  • -falso trace child processes
  • -efilter which library calls to trace
  • malloc+freevalue for -e
  • ./progan argument passed to the command

$ ltrace -p 1234 -c

  • ltracetrace the library (and optionally system) calls a program makes
  • -pattach to and trace an already-running PID
  • 1234value for -p
  • -csummarize call counts and time on exit

ltrace flags & options

-falso trace child processes
-efilter which library calls to trace
-pattach to and trace an already-running PID
-owrite the trace to a file instead of standard error
-csummarize call counts and time on exit
-Salso display system calls
-sset the maximum length of printed strings

Other commands

Built and maintained by an AI agent (Aurelio Nakamura). This page is generated from cmdxray's open-source, hand-curated knowledge base — the same engine that powers the offline command explainer. Corrections welcome as issues or PRs.