blob: 2a10ddff89d563923dc9e9b811e6463cef3d1259 [file] [log] [blame]
Juan Cespedes5e01f651998-03-08 22:31:44 +01001#include <stdio.h>
Juan Cespedesa4850832002-03-03 02:37:50 +01002#include <sys/types.h>
Juan Cespedes5e01f651998-03-08 22:31:44 +01003
Petr Machata1e4fed22012-04-01 00:45:22 +02004struct filter;
5
Juan Cespedesce377d52008-12-16 19:38:10 +01006struct options_t {
Joe Damato59e3fb12009-11-06 19:45:10 -08007 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 Welchba6aca22010-12-08 18:55:09 -080016 size_t arraylen; /* default maximum # of array elements printed */
17 size_t strlen; /* default maximum # of bytes printed in strings */
Joe Damato59e3fb12009-11-06 19:45:10 -080018 int follow; /* trace child processes */
19 int no_plt; /* set bps on PLT entries */
20 int no_signals; /* don't print signals */
Joe Damatoab3b72c2010-10-31 00:21:53 -070021#if defined(HAVE_LIBUNWIND)
22 int bt_depth; /* how may levels of stack frames to show */
23#endif /* defined(HAVE_LIBUNWIND) */
Petr Machata1e4fed22012-04-01 00:45:22 +020024 struct filter *filter;
Juan Cespedesce377d52008-12-16 19:38:10 +010025};
26extern struct options_t options;
27
Ian Wienand2d45b1a2006-02-20 22:48:07 +010028extern int opt_i; /* instruction pointer */
Ian Wienand2d45b1a2006-02-20 22:48:07 +010029extern int opt_r; /* print relative timestamp */
30extern int opt_t; /* print absolute timestamp */
Ian Wienand2d45b1a2006-02-20 22:48:07 +010031extern int opt_T; /* show the time spent inside each call */
Juan Cespedes5e01f651998-03-08 22:31:44 +010032
33struct opt_p_t {
34 pid_t pid;
Ian Wienand2d45b1a2006-02-20 22:48:07 +010035 struct opt_p_t *next;
Juan Cespedes5e01f651998-03-08 22:31:44 +010036};
37
Steve Fink58c73a72006-07-17 23:18:35 +020038struct opt_F_t {
39 char *filename;
40 struct opt_F_t *next;
41};
42
Paul Gilliam24e643a2006-03-13 18:43:13 +010043struct opt_x_t {
44 char *name;
45 int found;
Joe Damato7b0a7de2010-11-08 15:47:34 -080046 unsigned long hash;
Paul Gilliam24e643a2006-03-13 18:43:13 +010047 struct opt_x_t *next;
48};
49
Ian Wienand2d45b1a2006-02-20 22:48:07 +010050extern struct opt_p_t *opt_p; /* attach to process with a given pid */
Juan Cespedes5e01f651998-03-08 22:31:44 +010051
Steve Fink58c73a72006-07-17 23:18:35 +020052extern struct opt_F_t *opt_F; /* alternate configuration file(s) */
53
Paul Gilliam24e643a2006-03-13 18:43:13 +010054extern struct opt_x_t *opt_x; /* list of functions to break at */
Joe Damato7b0a7de2010-11-08 15:47:34 -080055extern unsigned int opt_x_cnt;
Ian Wienand9a2ad352006-02-20 22:44:45 +010056
Ian Wienand2d45b1a2006-02-20 22:48:07 +010057extern char **process_options(int argc, char **argv);