summaryrefslogtreecommitdiffstats
path: root/elaborate.h
diff options
context:
space:
mode:
authordsmith <dsmith>2006-08-28 17:59:50 +0000
committerdsmith <dsmith>2006-08-28 17:59:50 +0000
commitdc38c0ae43f0c98b203866eeeb88070d32db2c8d (patch)
tree830f0e353042f693a1fbe1e1bd5b895010e46673 /elaborate.h
parent30da8acfcbaef6bf88d806b8ded4195b88df7f39 (diff)
downloadsystemtap-steved-dc38c0ae43f0c98b203866eeeb88070d32db2c8d.tar.gz
systemtap-steved-dc38c0ae43f0c98b203866eeeb88070d32db2c8d.tar.xz
systemtap-steved-dc38c0ae43f0c98b203866eeeb88070d32db2c8d.zip
2006-08-28 David Smith <dsmith@redhat.com>
* translate.cxx: Added inclusion of session.h. (translate_pass): Instead of asking each probe to emit itself, we ask the session's probes member variable to emit all the probes. * tapsets.cxx: Added inclusion of session.h. Added a register_probe member function to all derived_probe based classes. Added a derived_probe_group derived class for all probe types: (be_derived_probe_group): New class. (never_derived_probe_group): New class. (dwarf_derived_probe_group): New class. (timer_derived_probe_group): New class. (profile_derived_probe_group): New class. (mark_derived_probe_group): New class. (hrtimer_derived_probe_group): New class (derived_probe_group_container): New class. * elaborate.h: Removed inclusion of session.h since session.h now includes elaborate.h. (derived_probe): Added register_probe member function. (derived_probe_group): Added class definition. This is the base class of all of the derived probe groups - dwarf, timer, etc. (derived_probe_group_container): Added class definition. An instance of this class will be stored in the session and contain all the other probe groups. * elaborate.cxx (derived_probe_group::register_probe): Added derived_probe_group::register_probe stubs. (alias_derived_probe::register_probe): Added register_probe member function. (semantic_pass_symbols): After deriving a probe, the probes now register themselves with the session. * session.h: Includes elaborate.h to get derived_probe_group_container definition. systemtap_session class 'probes' member variable switched from a vector of derived probes to a derived_probe_group_container. * buildrun.cxx: Added inclusion of session.h since it was removed from elaborate.h. * main.cxx: Added inclusion of session.h since it was removed from elaborate.h. * parse.h: Added forward struct declarations. * staptree.h: Removed inclusion of session.h.
Diffstat (limited to 'elaborate.h')
-rw-r--r--elaborate.h63
1 files changed, 62 insertions, 1 deletions
diff --git a/elaborate.h b/elaborate.h
index 9a10283c..9cb5b88e 100644
--- a/elaborate.h
+++ b/elaborate.h
@@ -9,7 +9,6 @@
#ifndef ELABORATE_H
#define ELABORATE_H
-#include "session.h"
#include "staptree.h"
#include "parse.h"
#include <string>
@@ -116,6 +115,8 @@ struct derived_probe: public probe
virtual ~derived_probe () {}
+ virtual void register_probe (systemtap_session& s) = 0;
+
virtual void emit_registrations (translator_output* o) = 0;
// (from within module_init):
// rc = ..... register_or_whatever (ENTRYFN);
@@ -148,6 +149,33 @@ public:
// ------------------------------------------------------------------------
+struct be_derived_probe;
+struct dwarf_derived_probe;
+struct hrtimer_derived_probe;
+struct mark_derived_probe;
+struct never_derived_probe;
+struct profile_derived_probe;
+struct timer_derived_probe;
+struct unparser;
+
+struct derived_probe_group
+{
+ virtual ~derived_probe_group () {}
+
+ virtual void register_probe(be_derived_probe* p);
+ virtual void register_probe(dwarf_derived_probe* p);
+ virtual void register_probe(hrtimer_derived_probe* p);
+ virtual void register_probe(mark_derived_probe* p);
+ virtual void register_probe(never_derived_probe* p);
+ virtual void register_probe(profile_derived_probe* p);
+ virtual void register_probe(timer_derived_probe* p);
+ virtual size_t size () = 0;
+
+ virtual void emit_probes (translator_output* op, unparser* up) = 0;
+};
+
+// ------------------------------------------------------------------------
+
struct derived_probe_builder
{
virtual void build(systemtap_session & sess,
@@ -218,4 +246,37 @@ void derive_probes (systemtap_session& s,
symbol * get_symbol_within_expression (expression *e);
+struct unparser;
+
+struct derived_probe_group_container: public derived_probe_group
+{
+private:
+ std::vector<derived_probe*> probes;
+ derived_probe_group* be_probe_group;
+ derived_probe_group* dwarf_probe_group;
+ derived_probe_group* hrtimer_probe_group;
+ derived_probe_group* mark_probe_group;
+ derived_probe_group* never_probe_group;
+ derived_probe_group* profile_probe_group;
+ derived_probe_group* timer_probe_group;
+
+public:
+ derived_probe_group_container ();
+ ~derived_probe_group_container ();
+
+ void register_probe (be_derived_probe* p);
+ void register_probe (dwarf_derived_probe* p);
+ void register_probe (hrtimer_derived_probe* p);
+ void register_probe (mark_derived_probe* p);
+ void register_probe (never_derived_probe* p);
+ void register_probe (profile_derived_probe* p);
+ void register_probe (timer_derived_probe* p);
+ size_t size () { return (probes.size ()); }
+
+ derived_probe* operator[] (size_t n) { return (probes[n]); }
+
+ void emit_probes (translator_output* op, unparser* up);
+};
+
+
#endif // ELABORATE_H