Overview

The ltrace utility allows users to trace the library calls of a given application. It uses ptrace to intercept and record dynamic library calls.

Project Information

Installation Instructions

Available by default at the Linaro developer image, and also at the Overlay PPA. To install it at any Linaro image, just run:

sudo apt-get install ltrace

Using ltrace

Typical:

$ ltrace git help
__libc_start_main(0x404750, 2, 0x7fff4c526a18, 0x4df230, 0x4df2c0 <unfinished ...>
strlen("git")                                    = 3
getenv("PATH")                                   = "/home/nchip/bin:/usr/local/sbin:"...
getenv("GIT_EXEC_PATH")                          = NULL
strlen("/usr/lib/git-core")                      = 17
realloc(NULL, 24)                                = 0x00c5a010
....

Attaching to a running process with pid 12345

ltrace -p 12345
read(0, ":", 4096)                                                                            = 1
memmove(0x7d2296, 0x7d7840, 1, -1, 0)                                                         = 0x7d2296
select(1, 0x7fff2f35c9b0, 0, 0x7fff2f35c930, 0x7fff2f35ca30)                                  = 0
malloc(100)                                                                                   = 0x01154df0
...

Limitations


CategoryHowTo

Platform/DevPlatform/Tools/Ltrace (last modified 2011-09-01 04:06:19)