| 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 | |
| Petr Machata | 1e4fed2 | 2012-04-01 00:45:22 +0200 | [diff] [blame] | 4 | struct filter; |
| 5 | |
| Juan Cespedes | ce377d5 | 2008-12-16 19:38:10 +0100 | [diff] [blame] | 6 | struct options_t { |
| Joe Damato | 59e3fb1 | 2009-11-06 19:45:10 -0800 | [diff] [blame] | 7 | int align; /* -a: default alignment column for results */ |
| 8 | char * user; /* -u: username to run command as */ |
| 9 | int syscalls; /* -S: display system calls */ |
| 10 | int libcalls; /* -L: display library calls */ |
| 11 | int demangle; /* -C: demangle low-level names into user-level names */ |
| 12 | int indent; /* -n: indent trace output according to program flow */ |
| 13 | FILE *output; /* output to a specific file */ |
| 14 | int summary; /* count time, calls, and report a summary on program exit */ |
| 15 | int debug; /* debug */ |
| Zachary T Welch | ba6aca2 | 2010-12-08 18:55:09 -0800 | [diff] [blame] | 16 | size_t arraylen; /* default maximum # of array elements printed */ |
| 17 | size_t strlen; /* default maximum # of bytes printed in strings */ |
| Joe Damato | 59e3fb1 | 2009-11-06 19:45:10 -0800 | [diff] [blame] | 18 | int follow; /* trace child processes */ |
| 19 | int no_plt; /* set bps on PLT entries */ |
| 20 | int no_signals; /* don't print signals */ |
| Joe Damato | ab3b72c | 2010-10-31 00:21:53 -0700 | [diff] [blame] | 21 | #if defined(HAVE_LIBUNWIND) |
| 22 | int bt_depth; /* how may levels of stack frames to show */ |
| 23 | #endif /* defined(HAVE_LIBUNWIND) */ |
| Petr Machata | 1e4fed2 | 2012-04-01 00:45:22 +0200 | [diff] [blame] | 24 | struct filter *filter; |
| Juan Cespedes | ce377d5 | 2008-12-16 19:38:10 +0100 | [diff] [blame] | 25 | }; |
| 26 | extern struct options_t options; |
| 27 | |
| Ian Wienand | 2d45b1a | 2006-02-20 22:48:07 +0100 | [diff] [blame] | 28 | extern int opt_i; /* instruction pointer */ |
| Ian Wienand | 2d45b1a | 2006-02-20 22:48:07 +0100 | [diff] [blame] | 29 | extern int opt_r; /* print relative timestamp */ |
| 30 | extern int opt_t; /* print absolute timestamp */ |
| Ian Wienand | 2d45b1a | 2006-02-20 22:48:07 +0100 | [diff] [blame] | 31 | extern int opt_T; /* show the time spent inside each call */ |
| Juan Cespedes | 5e01f65 | 1998-03-08 22:31:44 +0100 | [diff] [blame] | 32 | |
| 33 | struct opt_p_t { |
| 34 | pid_t pid; |
| Ian Wienand | 2d45b1a | 2006-02-20 22:48:07 +0100 | [diff] [blame] | 35 | struct opt_p_t *next; |
| Juan Cespedes | 5e01f65 | 1998-03-08 22:31:44 +0100 | [diff] [blame] | 36 | }; |
| 37 | |
| Steve Fink | 58c73a7 | 2006-07-17 23:18:35 +0200 | [diff] [blame] | 38 | struct opt_F_t { |
| 39 | char *filename; |
| 40 | struct opt_F_t *next; |
| 41 | }; |
| 42 | |
| Paul Gilliam | 24e643a | 2006-03-13 18:43:13 +0100 | [diff] [blame] | 43 | struct opt_x_t { |
| 44 | char *name; |
| 45 | int found; |
| Joe Damato | 7b0a7de | 2010-11-08 15:47:34 -0800 | [diff] [blame] | 46 | unsigned long hash; |
| Paul Gilliam | 24e643a | 2006-03-13 18:43:13 +0100 | [diff] [blame] | 47 | struct opt_x_t *next; |
| 48 | }; |
| 49 | |
| Ian Wienand | 2d45b1a | 2006-02-20 22:48:07 +0100 | [diff] [blame] | 50 | 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] | 51 | |
| Steve Fink | 58c73a7 | 2006-07-17 23:18:35 +0200 | [diff] [blame] | 52 | extern struct opt_F_t *opt_F; /* alternate configuration file(s) */ |
| 53 | |
| Paul Gilliam | 24e643a | 2006-03-13 18:43:13 +0100 | [diff] [blame] | 54 | extern struct opt_x_t *opt_x; /* list of functions to break at */ |
| Joe Damato | 7b0a7de | 2010-11-08 15:47:34 -0800 | [diff] [blame] | 55 | extern unsigned int opt_x_cnt; |
| 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); |