summaryrefslogtreecommitdiffstats
path: root/translate.cxx
diff options
context:
space:
mode:
authorfche <fche>2005-06-13 14:27:49 +0000
committerfche <fche>2005-06-13 14:27:49 +0000
commit56e12059fd1e281889b708b3d351092d9e3ed0be (patch)
tree0d058b68c61782ddc2988d677c925e6be0387425 /translate.cxx
parentbb2e3076ea20631d4606050550bc9664204f2c62 (diff)
downloadsystemtap-steved-56e12059fd1e281889b708b3d351092d9e3ed0be.tar.gz
systemtap-steved-56e12059fd1e281889b708b3d351092d9e3ed0be.tar.xz
systemtap-steved-56e12059fd1e281889b708b3d351092d9e3ed0be.zip
2005-06-13 Frank Ch. Eigler <fche@redhat.com>
Start separating out translator-side probe point recognition. * tapsets.cxx: New file. (be_derived_probe): Support for begin/end probes. (derive_probe): Ditto. Reject anything unrecognized. * translator.cxx: Move out old code. * Makefile.am: Add new source file. * testsuite/semok/*: Switch to begin/end probes only.
Diffstat (limited to 'translate.cxx')
-rw-r--r--translate.cxx107
1 files changed, 0 insertions, 107 deletions
diff --git a/translate.cxx b/translate.cxx
index dcccf1bd..7336d172 100644
--- a/translate.cxx
+++ b/translate.cxx
@@ -29,33 +29,6 @@ stringify(T t)
}
-
-// ------------------------------------------------------------------------
-// toy provider/unparser pair
-
-
-struct test_derived_probe: public derived_probe
-{
- test_derived_probe (probe* p);
- test_derived_probe (probe* p, probe_point* l);
-
- void emit_registrations (translator_output* o, unsigned i);
- void emit_deregistrations (translator_output* o, unsigned i);
- void emit_probe_entries (translator_output* o, unsigned i);
-};
-
-
-
-void
-symresolution_info::derive_probes (probe *p, vector<derived_probe*>& dps)
-{
- // XXX: there will be real ones coming later
- for (unsigned i=0; i<p->locations.size(); i++)
- dps.push_back (new test_derived_probe (p, p->locations[i]));
-}
-
-
-
struct c_unparser: public unparser, public visitor
{
systemtap_session* session;
@@ -120,32 +93,6 @@ struct c_unparser: public unparser, public visitor
};
-
-// ------------------------------------------------------------------------
-
-
-// Perform inter-script dependency analysis [XXX: later],
-// then provider elaboration and derived probe construction
-// and finally semantic analysis
-// on the reachable set of probes/functions from the user_file
-int
-resolution_pass (systemtap_session& s)
-{
- int rc = 0;
-
- for (unsigned i=0; i<s.user_file->probes.size(); i++)
- {
- probe* p = s.user_file->probes[i];
- // XXX: should of course be based on each probe_point
- derived_probe *dp = new test_derived_probe (p);
- s.probes.push_back (dp);
- }
-
- // XXX: add builtin variables/functions
- return rc;
-}
-
-
// ------------------------------------------------------------------------
@@ -195,60 +142,6 @@ translator_output::line ()
-// ------------------------------------------------------------------------
-
-
-test_derived_probe::test_derived_probe (probe* p): derived_probe (p)
-{
-}
-
-
-test_derived_probe::test_derived_probe (probe* p, probe_point* l):
- derived_probe (p, l)
-{
-}
-
-
-void
-test_derived_probe::emit_registrations (translator_output* o, unsigned i)
-{
- // XXX
- o->newline() << "rc = 0; /* no registration for probe " << i << " */";
-}
-
-void
-test_derived_probe::emit_deregistrations (translator_output* o, unsigned i)
-{
- // XXX
- o->newline() << "rc = 0; /* no deregistration for probe " << i << " */";
-}
-
-
-void
-test_derived_probe::emit_probe_entries (translator_output* o, unsigned j)
-{
- for (unsigned i=0; i<locations.size(); i++)
- {
- probe_point *l = locations[i];
- o->newline() << "/* location " << i << ": " << *l << " */";
- o->newline() << "static void enter_" << j << "_" << i << " ()";
- o->newline() << "{";
- o->newline(1) << "struct context* c = & contexts [0];";
- // XXX: assert #0 is free; need locked search instead
- o->newline() << "if (c->busy) { errorcount ++; return; }";
- o->newline() << "c->busy ++;";
- o->newline() << "c->actioncount = 0;";
- o->newline() << "c->nesting = 0;";
- // NB: locals are initialized by probe function itself
- o->newline() << "probe_" << j << " (c);";
- o->newline() << "c->busy --;";
- o->newline(-1) << "}" << endl;
- }
-}
-
-
-// ------------------------------------------------------------------------
-
// A shadow visitor, meant to generate temporary variable declarations
// for function or probe bodies. Member functions should exactly match