diff options
author | Wenji Huang <wenji.huang@oracle.com> | 2008-09-05 01:08:42 -0400 |
---|---|---|
committer | Wenji Huang <wenji.huang@oracle.com> | 2008-09-05 01:08:42 -0400 |
commit | d4e35ac85af99905bdb1c88f7750d917d7dc3473 (patch) | |
tree | 5752653a3ed80283b15a24c8c1aeae6aae7ad133 | |
parent | 05ec91b49d163869a7470c8152c01ed03c16f0fb (diff) | |
download | systemtap-steved-d4e35ac85af99905bdb1c88f7750d917d7dc3473.tar.gz systemtap-steved-d4e35ac85af99905bdb1c88f7750d917d7dc3473.tar.xz systemtap-steved-d4e35ac85af99905bdb1c88f7750d917d7dc3473.zip |
PR6731: Updated listing mode through adding -L option.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | main.cxx | 29 | ||||
-rw-r--r-- | stap.1.in | 12 | ||||
-rw-r--r-- | stapex.5.in | 5 | ||||
-rw-r--r-- | testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | testsuite/systemtap.base/cmd_parse.exp | 8 |
6 files changed, 49 insertions, 15 deletions
@@ -1,3 +1,9 @@ +2008-09-05 Wenji Huang <wenji.huang@oracle.com> + + PR 6731. + * main.cxx (usage,main,printscript): Improve listing mode with "-L". + * stap.1.in, stapex.5.in: Document it. + 2008-09-04 Frank Ch. Eigler <fche@elastic.org> * main.cxx (usage): Remove some dwarfless items. @@ -69,6 +69,8 @@ usage (systemtap_session& s, int exitcode) << endl << " or: stap [options] -l PROBE List matching probes." << endl + << " or: stap [options] -L PROBE List matching probes and local variables." + << endl << endl << "Options:" << endl << " -- end of translator options, script options follow" << endl @@ -177,19 +179,14 @@ printscript(systemtap_session& s, ostream& o) // print the alias head name once. if (seen.find (pp) == seen.end()) { - o << pp << endl; - if (s.verbose) { - for (unsigned j=0; j<p->locals.size(); j++) - { - vardecl* v = p->locals[j]; - if (j>0) - o << ", "; - else - o << " "; - v->printsig (o); - } - o << endl; - } + o << pp; + for (unsigned j=0; j<p->locals.size(); j++) + { + o << " "; + vardecl* v = p->locals[j]; + v->printsig (o); + } + o << endl; seen.insert (pp); } } @@ -421,7 +418,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:", + int grc = getopt_long (argc, argv, "hVMvtp:I:e:o:R:r:m:kgPc:x:D:bs:uqwl:d:L:", long_options, NULL); if (grc < 0) break; @@ -589,10 +586,12 @@ main (int argc, char * const argv []) usage (s, 0); break; + case 'L': + s.unoptimized = true; + case 'l': s.suppress_warnings = true; s.listing_mode = true; - s.unoptimized = true; s.last_pass = 2; if (have_script) { @@ -54,6 +54,15 @@ stap \- systemtap script translator/driver [ .I ARGUMENTS ] +.br +.B stap +[ +.I OPTIONS +] +.BI \-L " PROBE" +[ +.I ARGUMENTS +] .SH DESCRIPTION @@ -173,6 +182,9 @@ Instead of running a probe script, just list all available probe points matching the given pattern. The pattern may include wildcards and aliases. .TP +.BI \-L " PROBE" +Similar to "-l", but list probe points and local variables. +.TP .B \-\-kelf For names and addresses of functions to probe, consult the symbol tables in the kernel and modules. diff --git a/stapex.5.in b/stapex.5.in index e6763267..38f30f62 100644 --- a/stapex.5.in +++ b/stapex.5.in @@ -106,6 +106,11 @@ To list the probeable functions in the kernel, use the listings mode. % stap \-l \[aq]kernel.function("*")\[aq] .ESAMPLE +To list the probeable functions and local variables in the kernel, use another listings mode. +.SAMPLE +% stap \-L \[aq]kernel.function("*")\[aq] +.ESAMPLE + .SH MORE EXAMPLES Larger examples, demos and samples can be found in diff --git a/testsuite/ChangeLog b/testsuite/ChangeLog index 26573fcb..9ca00077 100644 --- a/testsuite/ChangeLog +++ b/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2008-09-05 Wenji Huang <wenji.huang@oracle.com> + + * systemtap.base/cmd_parse.stp: Add test for "-L" option. + 2008-09-01 Stan Cox <scox@redhat.com> * systemtap.base/global_end.stp: Also check statistics. diff --git a/testsuite/systemtap.base/cmd_parse.exp b/testsuite/systemtap.base/cmd_parse.exp index e33bfa85..c37d358f 100644 --- a/testsuite/systemtap.base/cmd_parse.exp +++ b/testsuite/systemtap.base/cmd_parse.exp @@ -121,3 +121,11 @@ expect { } wait +spawn stap -L syscall.a* +expect { + -timeout 60 + -re {(syscall\.a[_a-zA-Z0-9]*(\ [_a-zA-Z0-9\$]+:(string|long|unknown|stats))*\r\n)+} { pass "cmd_parse13" } + timeout {fail "cmd_parse13: unexpected timeout"} + eof {fail "cmd_parse13: unexpected EOF"} +} +wait |