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 /coveragedb.h | |
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 'coveragedb.h')
-rw-r--r-- | coveragedb.h | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/coveragedb.h b/coveragedb.h new file mode 100644 index 00000000..5b62ba8b --- /dev/null +++ b/coveragedb.h @@ -0,0 +1,70 @@ +// coveragedb.cxx +// Copyright (C) 2007 Red Hat Inc. +// +// This file is part of systemtap, and is free software. You can +// redistribute it and/or modify it under the terms of the GNU General +// Public License (GPL); either version 2, or (at your option) any +// later version. + +#ifndef COVERAGEDB_H +#define COVERAGEDB_H + +#include "session.h" + +#include <string> + + +/* + +tuples: file, line number, column, type of object, name +values: number of times object "pulled_in", number of times "removed", +times executed + +if (compiled == 0) object never compiled +if (compiled > 0) object compiled +if (removed > 0) object parsed +if (executed == 0) never executed +if (executed > 0) executed + + +Want to make sure that the data base accurately reflects testing. +1) atomic updates, either commit all or none of information +2) only update coverage db compile info, if compile successful +3) only update coverage db execute info, if instrumentation run suscessfully + + +Would like to have something that looks for interesting features in db: + +list which things are not compile +list which things are not exectuted + +ratio of compiled/total (overall, by file, by line) +ratio of executed/total (overall, by file, by line) + +*/ + +class coverage_element { +public: + std::string file; + int line; + int col; + std::string type; + std::string name; + std::string parent; + int compiled; + int removed; + int executed; + + coverage_element() { line = 0; col = 0; + compiled = 0; removed = 0; executed = 0; } + + coverage_element(source_loc &place) { + file = place.file; line = place.line; col = place.column; + compiled = 0; removed = 0; executed = 0; } +}; + +void print_coverage_info(systemtap_session &s); +void update_coverage_db(systemtap_session &s); + +#endif + |