blob: 51a1bf1a8f6b098eac287b8848a78e91c4432b69 [file] [log] [blame]
Juan Cespedes5c3fe062004-06-14 18:08:37 +02001.\" Copyright (c) 1997-2004 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 Cespedesd65efa32003-02-03 00:22:30 +01009.I "[-CdfhiLrStttV] [-a column] [-e expr] [-l filename] [-n nr] [-o filename] [-p pid] ... [-s strsize] [-u username] [--align=column] [--debug] [--demangle] [--help] [--indent=nr] [--library=filename] [--output=filename] [--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 Cespedesd65efa32003-02-03 00:22:30 +010025.I \-a, \-\-align column
26Align return values in a secific column (default column is 5/8 of screen width).
Juan Cespedes07461b61997-08-22 15:29:10 +020027.TP
Juan Cespedesd65efa32003-02-03 00:22:30 +010028.I \-c
29Count time and calls for each library call and report a summary on program exit.
Juan Cespedes5e0acdb1998-04-04 08:34:07 +020030.TP
Juan Cespedesac3db291998-04-25 14:31:58 +020031.I \-C, \-\-demangle
32Decode (demangle) low-level symbol names into user-level names.
33Besides removing any initial underscore prepended by the system,
34this makes C++ function names readable.
35.TP
Juan Cespedesd65efa32003-02-03 00:22:30 +010036.I \-d, \-\-debug
37Increase the debugging level.
38Use more (ie.
39.I \=dd
40) for greater debugging information.
Juan Cespedesac3db291998-04-25 14:31:58 +020041.TP
42.I \-e expr
43A qualifying expression which modifies which events to trace.
44The format of the expression is:
45.br
46[!]value1[,value2]...
47.br
48where the values are the functions to trace. Using an exclamation
49mark negates the set of values. For example
50.I \-e printf
51means to trace only the printf library call. By contrast,
52.I \-e !printf
53means to trace every library call except printf.
Juan Cespedese3eb9aa1999-04-03 03:21:52 +020054.IP
Juan Cespedesac3db291998-04-25 14:31:58 +020055Note that some shells use the exclamation point for history
56expansion; even inside quoted arguments. If so, you must escape
57the exclamation point with a backslash.
58.TP
Juan Cespedesd65efa32003-02-03 00:22:30 +010059.I \-f
60Trace child processes as they are created by
61currently traced processes as a result of the fork(2)
62or clone(2) system calls.
63The new process is attached as soon as its pid is known.
64.TP
Juan Cespedesac3db291998-04-25 14:31:58 +020065.I \-h, \-\-help
66Show a summary of the options to ltrace and exit.
67.TP
Juan Cespedesd65efa32003-02-03 00:22:30 +010068.I \-i
69Print the instruction pointer at the time of the library call.
70.TP
71.I \-l, \-\-library filename
72Display only the symbols included in the library
73.I filename.
74Up to 20 library names can be specified with several instances
75of this option.
76.TP
77.I \-L
78DON'T display library calls (use it with the
79.I \-S
80option).
81.TP
82.I \-n, \-\-indent nr
83Indent trace output by
84.I nr
85number of spaces for each new nested call. Using this option makes
86the program flow visualization easy to follow.
87.TP
88.I \-o, \-\-output filename
89Write the trace output to the file
90.I filename
91rather than to stderr.
92.TP
93.I \-p pid
94Attach to the process with the process ID
95.I pid
96and begin tracing.
97.TP
98.I \-r
99Print a relative timestamp with each line of the trace.
100This records the time difference between the beginning of
101successive lines.
102.TP
103.I \-s strsize
104Specify the maximum string size to print (the default is 32).
105.TP
106.I \-S
107Display system calls as well as library calls
108.TP
109.I \-t
110Prefix each line of the trace with the time of day.
111.TP
112.I \-tt
113If given twice, the time printed will include the microseconds.
114.TP
115.I \-ttt
116If given thrice, the time printed will include the microseconds and
117the leading portion will be printed as the number of seconds since the
118epoch.
119.TP
120.I \-T
121Show the time spent inside each call. This records the time difference
122between the beginning and the end of each call.
123.TP
124.I \-u username
125Run command with the userid, groupid and supplementary groups of
126.IR username .
127This option is only useful when running as root and enables the
128correct execution of setuid and/or setgid binaries.
129.TP
Juan Cespedesac3db291998-04-25 14:31:58 +0200130.I \-V, \-\-version
131Show the version number of ltrace and exit.
Juan Cespedes07461b61997-08-22 15:29:10 +0200132
133.SH BUGS
Juan Cespedesac3db291998-04-25 14:31:58 +0200134It has most of the bugs stated in
135.BR strace(1) .
136.LP
137Manual page and documentation are not very up-to-date.
138.LP
139Option -f sometimes fails to trace some children.
140.LP
Juan Cespedes5c3fe062004-06-14 18:08:37 +0200141It only works on Linux and in a small subset of architectures.
Juan Cespedesac3db291998-04-25 14:31:58 +0200142.LP
Juan Cespedesb1dd77d2002-03-03 00:22:06 +0100143Only ELF32 binaries are supported.
Juan Cespedes07461b61997-08-22 15:29:10 +0200144.PP
Juan Cespedes3268a161997-08-25 16:45:22 +0200145If you like to report a bug, send a notice to the author, or use the
146.BR bug(1)
Juan Cespedesac3db291998-04-25 14:31:58 +0200147program if you are under the Debian GNU/Linux distribution.
Juan Cespedes07461b61997-08-22 15:29:10 +0200148
Juan Cespedes5e01f651998-03-08 22:31:44 +0100149.SH FILES
150.TP
151.I /etc/ltrace.conf
152System configuration file
153.TP
154.I ~/.ltrace.conf
155Personal config file, overrides
156.I /etc/ltrace.conf
157
Juan Cespedes07461b61997-08-22 15:29:10 +0200158.SH AUTHOR
Juan Cespedes64e793b1997-09-11 23:22:36 +0200159Juan Cespedes <cespedes@debian.org>
Juan Cespedes07461b61997-08-22 15:29:10 +0200160
161.SH "SEE ALSO"
162.BR strace(1) ,
163.BR ptrace(2)
164