From 6d24a6c909520290b1c508ae1624a218f19e93f1 Mon Sep 17 00:00:00 2001 From: ddomingo Date: Mon, 15 Sep 2008 15:21:57 +1000 Subject: minor revisions as per dsmith --- doc/SystemTap_Beginners_Guide/en-US/Scripts.xml | 39 +++++++++++++++++++++---- 1 file changed, 33 insertions(+), 6 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 bed0bd06..8426dc70 100644 --- a/doc/SystemTap_Beginners_Guide/en-US/Scripts.xml +++ b/doc/SystemTap_Beginners_Guide/en-US/Scripts.xml @@ -13,9 +13,12 @@ As stated in , SystemTap scripts are made up of two components: events and handlers. Once a SystemTap session is underway, SystemTap monitors the operating system for the specified events and executes the handlers as they occur. + Note An event and its corresponding handler is collectively called a probe. A SystemTap script can have multiple probes. + + A probe's handler is also commonly referred to as a probe body. @@ -92,11 +95,34 @@ probe kernel.function("*@net/socket.c").return { } syscall.[system_call] - The entry to the system call [system_call]. Similar to kerne.function, appending a return to the statement specifies the exit of the system call. For example, to specify the entry of the system call close, use syscall.close.return. + The entry to the system call [system_call]. Similar to kernel.function, appending a return to the statement specifies the exit of the system call. For example, to specify the entry of the system call close, use syscall.close.return. To identify what system calls are made by a specific program/command, use strace command. + + + timer.ms() + + An event that specifies a handler to be executed "after X number of milliseconds". For example: + +Using timer.ms + +probe timer.ms(4000) +{ + exit() +} + + + + + is an example of a probe that allows you to terminate the script after 4000 milliseconds (or 4 seconds). When used in conjunction with another probe that traps a large quantity of data, a probe using timer.ms() allows you to limit the information your script is collecting (and printing out). + + + + + +