summaryrefslogtreecommitdiffstats
path: root/main.cxx
diff options
context:
space:
mode:
authorKent Sebastian <ksebasti@redhat.com>2009-07-31 14:45:10 -0400
committerKent Sebastian <ksebasti@redhat.com>2009-07-31 14:45:10 -0400
commitce91eebdf6c262a0235bdd2d3ad3acd0805bf02a (patch)
tree7ca9eef90de8b29a1a977530d623ec7240740db5 /main.cxx
parentf1312b2c2bc1ec7b0475a251f27a2f75779f4ccb (diff)
downloadsystemtap-steved-ce91eebdf6c262a0235bdd2d3ad3acd0805bf02a.tar.gz
systemtap-steved-ce91eebdf6c262a0235bdd2d3ad3acd0805bf02a.tar.xz
systemtap-steved-ce91eebdf6c262a0235bdd2d3ad3acd0805bf02a.zip
PR10204: Place userspace markers in systemtap itself
* cache.cxx (add_to_cache,clean_cache): add static markers * main.cxx (main): likewise * runtime/staprun/common.c (send_request): likewise * runtime/staprun/mainloop.c (stp_main_loop): likewise * runtime/staprun/staprun.c (remove_module): likewise * runtime/staprun/staprun.h: include sdt.h * runtime/staprun/staprun_funcs.c (insert_module): likewise * util.cxx (stap_system): likewise * tapset/stap_staticmarkers.stp: new file
Diffstat (limited to 'main.cxx')
-rw-r--r--main.cxx26
1 files changed, 26 insertions, 0 deletions
diff --git a/main.cxx b/main.cxx
index 6a9444de..2c1b1c68 100644
--- a/main.cxx
+++ b/main.cxx
@@ -21,6 +21,7 @@
#include "coveragedb.h"
#include "git_version.h"
#include "rpm_finder.h"
+#include "sys/sdt.h"
#include <iostream>
#include <fstream>
@@ -820,6 +821,8 @@ main (int argc, char * const argv [])
// PASS 0: setting up
s.verbose = s.perpass_verbose[0];
+ STAP_PROBE1(stap, pass0__start, &s);
+
// For PR1477, we used to override $PATH and $LC_ALL and other stuff
// here. We seem to use complete pathnames in
@@ -871,12 +874,15 @@ main (int argc, char * const argv [])
// and reasonably timely exit.
setup_signals(&handle_interrupt);
+ STAP_PROBE1(stap, pass0__end, &s);
+
struct tms tms_before;
times (& tms_before);
struct timeval tv_before;
gettimeofday (&tv_before, NULL);
// PASS 1a: PARSING USER SCRIPT
+ STAP_PROBE1(stap, pass1a__start, &s);
struct stat user_file_stat;
int user_file_stat_rc = -1;
@@ -928,6 +934,8 @@ main (int argc, char * const argv [])
version_suffixes.push_back ("");
// PASS 1b: PARSING LIBRARY SCRIPTS
+ STAP_PROBE1(stap, pass1b__start, &s);
+
for (unsigned i=0; i<s.include_path.size(); i++)
{
// now iterate upon it
@@ -1015,6 +1023,8 @@ main (int argc, char * const argv [])
<< "Try again with another '--vp 1' option."
<< endl;
+ STAP_PROBE1(stap, pass1__end, &s);
+
if (rc || s.last_pass == 1 || pending_interrupts) goto cleanup;
times (& tms_before);
@@ -1022,6 +1032,7 @@ main (int argc, char * const argv [])
// PASS 2: ELABORATION
s.verbose = s.perpass_verbose[1];
+ STAP_PROBE1(stap, pass2__start, &s);
rc = semantic_pass (s);
if (s.listing_mode || (rc == 0 && s.last_pass == 2))
@@ -1076,12 +1087,15 @@ main (int argc, char * const argv [])
/* Print out list of missing files */
missing_rpm_list_print(s);
+ STAP_PROBE1(stap, pass2__end, &s);
+
if (rc || s.listing_mode || s.last_pass == 2 || pending_interrupts) goto cleanup;
// PASS 3: TRANSLATION
s.verbose = s.perpass_verbose[2];
times (& tms_before);
gettimeofday (&tv_before, NULL);
+ STAP_PROBE1(stap, pass3__start, &s);
rc = translate_pass (s);
@@ -1105,12 +1119,15 @@ main (int argc, char * const argv [])
<< "Try again with another '--vp 001' option."
<< endl;
+ STAP_PROBE1(stap, pass3__end, &s);
+
if (rc || s.last_pass == 3 || pending_interrupts) goto cleanup;
// PASS 4: COMPILATION
s.verbose = s.perpass_verbose[3];
times (& tms_before);
gettimeofday (&tv_before, NULL);
+ STAP_PROBE1(stap, pass4__start, &s);
rc = compile_pass (s);
if (rc == 0 && s.last_pass == 4)
@@ -1172,6 +1189,8 @@ main (int argc, char * const argv [])
}
}
+ STAP_PROBE1(stap, pass4__end, &s);
+
if (rc || s.last_pass == 4 || pending_interrupts) goto cleanup;
@@ -1183,6 +1202,7 @@ pass_5:
// NB: this message is a judgement call. The other passes don't emit
// a "hello, I'm starting" message, but then the others aren't interactive
// and don't take an indefinite amount of time.
+ STAP_PROBE1(stap, pass5__start, &s);
if (s.verbose) clog << "Pass 5: starting run." << endl;
rc = run_pass (s);
times (& tms_after);
@@ -1198,9 +1218,13 @@ pass_5:
// if (rc) goto cleanup;
+ STAP_PROBE1(stap, pass5__end, &s);
+
// PASS 6: cleaning up
cleanup:
+ STAP_PROBE1(stap, pass6__start, &s);
+
// update the database information
if (!rc && s.tapset_compile_coverage && !pending_interrupts) {
#ifdef HAVE_LIBSQLITE3
@@ -1232,6 +1256,8 @@ pass_5:
}
}
+ STAP_PROBE1(stap, pass6__end, &s);
+
return (rc||pending_interrupts) ? EXIT_FAILURE : EXIT_SUCCESS;
}