diff options
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | NEWS | 4 | ||||
-rw-r--r-- | doc/langref.tex | 8 | ||||
-rw-r--r-- | stapprobes.5.in | 4 | ||||
-rw-r--r-- | testsuite/systemtap.base/stmt_rel.exp | 1 | ||||
-rw-r--r-- | testsuite/systemtap.base/stmt_rel.stp | 19 |
6 files changed, 25 insertions, 14 deletions
@@ -17,6 +17,9 @@ 2008-06-23 Stan Cox <scox@redhat.com> + * NEWS: Updated .statement line number wildcard and line number range. + * stapprobes.5.in: Likewise. + * doc/langref.tex: Likewise. * tapsets.cxx (enum line_t): Add RANGE and WILDCARD. (iterate_over_srcfile_lines): Change lineno parm to lines[]. Support RANGE and WILDCARD. @@ -1,5 +1,9 @@ * What's new in version 0.7 +- .statement("func@file:*") and .statement("func@file:M-N") probes are now + supported to allow matching a range of lines in a function. This allows + tracing the execution of a function. + - Scripts relying on probe point wildcards like "syscall.*" that expand to distinct kprobes are processed significantly faster than before. diff --git a/doc/langref.tex b/doc/langref.tex index 28a9f1b6..e2c630d4 100644 --- a/doc/langref.tex +++ b/doc/langref.tex @@ -751,10 +751,12 @@ In most cases, the path should be relative to the top of the linux source directory, although an absolute path may be necessary for some kernels. If a relative pathname doesn't work, try absolute. \item The third part is optional if the file name part was given. It identifies -the line number in the source file, preceded by a '':'' or ''+''. +the line number in the source file, preceded by a ``:'' or ``+''. The line number is assumed to be an -absolute line number if preceded by a '':'', or relative to the entry of -function if preceded by a ''+''. +absolute line number if preceded by a ``:'', or relative to the entry of +the function if preceded by a ``+''. +All the lines in the function can be matched with ``:*''. +A range of lines x through y can be matched with ``:x-y''. \end{enumerate} Alternately, specify PATTERN as a numeric constant to indicate a relative diff --git a/stapprobes.5.in b/stapprobes.5.in index 025aa2a8..5d400cb6 100644 --- a/stapprobes.5.in +++ b/stapprobes.5.in @@ -259,7 +259,9 @@ Finally, the third part is optional if the file name part was given, and identifies the line number in the source file preceded by a ":" or a "+". The line number is assumed to be an absolute line number if preceded by a ":", or relative to the entry of -function if preceded by a "+". +the function if preceded by a "+". +All the lines in the function can be matched with ":*". +A range of lines x through y can be matched with ":x-y". .PP As an alternative, PATTERN may be a numeric constant, indicating an (module-relative or kernel-_stext-relative) address. In guru mode diff --git a/testsuite/systemtap.base/stmt_rel.exp b/testsuite/systemtap.base/stmt_rel.exp index a13631e6..25156d9b 100644 --- a/testsuite/systemtap.base/stmt_rel.exp +++ b/testsuite/systemtap.base/stmt_rel.exp @@ -3,7 +3,6 @@ set test "stmt_rel" set ::result_string {PASS bio_init PASS line number -PASS address PASS wildcard } diff --git a/testsuite/systemtap.base/stmt_rel.stp b/testsuite/systemtap.base/stmt_rel.stp index 43c38594..13066161 100644 --- a/testsuite/systemtap.base/stmt_rel.stp +++ b/testsuite/systemtap.base/stmt_rel.stp @@ -1,13 +1,13 @@ -global stack2, stack2pp, stack2func, stack3, stack3pp, stack3func +global stack2pp, stack2func, stack3pp, stack3func global wildcardpp, wild_count probe kernel.statement("bio_init@fs/bio.c+2") { - stack2 = tokenize(backtrace(), " ") + # stack2 = tokenize(backtrace(), " ") stack2func = probefunc() stack2pp = pp() } probe kernel.statement("bio_init@fs/bio.c+3") { - stack3 = tokenize(backtrace(), " " ) + # stack3 = tokenize(backtrace(), " " ) stack3func = probefunc() stack3pp = pp() } @@ -46,13 +46,14 @@ probe kernel.statement("bio_put@fs/bio.c:*") { printf ("FAIL line number %d %d\n", stack2line, stack3line) } + # This test does not take optimized code into account # Was address for bio_init probe +2 < address for bio_init probe +3? - if (stack2 < stack3) { - printf ("PASS address\n") - } - else { - printf ("FAIL address %s %s\n", stack2, stack3) - } + # if (stack2 < stack3) { + # printf ("PASS address\n") + # } + # else { + # printf ("FAIL address %s %s\n", stack2, stack3) + # } # Did wildcard probe hit at least 5 different statements? foreach ([i] in wildcardpp) { |