From dc38c0ae43f0c98b203866eeeb88070d32db2c8d Mon Sep 17 00:00:00 2001 From: dsmith Date: Mon, 28 Aug 2006 17:59:50 +0000 Subject: 2006-08-28 David Smith * 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. --- elaborate.cxx | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 56 insertions(+), 1 deletion(-) (limited to 'elaborate.cxx') diff --git a/elaborate.cxx b/elaborate.cxx index dd0cb0c4..957f5ea5 100644 --- a/elaborate.cxx +++ b/elaborate.cxx @@ -10,6 +10,7 @@ #include "elaborate.h" #include "parse.h" #include "tapsets.h" +#include "session.h" extern "C" { #include @@ -69,6 +70,58 @@ derived_probe::derived_probe (probe *p, probe_point *l): } +// ------------------------------------------------------------------------ +// Members of derived_probe_group + +void +derived_probe_group::register_probe(be_derived_probe* p) +{ + throw semantic_error ("unexpected registration of a be_derived_probe"); +} + + +void +derived_probe_group::register_probe(dwarf_derived_probe* p) +{ + throw semantic_error ("unexpected registration of a dwarf_derived_probe"); +} + + +void +derived_probe_group::register_probe(hrtimer_derived_probe* p) +{ + throw semantic_error ("unexpected registration of a hrtimer_derived_probe"); +} + + +void +derived_probe_group::register_probe(mark_derived_probe* p) +{ + throw semantic_error ("unexpected registration of a mark_derived_probe"); +} + + +void +derived_probe_group::register_probe(never_derived_probe* p) +{ + throw semantic_error ("unexpected registration of a never_derived_probe"); +} + + +void +derived_probe_group::register_probe(profile_derived_probe* p) +{ + throw semantic_error ("unexpected registration of a profile_derived_probe"); +} + + +void +derived_probe_group::register_probe(timer_derived_probe* p) +{ + throw semantic_error ("unexpected registration of a timer_derived_probe"); +} + + // ------------------------------------------------------------------------ // Members of derived_probe_builder @@ -330,6 +383,8 @@ struct alias_derived_probe: public derived_probe { alias_derived_probe (probe* base): derived_probe (base) {} + void register_probe (systemtap_session& s) { } + // alias probes should be ultimately expanded to other derived_probe // types, and not themselves emitted. void emit_registrations (translator_output* o) { throw semantic_error ("inappropriate", this->tok); } @@ -882,7 +937,7 @@ semantic_pass_symbols (systemtap_session& s) for (unsigned j=0; jregister_probe (s); try { -- cgit