2 // Copyright (C) 2005, 2006 Red Hat Inc.
4 // This file is part of systemtap, and is free software. You can
5 // redistribute it and/or modify it under the terms of the GNU General
6 // Public License (GPL); either version 2, or (at your option) any
20 #include <elfutils/libdw.h>
24 // forward decls for all referenced systemtap types
30 struct be_derived_probe_group
;
31 struct dwarf_derived_probe_group
;
32 struct timer_derived_probe_group
;
33 struct profile_derived_probe_group
;
34 struct mark_derived_probe_group
;
35 struct hrtimer_derived_probe_group
;
36 struct perfmon_derived_probe_group
;
38 struct translator_output
;
40 struct semantic_error
;
43 // XXX: a generalized form of this descriptor could be associated with
44 // a vardecl instead of out here at the systemtap_session level.
49 logarithmic_buckets(0),
50 linear_low(0), linear_high(0), linear_step(0)
52 enum { none
, linear
, logarithmic
} type
;
53 int64_t logarithmic_buckets
;
57 bool operator==(statistic_decl
const & other
)
59 return type
== other
.type
60 && logarithmic_buckets
== other
.logarithmic_buckets
61 && linear_low
== other
.linear_low
62 && linear_high
== other
.linear_high
63 && linear_step
== other
.linear_step
;
68 struct systemtap_session
71 // NB: new POD members likely need to be explicitly cleared in the ctor.
74 std::vector
<std::string
> include_path
;
75 std::vector
<std::string
> macros
;
76 std::vector
<std::string
> args
;
77 std::string kernel_release
;
78 std::string kernel_base_release
;
79 std::string architecture
;
80 std::string runtime_path
;
81 std::string data_path
;
82 std::string module_name
;
83 std::string output_file
;
100 std::string cache_path
;
101 std::string hash_path
;
103 // temporary directory for module builds etc.
104 // hazardous - it is "rm -rf"'d at exit
106 std::string translated_source
; // C source code
108 match_node
* pattern_root
;
109 void register_library_aliases();
111 // parse trees for the various script files
113 std::vector
<stapfile
*> library_files
;
115 // resolved globals/functions/probes for the run as a whole
116 std::vector
<stapfile
*> files
;
117 std::vector
<vardecl
*> globals
;
118 std::vector
<functiondecl
*> functions
;
119 std::vector
<derived_probe
*> probes
; // see also *_probes groups below
120 std::vector
<embeddedcode
*> embeds
;
121 std::map
<std::string
, statistic_decl
> stat_decls
;
122 // XXX: vector<*> instead please?
124 // Every probe in these groups must also appear in the
125 // session.probes vector.
126 be_derived_probe_group
* be_derived_probes
;
127 dwarf_derived_probe_group
* dwarf_derived_probes
;
128 timer_derived_probe_group
* timer_derived_probes
;
129 profile_derived_probe_group
* profile_derived_probes
;
130 mark_derived_probe_group
* mark_derived_probes
;
131 hrtimer_derived_probe_group
* hrtimer_derived_probes
;
132 perfmon_derived_probe_group
* perfmon_derived_probes
;
135 translator_output
* op
;
139 bool kprobes_text_initialized
;
140 Dwarf_Addr kprobes_text_start
;
141 Dwarf_Addr kprobes_text_end
;
143 std::set
<std::string
> seen_errors
;
144 unsigned num_errors () { return seen_errors
.size(); }
145 // void print_error (const parse_error& e);
146 void print_error (const semantic_error
& e
);
148 // reNB: new POD members likely need to be explicitly cleared in the ctor.