| Juan Cespedes | 5e01f65 | 1998-03-08 22:31:44 +0100 | [diff] [blame] | 1 | #include <stdio.h> |
| Juan Cespedes | a485083 | 2002-03-03 02:37:50 +0100 | [diff] [blame] | 2 | #include <sys/types.h> |
| Juan Cespedes | 5e01f65 | 1998-03-08 22:31:44 +0100 | [diff] [blame] | 3 | |
| Juan Cespedes | ce377d5 | 2008-12-16 19:38:10 +0100 | [diff] [blame] | 4 | struct options_t { |
| Joe Damato | 59e3fb1 | 2009-11-06 19:45:10 -0800 | [diff] [blame^] | 5 | int align; /* -a: default alignment column for results */ |
| 6 | char * user; /* -u: username to run command as */ |
| 7 | int syscalls; /* -S: display system calls */ |
| 8 | int libcalls; /* -L: display library calls */ |
| 9 | int demangle; /* -C: demangle low-level names into user-level names */ |
| 10 | int indent; /* -n: indent trace output according to program flow */ |
| 11 | FILE *output; /* output to a specific file */ |
| 12 | int summary; /* count time, calls, and report a summary on program exit */ |
| 13 | int debug; /* debug */ |
| 14 | int arraylen; /* default maximum # of array elements printed */ |
| 15 | int strlen; /* default maximum # of bytes printed in strings */ |
| 16 | int follow; /* trace child processes */ |
| 17 | int no_plt; /* set bps on PLT entries */ |
| 18 | int no_signals; /* don't print signals */ |
| Juan Cespedes | ce377d5 | 2008-12-16 19:38:10 +0100 | [diff] [blame] | 19 | }; |
| 20 | extern struct options_t options; |
| 21 | |
| Ian Wienand | 2d45b1a | 2006-02-20 22:48:07 +0100 | [diff] [blame] | 22 | extern int opt_i; /* instruction pointer */ |
| Ian Wienand | 2d45b1a | 2006-02-20 22:48:07 +0100 | [diff] [blame] | 23 | extern int opt_r; /* print relative timestamp */ |
| 24 | extern int opt_t; /* print absolute timestamp */ |
| Ian Wienand | 2d45b1a | 2006-02-20 22:48:07 +0100 | [diff] [blame] | 25 | extern int opt_T; /* show the time spent inside each call */ |
| Juan Cespedes | 5e01f65 | 1998-03-08 22:31:44 +0100 | [diff] [blame] | 26 | |
| 27 | struct opt_p_t { |
| 28 | pid_t pid; |
| Ian Wienand | 2d45b1a | 2006-02-20 22:48:07 +0100 | [diff] [blame] | 29 | struct opt_p_t *next; |
| Juan Cespedes | 5e01f65 | 1998-03-08 22:31:44 +0100 | [diff] [blame] | 30 | }; |
| 31 | |
| Juan Cespedes | ac3db29 | 1998-04-25 14:31:58 +0200 | [diff] [blame] | 32 | struct opt_e_t { |
| Ian Wienand | 2d45b1a | 2006-02-20 22:48:07 +0100 | [diff] [blame] | 33 | char *name; |
| 34 | struct opt_e_t *next; |
| Juan Cespedes | ac3db29 | 1998-04-25 14:31:58 +0200 | [diff] [blame] | 35 | }; |
| 36 | |
| Steve Fink | 58c73a7 | 2006-07-17 23:18:35 +0200 | [diff] [blame] | 37 | struct opt_F_t { |
| 38 | char *filename; |
| 39 | struct opt_F_t *next; |
| 40 | }; |
| 41 | |
| Paul Gilliam | 24e643a | 2006-03-13 18:43:13 +0100 | [diff] [blame] | 42 | struct opt_x_t { |
| 43 | char *name; |
| 44 | int found; |
| 45 | struct opt_x_t *next; |
| 46 | }; |
| 47 | |
| Ian Wienand | 2d45b1a | 2006-02-20 22:48:07 +0100 | [diff] [blame] | 48 | extern struct opt_p_t *opt_p; /* attach to process with a given pid */ |
| Juan Cespedes | 5e01f65 | 1998-03-08 22:31:44 +0100 | [diff] [blame] | 49 | |
| Ian Wienand | 2d45b1a | 2006-02-20 22:48:07 +0100 | [diff] [blame] | 50 | extern struct opt_e_t *opt_e; /* list of function names to display */ |
| Juan Cespedes | ac3db29 | 1998-04-25 14:31:58 +0200 | [diff] [blame] | 51 | extern int opt_e_enable; /* 0 if '!' is used, 1 otherwise */ |
| 52 | |
| Steve Fink | 58c73a7 | 2006-07-17 23:18:35 +0200 | [diff] [blame] | 53 | extern struct opt_F_t *opt_F; /* alternate configuration file(s) */ |
| 54 | |
| Paul Gilliam | 24e643a | 2006-03-13 18:43:13 +0100 | [diff] [blame] | 55 | extern struct opt_x_t *opt_x; /* list of functions to break at */ |
| Ian Wienand | 9a2ad35 | 2006-02-20 22:44:45 +0100 | [diff] [blame] | 56 | |
| Ian Wienand | 2d45b1a | 2006-02-20 22:48:07 +0100 | [diff] [blame] | 57 | extern char **process_options(int argc, char **argv); |