diff options
author | wcohen <wcohen> | 2007-06-26 19:36:25 +0000 |
---|---|---|
committer | wcohen <wcohen> | 2007-06-26 19:36:25 +0000 |
commit | c3a3c0c99c32c0969e6450d60aae1a2b1798ca17 (patch) | |
tree | 536bc183503bbcb0fbfa4ce419175e59a0855983 /elaborate.cxx | |
parent | 23944d00d55ecc08acbb0e2f39f7fb5cd7a0580e (diff) | |
download | systemtap-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 'elaborate.cxx')
-rw-r--r-- | elaborate.cxx | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/elaborate.cxx b/elaborate.cxx index 82d2a5d9..0bd1c3eb 100644 --- a/elaborate.cxx +++ b/elaborate.cxx @@ -96,6 +96,14 @@ derived_probe::printsig_nested (ostream& o) const } +void +derived_probe::collect_derivation_chain (std::vector<derived_probe*> &probes_list) +{ + probes_list.push_back(this); + base->collect_derivation_chain(probes_list); +} + + probe_point* derived_probe::sole_location () const { @@ -424,9 +432,9 @@ alias_expansion_builder // The new probe gets the location list of the alias, n->locations = alias->locations; - // the token location of the use, - n->tok = use->tok; - n->body->tok = use->tok; + // the token location of the alias, + n->tok = location->tok; + n->body->tok = location->tok; // and statements representing the concatenation of the alias' // body with the use's. @@ -1367,6 +1375,9 @@ void semantic_pass_opt1 (systemtap_session& s, bool& relaxed_p) if (s.verbose>2) clog << "Eliding unused function " << s.functions[i]->name << endl; + if (s.tapset_compile_coverage) { + s.unused_functions.push_back (s.functions[i]); + } s.functions.erase (s.functions.begin() + i); relaxed_p = false; // NB: don't increment i @@ -1407,6 +1418,10 @@ void semantic_pass_opt2 (systemtap_session& s, bool& relaxed_p) if (s.verbose>2) clog << "Eliding unused local variable " << l->name << " in " << s.probes[i]->name << endl; + if (s.tapset_compile_coverage) { + s.probes[i]->unused_locals.push_back + (s.probes[i]->locals[j]); + } s.probes[i]->locals.erase(s.probes[i]->locals.begin() + j); relaxed_p = false; // don't increment j @@ -1425,6 +1440,10 @@ void semantic_pass_opt2 (systemtap_session& s, bool& relaxed_p) clog << "Eliding unused local variable " << l->name << " in function " << s.functions[i]->name << endl; + if (s.tapset_compile_coverage) { + s.functions[i]->unused_locals.push_back + (s.functions[i]->locals[j]); + } s.functions[i]->locals.erase(s.functions[i]->locals.begin() + j); relaxed_p = false; // don't increment j @@ -1441,6 +1460,9 @@ void semantic_pass_opt2 (systemtap_session& s, bool& relaxed_p) if (s.verbose>2) clog << "Eliding unused global variable " << l->name << endl; + if (s.tapset_compile_coverage) { + s.unused_globals.push_back(s.globals[i]); + } s.globals.erase(s.globals.begin() + i); relaxed_p = false; // don't increment i |