blob: 220bbdaf94c0f5c1eb491d19d8392299c6696247 [file] [log] [blame]
Juan Cespedesb1dd77d2002-03-03 00:22:06 +01001.\" Copyright (c) 1997-2002 Juan Cespedes <cespedes@debian.org>
Juan Cespedes07461b61997-08-22 15:29:10 +02002.\" This file is covered by the GNU GPL
3.TH ltrace 1
4.SH NAME
5ltrace \- A library call tracer
6
7.SH SYNOPSIS
8.B ltrace
Juan Cespedes1cd999a2001-07-03 00:46:04 +02009.I "[-dfiLSrtttChV] [-a column] [-s strsize] [-o filename] [-n nr] [-l filename] [-u username] [-p pid] ... [-e expr] [--debug] [--demangle] [--align=column] [--output=filename] [--indent=nr] [--library=filename] [--help] [--version] [command [arg ...]]"
Juan Cespedes07461b61997-08-22 15:29:10 +020010
11.SH DESCRIPTION
12.B ltrace
13is a program that simply runs the specified
14.I command
15until it exits. It intercepts and records the dynamic library calls
16which are called by the executed process and the signals which are
17received by that process.
Juan Cespedesac3db291998-04-25 14:31:58 +020018It can also intercept and print the system calls executed by the program.
Juan Cespedes07461b61997-08-22 15:29:10 +020019.PP
20Its use is very similar to
Juan Cespedes81690ef1998-03-13 19:31:29 +010021.BR strace(1) .
Juan Cespedes07461b61997-08-22 15:29:10 +020022
23.SH OPTIONS
24.TP
Juan Cespedesac3db291998-04-25 14:31:58 +020025.I \-d, \-\-debug
Juan Cespedes1afec691997-08-23 21:31:46 +020026Increase the debugging level.
Juan Cespedesb1dd77d2002-03-03 00:22:06 +010027Use more (ie.
28.I \=dd
29) for greater debugging information.
Juan Cespedes07461b61997-08-22 15:29:10 +020030.TP
Juan Cespedes5e01f651998-03-08 22:31:44 +010031.I \-f
32Trace child processes as they are created by
33currently traced processes as a result of the fork(2)
34or clone(2) system calls.
35The new process is attached as soon as its pid is known.
36.TP
Juan Cespedesac3db291998-04-25 14:31:58 +020037.I \-i
38Print the instruction pointer at the time of the library call.
39.TP
Juan Cespedes5e01f651998-03-08 22:31:44 +010040.I \-L
41DON'T display library calls (use it with the
42.I \-S
43option).
44.TP
Juan Cespedes5e4455b1997-08-24 01:48:26 +020045.I \-S
46Display system calls as well as library calls
47.TP
Juan Cespedesf666d191998-09-20 23:04:34 +020048.I \-r
49Print a relative timestamp with each line of the trace.
50This records the time difference between the beginning of
51successive lines.
52.TP
Juan Cespedes5e0acdb1998-04-04 08:34:07 +020053.I \-t
54Prefix each line of the trace with the time of day.
55.TP
56.I \-tt
57If given twice, the time printed will include the microseconds.
58.TP
59.I \-ttt
60If given thrice, the time printed will include the microseconds and
61the leading portion will be printed as the number of seconds since the
62epoch.
63.TP
Juan Cespedesac3db291998-04-25 14:31:58 +020064.I \-C, \-\-demangle
65Decode (demangle) low-level symbol names into user-level names.
66Besides removing any initial underscore prepended by the system,
67this makes C++ function names readable.
68.TP
69.I \-a, \-\-align column
Juan Cespedese1887051998-03-10 00:08:41 +010070Align return values in a secific column (default column 50).
71.TP
72.I \-s
73Specify the maximum string size to print (the default is 32).
74.TP
Juan Cespedesac3db291998-04-25 14:31:58 +020075.I \-o, \-\-output filename
Juan Cespedes07461b61997-08-22 15:29:10 +020076Write the trace output to the file
77.I filename
78rather than to stderr.
Juan Cespedese1887051998-03-10 00:08:41 +010079.TP
Juan Cespedes5b3ffdf2001-07-02 00:52:45 +020080.I \-n, \-\-indent nr
81Indent trace output by
82.I nr
83number of spaces for each new nested call. Using this option makes
84the program flow visualization easy to follow.
85.TP
Juan Cespedes1cd999a2001-07-03 00:46:04 +020086.I \-l, \-\-library filename
87Display only the symbols included in the library
88.I filename.
89Up to 20 library names can be specified with several instances
90of this option.
91.TP
Juan Cespedese1887051998-03-10 00:08:41 +010092.I \-u username
93Run command with the userid, groupid and supplementary groups of
94.IR username .
95This option is only useful when running as root and enables the
96correct execution of setuid and/or setgid binaries.
97.TP
98.I \-p pid
99Attach to the process with the process ID
100.I pid
101and begin tracing.
Juan Cespedesac3db291998-04-25 14:31:58 +0200102.TP
103.I \-e expr
104A qualifying expression which modifies which events to trace.
105The format of the expression is:
106.br
107[!]value1[,value2]...
108.br
109where the values are the functions to trace. Using an exclamation
110mark negates the set of values. For example
111.I \-e printf
112means to trace only the printf library call. By contrast,
113.I \-e !printf
114means to trace every library call except printf.
Juan Cespedese3eb9aa1999-04-03 03:21:52 +0200115.IP
Juan Cespedesac3db291998-04-25 14:31:58 +0200116Note that some shells use the exclamation point for history
117expansion; even inside quoted arguments. If so, you must escape
118the exclamation point with a backslash.
119.TP
120.I \-h, \-\-help
121Show a summary of the options to ltrace and exit.
122.TP
123.I \-V, \-\-version
124Show the version number of ltrace and exit.
Juan Cespedes07461b61997-08-22 15:29:10 +0200125
126.SH BUGS
Juan Cespedesac3db291998-04-25 14:31:58 +0200127It has most of the bugs stated in
128.BR strace(1) .
129.LP
130Manual page and documentation are not very up-to-date.
131.LP
132Option -f sometimes fails to trace some children.
133.LP
Juan Cespedesb1dd77d2002-03-03 00:22:06 +0100134It only works on Linux/i386, Linux/m68k, Linux/arm, and Linux/S390.
Juan Cespedesac3db291998-04-25 14:31:58 +0200135.LP
Juan Cespedesb1dd77d2002-03-03 00:22:06 +0100136Only ELF32 binaries are supported.
Juan Cespedes07461b61997-08-22 15:29:10 +0200137.PP
Juan Cespedes3268a161997-08-25 16:45:22 +0200138If you like to report a bug, send a notice to the author, or use the
139.BR bug(1)
Juan Cespedesac3db291998-04-25 14:31:58 +0200140program if you are under the Debian GNU/Linux distribution.
Juan Cespedes07461b61997-08-22 15:29:10 +0200141
Juan Cespedes5e01f651998-03-08 22:31:44 +0100142.SH FILES
143.TP
144.I /etc/ltrace.conf
145System configuration file
146.TP
147.I ~/.ltrace.conf
148Personal config file, overrides
149.I /etc/ltrace.conf
150
Juan Cespedes07461b61997-08-22 15:29:10 +0200151.SH AUTHOR
Juan Cespedes64e793b1997-09-11 23:22:36 +0200152Juan Cespedes <cespedes@debian.org>
Juan Cespedes07461b61997-08-22 15:29:10 +0200153
154.SH "SEE ALSO"
155.BR strace(1) ,
156.BR ptrace(2)
157