blob: 3264929981b74d0105fdafc768f4fa20f45b2ce5 [file] [log] [blame]
Juan Cespedes64e793b1997-09-11 23:22:36 +02001.\" Copyright (c) 1997 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 Cespedesf666d191998-09-20 23:04:34 +02009.I "[-dfiLSrtttChV] [-a column] [-s strsize] [-o filename] [-u username] [-p pid] ... [-e expr] [--debug] [--demangle] [--align=column] [--output=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
77.I \-u username
78Run command with the userid, groupid and supplementary groups of
79.IR username .
80This option is only useful when running as root and enables the
81correct execution of setuid and/or setgid binaries.
82.TP
83.I \-p pid
84Attach to the process with the process ID
85.I pid
86and begin tracing.
Juan Cespedesac3db291998-04-25 14:31:58 +020087.TP
88.I \-e expr
89A qualifying expression which modifies which events to trace.
90The format of the expression is:
91.br
92[!]value1[,value2]...
93.br
94where the values are the functions to trace. Using an exclamation
95mark negates the set of values. For example
96.I \-e printf
97means to trace only the printf library call. By contrast,
98.I \-e !printf
99means to trace every library call except printf.
100.LP
101Note that some shells use the exclamation point for history
102expansion; even inside quoted arguments. If so, you must escape
103the exclamation point with a backslash.
104.TP
105.I \-h, \-\-help
106Show a summary of the options to ltrace and exit.
107.TP
108.I \-V, \-\-version
109Show the version number of ltrace and exit.
Juan Cespedes07461b61997-08-22 15:29:10 +0200110
111.SH BUGS
Juan Cespedesac3db291998-04-25 14:31:58 +0200112It has most of the bugs stated in
113.BR strace(1) .
114.LP
115Manual page and documentation are not very up-to-date.
116.LP
117Option -f sometimes fails to trace some children.
118.LP
119Only Linux/i386 is supported
120.LP
121Only ELF32 binaries are supported
Juan Cespedes07461b61997-08-22 15:29:10 +0200122.PP
Juan Cespedes3268a161997-08-25 16:45:22 +0200123If you like to report a bug, send a notice to the author, or use the
124.BR bug(1)
Juan Cespedesac3db291998-04-25 14:31:58 +0200125program if you are under the Debian GNU/Linux distribution.
Juan Cespedes07461b61997-08-22 15:29:10 +0200126
Juan Cespedes5e01f651998-03-08 22:31:44 +0100127.SH FILES
128.TP
129.I /etc/ltrace.conf
130System configuration file
131.TP
132.I ~/.ltrace.conf
133Personal config file, overrides
134.I /etc/ltrace.conf
135
Juan Cespedes07461b61997-08-22 15:29:10 +0200136.SH AUTHOR
Juan Cespedes64e793b1997-09-11 23:22:36 +0200137Juan Cespedes <cespedes@debian.org>
Juan Cespedes07461b61997-08-22 15:29:10 +0200138
139.SH "SEE ALSO"
140.BR strace(1) ,
141.BR ptrace(2)
142