1 .\" Copyright (c) 1997-2005 Juan Cespedes <cespedes@debian.org>
2 .\" This file is covered by the GNU GPL
5 ltrace \- A library call tracer
9 .I "[-CfhiLrStttV] [-a column] [-A maxelts] [-D level] [-e expr] [-l filename] [-n nr] [-o filename] [-p pid] ... [-s strsize] [-u username] [-X extern] [-x extern] ... [--align=column] [--debug=level] [--demangle] [--help] [--indent=nr] [--library=filename] [--output=filename] [--version] [command [arg ...]]"
13 is a program that simply runs the specified
15 until it exits. It intercepts and records the dynamic library calls
16 which are called by the executed process and the signals which are
17 received by that process.
18 It can also intercept and print the system calls executed by the program.
20 Its use is very similar to
25 .I \-a, \-\-align column
26 Align return values in a specific column (default column is 5/8 of screen width).
29 Maximum number of array elements to print before suppressing the rest with an ellipsis ("...")
32 Count time and calls for each library call and report a summary on program exit.
35 Decode (demangle) low-level symbol names into user-level names.
36 Besides removing any initial underscore prefix used by the system,
37 this makes C++ function names readable.
39 .I \-D, \-\-debug level
40 Show debugging output of
44 must be a sum of some of the following numbers:
48 DEBUG_GENERAL. Shows helpful progress information
51 DEBUG_EVENT. Shows every event received by a traced program
54 DEBUG_PROCESS. Shows every action
56 carries upon a traced process
59 DEBUG_FUNCTION. Shows every entry to internal functions
63 A qualifying expression which modifies which events to trace.
64 The format of the expression is:
68 where the values are the functions to trace. Using an exclamation
69 mark negates the set of values. For example
71 means to trace only the printf library call. By contrast,
73 means to trace every library call except printf.
75 Note that some shells use the exclamation point for history
76 expansion; even inside quoted arguments. If so, you must escape
77 the exclamation point with a backslash.
80 Trace child processes as they are created by
81 currently traced processes as a result of the fork(2)
82 or clone(2) system calls.
83 The new process is attached immediately.
86 Load an alternate config file. Normally, /etc/ltrace.conf and
87 ~/.ltrace.conf will be read (the latter only if it exists).
88 Use this option to load the given file or files instead of
89 those two default files.
92 Show a summary of the options to ltrace and exit.
95 Print the instruction pointer at the time of the library call.
97 .I \-l, \-\-library filename
98 Display only the symbols included in the library
100 Up to 30 library names can be specified with several instances
104 DON'T display library calls (use it with the
108 .I \-n, \-\-indent nr
109 Indent trace output by
111 number of spaces for each new nested call. Using this option makes
112 the program flow visualization easy to follow.
114 .I \-o, \-\-output filename
115 Write the trace output to the file
117 rather than to stderr.
120 Attach to the process with the process ID
125 Print a relative timestamp with each line of the trace.
126 This records the time difference between the beginning of
130 Specify the maximum string size to print (the default is 32).
133 Display system calls as well as library calls
136 Prefix each line of the trace with the time of day.
139 If given twice, the time printed will include the microseconds.
142 If given thrice, the time printed will include the microseconds and
143 the leading portion will be printed as the number of seconds since the
147 Show the time spent inside each call. This records the time difference
148 between the beginning and the end of each call.
151 Run command with the userid, groupid and supplementary groups of
153 This option is only useful when running as root and enables the
154 correct execution of setuid and/or setgid binaries.
157 Some architectures need to know where to set a breakpoint that will be hit
158 after the dynamic linker has run. If this flag is used, then the breakpoint
161 which must be an external function. By default, '_start' is used.
162 NOTE: this flag is only available on the architectures that need it.
165 Trace the external function
167 This option may be repeated.
170 Show the version number of ltrace and exit.
173 It has most of the bugs stated in
176 Manual page and documentation are not very up-to-date.
178 Option -f sometimes fails to trace some children.
180 It only works on Linux and in a small subset of architectures.
182 Only ELF32 binaries are supported.
184 Calls to dlopen()ed libraries will not be traced.
186 If you would like to report a bug, send a message to the mailing list
187 (ltrace-devel@lists.alioth.debian.org), or use the
189 program if you are under the Debian GNU/Linux distribution.
194 System configuration file
197 Personal config file, overrides
201 Juan Cespedes <cespedes@debian.org>