summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--elaborate.cxx6
-rw-r--r--session.h5
3 files changed, 18 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 5f8e6ff3..e7f736cc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2009-02-11 Josh Stone <jistone@redhat.com>
+ * session.h (systemtap_session): Add a vector of update_visitors
+ that will act as filters for all probes and functions.
+ * elaborate.cxx (semantic_pass_symbols): Run probes and functions
+ through each registered code filter.
+
+2009-02-11 Josh Stone <jistone@redhat.com>
+
* tapsets.cxx (dwarf_var_expanding_visitor::visit_cast_op): While
expanding dwarf probes, provide the current module as a default to
@casts without a module name.
diff --git a/elaborate.cxx b/elaborate.cxx
index 981fc7c7..9f8aa450 100644
--- a/elaborate.cxx
+++ b/elaborate.cxx
@@ -1092,6 +1092,9 @@ semantic_pass_symbols (systemtap_session& s)
try
{
+ for (unsigned j=0; j<s.code_filters.size(); j++)
+ fd->body = s.code_filters[j]->require (fd->body);
+
sym.current_function = fd;
sym.current_probe = 0;
fd->body->visit (& sym);
@@ -1124,6 +1127,9 @@ semantic_pass_symbols (systemtap_session& s)
try
{
+ for (unsigned k=0; k<s.code_filters.size(); k++)
+ dp->body = s.code_filters[k]->require (dp->body);
+
sym.current_function = 0;
sym.current_probe = dp;
dp->body->visit (& sym);
diff --git a/session.h b/session.h
index 6bcebd8b..735ef200 100644
--- a/session.h
+++ b/session.h
@@ -45,6 +45,7 @@ struct translator_output;
struct unparser;
struct semantic_error;
struct module_cache;
+struct update_visitor;
// XXX: a generalized form of this descriptor could be associated with
@@ -133,6 +134,10 @@ struct systemtap_session
stapfile* user_file;
std::vector<stapfile*> library_files;
+ // filters to run over all code before symbol resolution
+ // e.g. @cast expansion
+ std::vector<update_visitor*> code_filters;
+
// resolved globals/functions/probes for the run as a whole
std::vector<stapfile*> files;
std::vector<vardecl*> globals;