From 8c39844b59f49526240c65b81a79eef311fe4177 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Wed, 29 Jul 2009 12:35:29 -0700 Subject: Use a real session flag for -L Rather than relying on 'unoptimized' to tell us that the listing mode should print the variables too, this adds an explicit listing_mode_vars. * session.h (systemtap_session): Add listing_mode_vars * main.cxx (main): Set s.listing_mode_vars appropriately. (printscript): Use the new flag for deciding whether to print locals --- main.cxx | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'main.cxx') diff --git a/main.cxx b/main.cxx index 9dc658ff..6a9444de 100644 --- a/main.cxx +++ b/main.cxx @@ -193,16 +193,17 @@ printscript(systemtap_session& s, ostream& o) { o << pp; // Print the locals for -L mode only - if (s.unoptimized) { - for (unsigned j=0; jlocals.size(); j++) - { - o << " "; - vardecl* v = p->locals[j]; - v->printsig (o); - } - // Print arguments of probe if there - p->printargs(o); - } + if (s.listing_mode_vars) + { + for (unsigned j=0; jlocals.size(); j++) + { + o << " "; + vardecl* v = p->locals[j]; + v->printsig (o); + } + // Print arguments of probe if there + p->printargs(o); + } o << endl; seen.insert (pp); } @@ -377,6 +378,7 @@ main (int argc, char * const argv []) s.unoptimized = false; s.suppress_warnings = false; s.listing_mode = false; + s.listing_mode_vars = false; #ifdef ENABLE_PROLOGUES s.prologue_searching = true; @@ -665,6 +667,7 @@ main (int argc, char * const argv []) break; case 'L': + s.listing_mode_vars = true; s.unoptimized = true; // This causes retention of variables for listing_mode case 'l': -- cgit From ce91eebdf6c262a0235bdd2d3ad3acd0805bf02a Mon Sep 17 00:00:00 2001 From: Kent Sebastian Date: Fri, 31 Jul 2009 14:45:10 -0400 Subject: 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 --- main.cxx | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'main.cxx') 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 #include @@ -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