blob: 0bf818b17343ca5c3c9cce6a64e0d58032c84ee2 [file] [log] [blame]
Juan Cespedes21c63a12001-07-07 20:56:56 +02001.\" Copyright (c) 1997-2001 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 Cespedes07461b61997-08-22 15:29:10 +020027.TP
Juan Cespedes5e01f651998-03-08 22:31:44 +010028.I \-f
29Trace child processes as they are created by
30currently traced processes as a result of the fork(2)
31or clone(2) system calls.
32The new process is attached as soon as its pid is known.
33.TP
Juan Cespedesac3db291998-04-25 14:31:58 +020034.I \-i
35Print the instruction pointer at the time of the library call.
36.TP
Juan Cespedes5e01f651998-03-08 22:31:44 +010037.I \-L
38DON'T display library calls (use it with the
39.I \-S
40option).
41.TP
Juan Cespedes5e4455b1997-08-24 01:48:26 +020042.I \-S
43Display system calls as well as library calls
44.TP
Juan Cespedesf666d191998-09-20 23:04:34 +020045.I \-r
46Print a relative timestamp with each line of the trace.
47This records the time difference between the beginning of
48successive lines.
49.TP
Juan Cespedes5e0acdb1998-04-04 08:34:07 +020050.I \-t
51Prefix each line of the trace with the time of day.
52.TP
53.I \-tt
54If given twice, the time printed will include the microseconds.
55.TP
56.I \-ttt
57If given thrice, the time printed will include the microseconds and
58the leading portion will be printed as the number of seconds since the
59epoch.
60.TP
Juan Cespedesac3db291998-04-25 14:31:58 +020061.I \-C, \-\-demangle
62Decode (demangle) low-level symbol names into user-level names.
63Besides removing any initial underscore prepended by the system,
64this makes C++ function names readable.
65.TP
66.I \-a, \-\-align column
Juan Cespedese1887051998-03-10 00:08:41 +010067Align return values in a secific column (default column 50).
68.TP
69.I \-s
70Specify the maximum string size to print (the default is 32).
71.TP
Juan Cespedesac3db291998-04-25 14:31:58 +020072.I \-o, \-\-output filename
Juan Cespedes07461b61997-08-22 15:29:10 +020073Write the trace output to the file
74.I filename
75rather than to stderr.
Juan Cespedese1887051998-03-10 00:08:41 +010076.TP
Juan Cespedes5b3ffdf2001-07-02 00:52:45 +020077.I \-n, \-\-indent nr
78Indent trace output by
79.I nr
80number of spaces for each new nested call. Using this option makes
81the program flow visualization easy to follow.
82.TP
Juan Cespedes1cd999a2001-07-03 00:46:04 +020083.I \-l, \-\-library filename
84Display only the symbols included in the library
85.I filename.
86Up to 20 library names can be specified with several instances
87of this option.
88.TP
Juan Cespedese1887051998-03-10 00:08:41 +010089.I \-u username
90Run command with the userid, groupid and supplementary groups of
91.IR username .
92This option is only useful when running as root and enables the
93correct execution of setuid and/or setgid binaries.
94.TP
95.I \-p pid
96Attach to the process with the process ID
97.I pid
98and begin tracing.
Juan Cespedesac3db291998-04-25 14:31:58 +020099.TP
100.I \-e expr
101A qualifying expression which modifies which events to trace.
102The format of the expression is:
103.br
104[!]value1[,value2]...
105.br
106where the values are the functions to trace. Using an exclamation
107mark negates the set of values. For example
108.I \-e printf
109means to trace only the printf library call. By contrast,
110.I \-e !printf
111means to trace every library call except printf.
Juan Cespedese3eb9aa1999-04-03 03:21:52 +0200112.IP
Juan Cespedesac3db291998-04-25 14:31:58 +0200113Note that some shells use the exclamation point for history
114expansion; even inside quoted arguments. If so, you must escape
115the exclamation point with a backslash.
116.TP
117.I \-h, \-\-help
118Show a summary of the options to ltrace and exit.
119.TP
120.I \-V, \-\-version
121Show the version number of ltrace and exit.
Juan Cespedes07461b61997-08-22 15:29:10 +0200122
123.SH BUGS
Juan Cespedesac3db291998-04-25 14:31:58 +0200124It has most of the bugs stated in
125.BR strace(1) .
126.LP
127Manual page and documentation are not very up-to-date.
128.LP
129Option -f sometimes fails to trace some children.
130.LP
Juan Cespedesd44c6b81998-09-25 14:48:42 +0200131It only works on Linux/i386, Linux/m68k, and Linux/arm
Juan Cespedesac3db291998-04-25 14:31:58 +0200132.LP
133Only ELF32 binaries are supported
Juan Cespedes07461b61997-08-22 15:29:10 +0200134.PP
Juan Cespedes3268a161997-08-25 16:45:22 +0200135If you like to report a bug, send a notice to the author, or use the
136.BR bug(1)
Juan Cespedesac3db291998-04-25 14:31:58 +0200137program if you are under the Debian GNU/Linux distribution.
Juan Cespedes07461b61997-08-22 15:29:10 +0200138
Juan Cespedes5e01f651998-03-08 22:31:44 +0100139.SH FILES
140.TP
141.I /etc/ltrace.conf
142System configuration file
143.TP
144.I ~/.ltrace.conf
145Personal config file, overrides
146.I /etc/ltrace.conf
147
Juan Cespedes07461b61997-08-22 15:29:10 +0200148.SH AUTHOR
Juan Cespedes64e793b1997-09-11 23:22:36 +0200149Juan Cespedes <cespedes@debian.org>
Juan Cespedes07461b61997-08-22 15:29:10 +0200150
151.SH "SEE ALSO"
152.BR strace(1) ,
153.BR ptrace(2)
154