Forrest logo
back to the ltrace tool

ltrace:tldr:17711

ltrace: Trace calls to malloc and free, omit those done by libc.
$ ltrace -e malloc+free-@libc.so* ${path-to-program}
try on your machine

This command uses the ltrace tool to trace and print the dynamic library calls made by a program.

Here is a breakdown of the command structure and its components:

  • ltrace: This is the command used to run the ltrace tool.
  • -e malloc+free-@libc.so*: This option specifies the set of library calls to trace. In this case, it traces only the malloc and free calls from the libc.so library.
  • ${path-to-program}: This is the placeholder for the path to the program you want to trace. You should replace it with the actual path to the program you want to analyze.

By running this command, you will get a trace of all the malloc and free calls made by the specified program, providing insights into memory allocation and deallocation patterns. The output will show the function calls, their arguments, and any return values.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the ltrace tool