blob: 3846f34d4be4e828ad6f3f5ea374a5da1f9e3425 [file] [log] [blame]
Juan Cespedese3eb9aa1999-04-03 03:21:52 +02001.\" Copyright (c) 1997-1999 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 Cespedes5b3ffdf2001-07-02 00:52:45 +02009.I "[-dfiLSrtttChV] [-a column] [-s strsize] [-o filename] [-n nr] [-u username] [-p pid] ... [-e expr] [--debug] [--demangle] [--align=column] [--output=filename] [--indent=nr] [--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 Cespedese1887051998-03-10 00:08:41 +010083.I \-u username
84Run command with the userid, groupid and supplementary groups of
85.IR username .
86This option is only useful when running as root and enables the
87correct execution of setuid and/or setgid binaries.
88.TP
89.I \-p pid
90Attach to the process with the process ID
91.I pid
92and begin tracing.
Juan Cespedesac3db291998-04-25 14:31:58 +020093.TP
94.I \-e expr
95A qualifying expression which modifies which events to trace.
96The format of the expression is:
97.br
98[!]value1[,value2]...
99.br
100where the values are the functions to trace. Using an exclamation
101mark negates the set of values. For example
102.I \-e printf
103means to trace only the printf library call. By contrast,
104.I \-e !printf
105means to trace every library call except printf.
Juan Cespedese3eb9aa1999-04-03 03:21:52 +0200106.IP
Juan Cespedesac3db291998-04-25 14:31:58 +0200107Note that some shells use the exclamation point for history
108expansion; even inside quoted arguments. If so, you must escape
109the exclamation point with a backslash.
110.TP
111.I \-h, \-\-help
112Show a summary of the options to ltrace and exit.
113.TP
114.I \-V, \-\-version
115Show the version number of ltrace and exit.
Juan Cespedes07461b61997-08-22 15:29:10 +0200116
117.SH BUGS
Juan Cespedesac3db291998-04-25 14:31:58 +0200118It has most of the bugs stated in
119.BR strace(1) .
120.LP
121Manual page and documentation are not very up-to-date.
122.LP
123Option -f sometimes fails to trace some children.
124.LP
Juan Cespedesd44c6b81998-09-25 14:48:42 +0200125It only works on Linux/i386, Linux/m68k, and Linux/arm
Juan Cespedesac3db291998-04-25 14:31:58 +0200126.LP
127Only ELF32 binaries are supported
Juan Cespedes07461b61997-08-22 15:29:10 +0200128.PP
Juan Cespedes3268a161997-08-25 16:45:22 +0200129If you like to report a bug, send a notice to the author, or use the
130.BR bug(1)
Juan Cespedesac3db291998-04-25 14:31:58 +0200131program if you are under the Debian GNU/Linux distribution.
Juan Cespedes07461b61997-08-22 15:29:10 +0200132
Juan Cespedes5e01f651998-03-08 22:31:44 +0100133.SH FILES
134.TP
135.I /etc/ltrace.conf
136System configuration file
137.TP
138.I ~/.ltrace.conf
139Personal config file, overrides
140.I /etc/ltrace.conf
141
Juan Cespedes07461b61997-08-22 15:29:10 +0200142.SH AUTHOR
Juan Cespedes64e793b1997-09-11 23:22:36 +0200143Juan Cespedes <cespedes@debian.org>
Juan Cespedes07461b61997-08-22 15:29:10 +0200144
145.SH "SEE ALSO"
146.BR strace(1) ,
147.BR ptrace(2)
148