diff options
author | Nobuhiro Tachino <tachino@jp.fujitsu.com> | 2008-09-16 22:04:02 -0400 |
---|---|---|
committer | Frank Ch. Eigler <fche@elastic.org> | 2008-09-16 22:04:02 -0400 |
commit | 2fa2a091a0b248855d7f77aa20677ef4c7a7cc61 (patch) | |
tree | eb71f6845b138fc645eb35f0a44ad772aecca68a | |
parent | 9ea1880a389150702defb7517237216d3c926038 (diff) | |
download | systemtap-steved-2fa2a091a0b248855d7f77aa20677ef4c7a7cc61.tar.gz systemtap-steved-2fa2a091a0b248855d7f77aa20677ef4c7a7cc61.tar.xz systemtap-steved-2fa2a091a0b248855d7f77aa20677ef4c7a7cc61.zip |
add new stap -F (flight recorder) option that just passes through to staprun -L
-rw-r--r-- | NEWS | 5 | ||||
-rw-r--r-- | buildrun.cxx | 3 | ||||
-rw-r--r-- | main.cxx | 8 | ||||
-rw-r--r-- | session.h | 1 | ||||
-rw-r--r-- | stap.1.in | 4 |
5 files changed, 20 insertions, 1 deletions
@@ -1,5 +1,10 @@ * What's new +- The stap "-F" flag activates "flight recorder" mode, which consists of + translating the given script as usual, but implicitly launching it into + the background with staprun's existing "-L" (launch) option. A user + can later reattach to the module with "staprun -A MODULENAME". + - Additional context variables are available on user-space syscall probes. - $argN ($arg1, $arg2, ... $arg6) in process(PATH_OR_PID).syscall gives you the argument of the system call. diff --git a/buildrun.cxx b/buildrun.cxx index ada00027..8ec731df 100644 --- a/buildrun.cxx +++ b/buildrun.cxx @@ -287,6 +287,9 @@ run_pass (systemtap_session& s) if (s.need_uprobes) staprun_cmd += "-u "; + if (s.load_only) + staprun_cmd += "-L "; + staprun_cmd += s.tmpdir + "/" + s.module_name + ".ko"; if (s.verbose>1) clog << "Running " << staprun_cmd << endl; @@ -108,6 +108,7 @@ usage (systemtap_session& s, int exitcode) << " -c CMD start the probes, run CMD, and exit when it finishes" << endl << " -x PID sets target() to PID" << endl + << " -F load module and start probes, then detach" << endl << " -d OBJECT add unwind/symbol data for OBJECT file"; if (s.unwindsym_modules.size() == 0) clog << endl; @@ -363,6 +364,7 @@ main (int argc, char * const argv []) s.consult_symtab = false; s.ignore_vmlinux = false; s.ignore_dwarf = false; + s.load_only = false; const char* s_p = getenv ("SYSTEMTAP_TAPSET"); if (s_p != NULL) @@ -426,7 +428,7 @@ main (int argc, char * const argv []) { "ignore-dwarf", 0, &long_opt, LONG_OPT_IGNORE_DWARF }, { NULL, 0, NULL, 0 } }; - int grc = getopt_long (argc, argv, "hVMvtp:I:e:o:R:r:m:kgPc:x:D:bs:uqwl:d:L:", + int grc = getopt_long (argc, argv, "hVMvtp:I:e:o:R:r:m:kgPc:x:D:bs:uqwl:d:L:F", long_options, NULL); if (grc < 0) break; @@ -611,6 +613,10 @@ main (int argc, char * const argv []) have_script = true; break; + case 'F': + s.load_only = true; + break; + case 0: switch (long_opt) { @@ -104,6 +104,7 @@ struct systemtap_session bool prologue_searching; bool tapset_compile_coverage; bool need_uprobes; + bool load_only; // flight recorder mode // Cache data bool use_cache; @@ -185,6 +185,10 @@ and aliases. .BI \-L " PROBE" Similar to "-l", but list probe points and local variables. .TP +.BI \-F +Load module and start probes, then detach from the module leaving the +probes running. +.TP .B \-\-kelf For names and addresses of functions to probe, consult the symbol tables in the kernel and modules. |