Imported Upstream version 0.7.2
[platform/upstream/ltrace.git] / options.h
1 /*
2  * This file is part of ltrace.
3  * Copyright (C) 2009,2010 Joe Damato
4  * Copyright (C) 1998,2002,2008 Juan Cespedes
5  * Copyright (C) 2006 Ian Wienand
6  * Copyright (C) 2006 Steve Fink
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License as
10  * published by the Free Software Foundation; either version 2 of the
11  * License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful, but
14  * WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
21  * 02110-1301 USA
22  */
23
24 #include <stdio.h>
25 #include <sys/types.h>
26
27 #include "forward.h"
28
29 struct options_t {
30         int align;      /* -a: default alignment column for results */
31         char * user;    /* -u: username to run command as */
32         int syscalls;   /* -S: display system calls */
33         int demangle;   /* -C: demangle low-level names into user-level names */
34         int indent;     /* -n: indent trace output according to program flow */
35         FILE *output;   /* output to a specific file */
36         int summary;    /* count time, calls, and report a summary on program exit */
37         int debug;      /* debug */
38         size_t arraylen;   /* default maximum # of array elements printed */
39         size_t strlen;     /* default maximum # of bytes printed in strings */
40         int follow;     /* trace child processes */
41         int no_signals; /* don't print signals */
42 #if defined(HAVE_LIBUNWIND)
43         int bt_depth;    /* how may levels of stack frames to show */
44 #endif /* defined(HAVE_LIBUNWIND) */
45         struct filter *plt_filter;
46         struct filter *static_filter;
47
48         /* A filter matching library names of libraries, whose
49          * exported symbols we wish to trace.  */
50         struct filter *export_filter;
51
52         int hide_caller; /* Whether caller library should be hidden.  */
53 };
54 extern struct options_t options;
55
56 extern int opt_i;               /* instruction pointer */
57 extern int opt_r;               /* print relative timestamp */
58 extern int opt_t;               /* print absolute timestamp */
59 extern int opt_T;               /* show the time spent inside each call */
60
61 struct opt_p_t {
62         pid_t pid;
63         struct opt_p_t *next;
64 };
65
66 struct opt_F_t
67 {
68         struct opt_F_t *next;
69         char *filename;
70         int own_filename : 1;
71 };
72
73 extern struct opt_p_t *opt_p;   /* attach to process with a given pid */
74
75 extern struct opt_F_t *opt_F;   /* alternate configuration file(s) */
76
77 extern char **process_options(int argc, char **argv);