summaryrefslogtreecommitdiffstats
path: root/staptree.cxx
diff options
context:
space:
mode:
authorwcohen <wcohen>2007-06-26 19:36:25 +0000
committerwcohen <wcohen>2007-06-26 19:36:25 +0000
commitc3a3c0c99c32c0969e6450d60aae1a2b1798ca17 (patch)
tree536bc183503bbcb0fbfa4ce419175e59a0855983 /staptree.cxx
parent23944d00d55ecc08acbb0e2f39f7fb5cd7a0580e (diff)
downloadsystemtap-steved-c3a3c0c99c32c0969e6450d60aae1a2b1798ca17.tar.gz
systemtap-steved-c3a3c0c99c32c0969e6450d60aae1a2b1798ca17.tar.xz
systemtap-steved-c3a3c0c99c32c0969e6450d60aae1a2b1798ca17.zip
2007-06-26 William Cohen <wcohen@redhat.com>
PR 4529 * coveragedb.cxx: New. * coveragedb.h: New. * Makefile.am: Add coveragedb.cxx and sqlite3 to build. * Makefile.in: Regenerated. * configure.ac: Add test for sqlite3 * configure: Regenerated. * systemtap.spec.in: Add dependencies for sqlite3/sqlite3-devel. * elaborate.h, elaborate.cxx (derived_probe::collect_derivation_chain): New. (alias_expansion_builder::build): Correct token location. (semantic_pass_opt[12): Track used and unused variables/functions. * session.h (tapset_compile_coverage, unused_globals, unused_probes, unused_functions): New fields. * staptree.h (unused_locals, probe_point::str): New member. * staptree.cxx: Ditto. * main.cxx: Add "-q" tapset coverage option and SYSTEMTAP_COVERAGE env.
Diffstat (limited to 'staptree.cxx')
-rw-r--r--staptree.cxx25
1 files changed, 25 insertions, 0 deletions
diff --git a/staptree.cxx b/staptree.cxx
index 08b2abae..3a50ac14 100644
--- a/staptree.cxx
+++ b/staptree.cxx
@@ -15,6 +15,7 @@
#include <typeinfo>
#include <sstream>
#include <cassert>
+#include <vector>
#include <algorithm>
using namespace std;
@@ -848,6 +849,13 @@ void probe::printsig (ostream& o) const
}
+void
+probe::collect_derivation_chain (std::vector<derived_probe*> &probes_list)
+{
+ probes_list.push_back((derived_probe*)this);
+}
+
+
void probe_point::print (ostream& o) const
{
for (unsigned i=0; i<components.size(); i++)
@@ -860,6 +868,23 @@ void probe_point::print (ostream& o) const
}
if (optional)
o << "?";
+ o << "{" << tok->location << "}\n";
+}
+
+string probe_point::str ()
+{
+ ostringstream o;
+ for (unsigned i=0; i<components.size(); i++)
+ {
+ if (i>0) o << ".";
+ probe_point::component* c = components[i];
+ o << c->functor;
+ if (c->arg)
+ o << "(" << *c->arg << ")";
+ }
+ if (optional)
+ o << "?";
+ return o.str();
}