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