Juan Cespedes | 5c3fe06 | 2004-06-14 18:08:37 +0200 | [diff] [blame^] | 1 | .\" Copyright (c) 1997-2004 Juan Cespedes <cespedes@debian.org> |
Juan Cespedes | 07461b6 | 1997-08-22 15:29:10 +0200 | [diff] [blame] | 2 | .\" This file is covered by the GNU GPL |
| 3 | .TH ltrace 1 |
| 4 | .SH NAME |
| 5 | ltrace \- A library call tracer |
| 6 | |
| 7 | .SH SYNOPSIS |
| 8 | .B ltrace |
Juan Cespedes | d65efa3 | 2003-02-03 00:22:30 +0100 | [diff] [blame] | 9 | .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 Cespedes | 07461b6 | 1997-08-22 15:29:10 +0200 | [diff] [blame] | 10 | |
| 11 | .SH DESCRIPTION |
| 12 | .B ltrace |
| 13 | is a program that simply runs the specified |
| 14 | .I command |
| 15 | until it exits. It intercepts and records the dynamic library calls |
| 16 | which are called by the executed process and the signals which are |
| 17 | received by that process. |
Juan Cespedes | ac3db29 | 1998-04-25 14:31:58 +0200 | [diff] [blame] | 18 | It can also intercept and print the system calls executed by the program. |
Juan Cespedes | 07461b6 | 1997-08-22 15:29:10 +0200 | [diff] [blame] | 19 | .PP |
| 20 | Its use is very similar to |
Juan Cespedes | 81690ef | 1998-03-13 19:31:29 +0100 | [diff] [blame] | 21 | .BR strace(1) . |
Juan Cespedes | 07461b6 | 1997-08-22 15:29:10 +0200 | [diff] [blame] | 22 | |
| 23 | .SH OPTIONS |
| 24 | .TP |
Juan Cespedes | d65efa3 | 2003-02-03 00:22:30 +0100 | [diff] [blame] | 25 | .I \-a, \-\-align column |
| 26 | Align return values in a secific column (default column is 5/8 of screen width). |
Juan Cespedes | 07461b6 | 1997-08-22 15:29:10 +0200 | [diff] [blame] | 27 | .TP |
Juan Cespedes | d65efa3 | 2003-02-03 00:22:30 +0100 | [diff] [blame] | 28 | .I \-c |
| 29 | Count time and calls for each library call and report a summary on program exit. |
Juan Cespedes | 5e0acdb | 1998-04-04 08:34:07 +0200 | [diff] [blame] | 30 | .TP |
Juan Cespedes | ac3db29 | 1998-04-25 14:31:58 +0200 | [diff] [blame] | 31 | .I \-C, \-\-demangle |
| 32 | Decode (demangle) low-level symbol names into user-level names. |
| 33 | Besides removing any initial underscore prepended by the system, |
| 34 | this makes C++ function names readable. |
| 35 | .TP |
Juan Cespedes | d65efa3 | 2003-02-03 00:22:30 +0100 | [diff] [blame] | 36 | .I \-d, \-\-debug |
| 37 | Increase the debugging level. |
| 38 | Use more (ie. |
| 39 | .I \=dd |
| 40 | ) for greater debugging information. |
Juan Cespedes | ac3db29 | 1998-04-25 14:31:58 +0200 | [diff] [blame] | 41 | .TP |
| 42 | .I \-e expr |
| 43 | A qualifying expression which modifies which events to trace. |
| 44 | The format of the expression is: |
| 45 | .br |
| 46 | [!]value1[,value2]... |
| 47 | .br |
| 48 | where the values are the functions to trace. Using an exclamation |
| 49 | mark negates the set of values. For example |
| 50 | .I \-e printf |
| 51 | means to trace only the printf library call. By contrast, |
| 52 | .I \-e !printf |
| 53 | means to trace every library call except printf. |
Juan Cespedes | e3eb9aa | 1999-04-03 03:21:52 +0200 | [diff] [blame] | 54 | .IP |
Juan Cespedes | ac3db29 | 1998-04-25 14:31:58 +0200 | [diff] [blame] | 55 | Note that some shells use the exclamation point for history |
| 56 | expansion; even inside quoted arguments. If so, you must escape |
| 57 | the exclamation point with a backslash. |
| 58 | .TP |
Juan Cespedes | d65efa3 | 2003-02-03 00:22:30 +0100 | [diff] [blame] | 59 | .I \-f |
| 60 | Trace child processes as they are created by |
| 61 | currently traced processes as a result of the fork(2) |
| 62 | or clone(2) system calls. |
| 63 | The new process is attached as soon as its pid is known. |
| 64 | .TP |
Juan Cespedes | ac3db29 | 1998-04-25 14:31:58 +0200 | [diff] [blame] | 65 | .I \-h, \-\-help |
| 66 | Show a summary of the options to ltrace and exit. |
| 67 | .TP |
Juan Cespedes | d65efa3 | 2003-02-03 00:22:30 +0100 | [diff] [blame] | 68 | .I \-i |
| 69 | Print the instruction pointer at the time of the library call. |
| 70 | .TP |
| 71 | .I \-l, \-\-library filename |
| 72 | Display only the symbols included in the library |
| 73 | .I filename. |
| 74 | Up to 20 library names can be specified with several instances |
| 75 | of this option. |
| 76 | .TP |
| 77 | .I \-L |
| 78 | DON'T display library calls (use it with the |
| 79 | .I \-S |
| 80 | option). |
| 81 | .TP |
| 82 | .I \-n, \-\-indent nr |
| 83 | Indent trace output by |
| 84 | .I nr |
| 85 | number of spaces for each new nested call. Using this option makes |
| 86 | the program flow visualization easy to follow. |
| 87 | .TP |
| 88 | .I \-o, \-\-output filename |
| 89 | Write the trace output to the file |
| 90 | .I filename |
| 91 | rather than to stderr. |
| 92 | .TP |
| 93 | .I \-p pid |
| 94 | Attach to the process with the process ID |
| 95 | .I pid |
| 96 | and begin tracing. |
| 97 | .TP |
| 98 | .I \-r |
| 99 | Print a relative timestamp with each line of the trace. |
| 100 | This records the time difference between the beginning of |
| 101 | successive lines. |
| 102 | .TP |
| 103 | .I \-s strsize |
| 104 | Specify the maximum string size to print (the default is 32). |
| 105 | .TP |
| 106 | .I \-S |
| 107 | Display system calls as well as library calls |
| 108 | .TP |
| 109 | .I \-t |
| 110 | Prefix each line of the trace with the time of day. |
| 111 | .TP |
| 112 | .I \-tt |
| 113 | If given twice, the time printed will include the microseconds. |
| 114 | .TP |
| 115 | .I \-ttt |
| 116 | If given thrice, the time printed will include the microseconds and |
| 117 | the leading portion will be printed as the number of seconds since the |
| 118 | epoch. |
| 119 | .TP |
| 120 | .I \-T |
| 121 | Show the time spent inside each call. This records the time difference |
| 122 | between the beginning and the end of each call. |
| 123 | .TP |
| 124 | .I \-u username |
| 125 | Run command with the userid, groupid and supplementary groups of |
| 126 | .IR username . |
| 127 | This option is only useful when running as root and enables the |
| 128 | correct execution of setuid and/or setgid binaries. |
| 129 | .TP |
Juan Cespedes | ac3db29 | 1998-04-25 14:31:58 +0200 | [diff] [blame] | 130 | .I \-V, \-\-version |
| 131 | Show the version number of ltrace and exit. |
Juan Cespedes | 07461b6 | 1997-08-22 15:29:10 +0200 | [diff] [blame] | 132 | |
| 133 | .SH BUGS |
Juan Cespedes | ac3db29 | 1998-04-25 14:31:58 +0200 | [diff] [blame] | 134 | It has most of the bugs stated in |
| 135 | .BR strace(1) . |
| 136 | .LP |
| 137 | Manual page and documentation are not very up-to-date. |
| 138 | .LP |
| 139 | Option -f sometimes fails to trace some children. |
| 140 | .LP |
Juan Cespedes | 5c3fe06 | 2004-06-14 18:08:37 +0200 | [diff] [blame^] | 141 | It only works on Linux and in a small subset of architectures. |
Juan Cespedes | ac3db29 | 1998-04-25 14:31:58 +0200 | [diff] [blame] | 142 | .LP |
Juan Cespedes | b1dd77d | 2002-03-03 00:22:06 +0100 | [diff] [blame] | 143 | Only ELF32 binaries are supported. |
Juan Cespedes | 07461b6 | 1997-08-22 15:29:10 +0200 | [diff] [blame] | 144 | .PP |
Juan Cespedes | 3268a16 | 1997-08-25 16:45:22 +0200 | [diff] [blame] | 145 | If you like to report a bug, send a notice to the author, or use the |
| 146 | .BR bug(1) |
Juan Cespedes | ac3db29 | 1998-04-25 14:31:58 +0200 | [diff] [blame] | 147 | program if you are under the Debian GNU/Linux distribution. |
Juan Cespedes | 07461b6 | 1997-08-22 15:29:10 +0200 | [diff] [blame] | 148 | |
Juan Cespedes | 5e01f65 | 1998-03-08 22:31:44 +0100 | [diff] [blame] | 149 | .SH FILES |
| 150 | .TP |
| 151 | .I /etc/ltrace.conf |
| 152 | System configuration file |
| 153 | .TP |
| 154 | .I ~/.ltrace.conf |
| 155 | Personal config file, overrides |
| 156 | .I /etc/ltrace.conf |
| 157 | |
Juan Cespedes | 07461b6 | 1997-08-22 15:29:10 +0200 | [diff] [blame] | 158 | .SH AUTHOR |
Juan Cespedes | 64e793b | 1997-09-11 23:22:36 +0200 | [diff] [blame] | 159 | Juan Cespedes <cespedes@debian.org> |
Juan Cespedes | 07461b6 | 1997-08-22 15:29:10 +0200 | [diff] [blame] | 160 | |
| 161 | .SH "SEE ALSO" |
| 162 | .BR strace(1) , |
| 163 | .BR ptrace(2) |
| 164 | |