Juan Cespedes | 64e793b | 1997-09-11 23:22:36 +0200 | [diff] [blame] | 1 | .\" Copyright (c) 1997 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 | ac3db29 | 1998-04-25 14:31:58 +0200 | [diff] [blame^] | 9 | .I "[-dfiLStttChV] [-a column] [-s strsize] [-o filename] [-u username] [-p pid] ... [-e expr] [--debug] [--demangle] [--align=column] [--output=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 | 5e0acdb | 1998-04-04 08:34:07 +0200 | [diff] [blame] | 45 | .I \-t |
| 46 | Prefix each line of the trace with the time of day. |
| 47 | .TP |
| 48 | .I \-tt |
| 49 | If given twice, the time printed will include the microseconds. |
| 50 | .TP |
| 51 | .I \-ttt |
| 52 | If given thrice, the time printed will include the microseconds and |
| 53 | the leading portion will be printed as the number of seconds since the |
| 54 | epoch. |
| 55 | .TP |
Juan Cespedes | ac3db29 | 1998-04-25 14:31:58 +0200 | [diff] [blame^] | 56 | .I \-C, \-\-demangle |
| 57 | Decode (demangle) low-level symbol names into user-level names. |
| 58 | Besides removing any initial underscore prepended by the system, |
| 59 | this makes C++ function names readable. |
| 60 | .TP |
| 61 | .I \-a, \-\-align column |
Juan Cespedes | e188705 | 1998-03-10 00:08:41 +0100 | [diff] [blame] | 62 | Align return values in a secific column (default column 50). |
| 63 | .TP |
| 64 | .I \-s |
| 65 | Specify the maximum string size to print (the default is 32). |
| 66 | .TP |
Juan Cespedes | ac3db29 | 1998-04-25 14:31:58 +0200 | [diff] [blame^] | 67 | .I \-o, \-\-output filename |
Juan Cespedes | 07461b6 | 1997-08-22 15:29:10 +0200 | [diff] [blame] | 68 | Write the trace output to the file |
| 69 | .I filename |
| 70 | rather than to stderr. |
Juan Cespedes | e188705 | 1998-03-10 00:08:41 +0100 | [diff] [blame] | 71 | .TP |
| 72 | .I \-u username |
| 73 | Run command with the userid, groupid and supplementary groups of |
| 74 | .IR username . |
| 75 | This option is only useful when running as root and enables the |
| 76 | correct execution of setuid and/or setgid binaries. |
| 77 | .TP |
| 78 | .I \-p pid |
| 79 | Attach to the process with the process ID |
| 80 | .I pid |
| 81 | and begin tracing. |
Juan Cespedes | ac3db29 | 1998-04-25 14:31:58 +0200 | [diff] [blame^] | 82 | .TP |
| 83 | .I \-e expr |
| 84 | A qualifying expression which modifies which events to trace. |
| 85 | The format of the expression is: |
| 86 | .br |
| 87 | [!]value1[,value2]... |
| 88 | .br |
| 89 | where the values are the functions to trace. Using an exclamation |
| 90 | mark negates the set of values. For example |
| 91 | .I \-e printf |
| 92 | means to trace only the printf library call. By contrast, |
| 93 | .I \-e !printf |
| 94 | means to trace every library call except printf. |
| 95 | .LP |
| 96 | Note that some shells use the exclamation point for history |
| 97 | expansion; even inside quoted arguments. If so, you must escape |
| 98 | the exclamation point with a backslash. |
| 99 | .TP |
| 100 | .I \-h, \-\-help |
| 101 | Show a summary of the options to ltrace and exit. |
| 102 | .TP |
| 103 | .I \-V, \-\-version |
| 104 | Show the version number of ltrace and exit. |
Juan Cespedes | 07461b6 | 1997-08-22 15:29:10 +0200 | [diff] [blame] | 105 | |
| 106 | .SH BUGS |
Juan Cespedes | ac3db29 | 1998-04-25 14:31:58 +0200 | [diff] [blame^] | 107 | It has most of the bugs stated in |
| 108 | .BR strace(1) . |
| 109 | .LP |
| 110 | Manual page and documentation are not very up-to-date. |
| 111 | .LP |
| 112 | Option -f sometimes fails to trace some children. |
| 113 | .LP |
| 114 | Only Linux/i386 is supported |
| 115 | .LP |
| 116 | Only ELF32 binaries are supported |
Juan Cespedes | 07461b6 | 1997-08-22 15:29:10 +0200 | [diff] [blame] | 117 | .PP |
Juan Cespedes | 3268a16 | 1997-08-25 16:45:22 +0200 | [diff] [blame] | 118 | If you like to report a bug, send a notice to the author, or use the |
| 119 | .BR bug(1) |
Juan Cespedes | ac3db29 | 1998-04-25 14:31:58 +0200 | [diff] [blame^] | 120 | program if you are under the Debian GNU/Linux distribution. |
Juan Cespedes | 07461b6 | 1997-08-22 15:29:10 +0200 | [diff] [blame] | 121 | |
Juan Cespedes | 5e01f65 | 1998-03-08 22:31:44 +0100 | [diff] [blame] | 122 | .SH FILES |
| 123 | .TP |
| 124 | .I /etc/ltrace.conf |
| 125 | System configuration file |
| 126 | .TP |
| 127 | .I ~/.ltrace.conf |
| 128 | Personal config file, overrides |
| 129 | .I /etc/ltrace.conf |
| 130 | |
Juan Cespedes | 07461b6 | 1997-08-22 15:29:10 +0200 | [diff] [blame] | 131 | .SH AUTHOR |
Juan Cespedes | 64e793b | 1997-09-11 23:22:36 +0200 | [diff] [blame] | 132 | Juan Cespedes <cespedes@debian.org> |
Juan Cespedes | 07461b6 | 1997-08-22 15:29:10 +0200 | [diff] [blame] | 133 | |
| 134 | .SH "SEE ALSO" |
| 135 | .BR strace(1) , |
| 136 | .BR ptrace(2) |
| 137 | |