summaryrefslogtreecommitdiffstats
path: root/main.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 /main.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 'main.cxx')
-rw-r--r--main.cxx20
1 files changed, 19 insertions, 1 deletions
diff --git a/main.cxx b/main.cxx
index f5740aa9..53f47513 100644
--- a/main.cxx
+++ b/main.cxx
@@ -18,6 +18,7 @@
#include "hash.h"
#include "cache.h"
#include "util.h"
+#include "coveragedb.h"
#include <iostream>
#include <fstream>
@@ -99,6 +100,8 @@ usage (systemtap_session& s, int exitcode)
<< endl
<< " -x PID sets target() to PID" << endl
<< " -t collect probe timing information" << endl
+ << " -q generate information on tapset coverage"
+ << endl
;
// -d: dump safety-related external references
@@ -216,6 +219,7 @@ main (int argc, char * const argv [])
s.perfmon=0;
s.symtab = false;
s.use_cache = true;
+ s.tapset_compile_coverage = false;
const char* s_p = getenv ("SYSTEMTAP_TAPSET");
if (s_p != NULL)
@@ -262,10 +266,14 @@ main (int argc, char * const argv [])
}
}
+ const char* s_tc = getenv ("SYSTEMTAP_COVERAGE");
+ if (s_tc != NULL)
+ s.tapset_compile_coverage = true;
+
while (true)
{
// NB: also see find_hash(), help(), switch stmt below, stap.1 man page
- int grc = getopt (argc, argv, "hVMvtp:I:e:o:R:r:m:kgPc:x:D:bs:u");
+ int grc = getopt (argc, argv, "hVMvtp:I:e:o:R:r:m:kgPc:x:D:bs:uq");
if (grc < 0)
break;
switch (grc)
@@ -402,6 +410,10 @@ main (int argc, char * const argv [])
s.macros.push_back (string (optarg));
break;
+ case 'q':
+ s.tapset_compile_coverage = true;
+ break;
+
case 'h':
usage (s, 0);
break;
@@ -787,6 +799,12 @@ pass_5:
// if (rc) goto cleanup;
cleanup:
+
+ // update the database information
+ if (!rc && s.tapset_compile_coverage) {
+ update_coverage_db(s);
+ }
+
// Clean up temporary directory. Obviously, be careful with this.
if (s.tmpdir == "")
; // do nothing