From f0e31baf0e49c3a5aaaddaa372cf33954b108190 Mon Sep 17 00:00:00 2001 From: ddomingo Date: Thu, 20 Nov 2008 09:35:43 +1000 Subject: changes as per tech review wcohen, run 1 --- doc/SystemTap_Beginners_Guide/en-US/Scripts.xml | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'doc/SystemTap_Beginners_Guide/en-US/Scripts.xml') diff --git a/doc/SystemTap_Beginners_Guide/en-US/Scripts.xml b/doc/SystemTap_Beginners_Guide/en-US/Scripts.xml index ca507b43..e0b7c12c 100644 --- a/doc/SystemTap_Beginners_Guide/en-US/Scripts.xml +++ b/doc/SystemTap_Beginners_Guide/en-US/Scripts.xml @@ -44,7 +44,7 @@ SystemTap scripts allow insertion of the instrumentation code without - recompilation of the code. and allows more flexibility with regard to + recompilation of the code and allows more flexibility with regard to handlers. Events serve as the triggers for handlers to run; handlers can be specified to record specified data and print it in a certain manner. @@ -66,6 +66,23 @@ probe event {statements} single probe, SystemTap will execute the handler when any of the specified events occur. + + + Each probe has a corresponding statement block. This statement block is + enclosed in braces ({ }) and contains the handlers to be executed per event. + SystemTap executes these handlers (i.e. "statements") in sequence; special separators or + terminators are generally not necessary between multiple handlers. + + + + Note + + Statement blocks in SystemTap scripts follow the same syntax and semantics as the C + programming language. A statement block can also nest another statement block, although + for the most part this is used only to organize code in the script for the benefit of the + administrator. + + Systemtap allow you to write functions to factor out code to be used by a @@ -314,7 +331,7 @@ probe timer.s(4)
- Systemtap Handler/Boddy + Systemtap Handler/Body Consider the following sample script: @@ -462,13 +479,14 @@ hald(2360) open The number of seconds since UNIX epoch (January 1, 1970). - + pp() -- cgit