From 88559594e2c9b2b9d043c3d94a5b2700f0448654 Mon Sep 17 00:00:00 2001 From: ddomingo Date: Wed, 17 Sep 2008 11:13:22 +1000 Subject: revisions as per sghosh --- doc/SystemTap_Beginners_Guide/en-US/Scripts.xml | 98 +++++++++++++++---------- 1 file changed, 61 insertions(+), 37 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 bbd265c2..e8f9c3cb 100644 --- a/doc/SystemTap_Beginners_Guide/en-US/Scripts.xml +++ b/doc/SystemTap_Beginners_Guide/en-US/Scripts.xml @@ -56,25 +56,15 @@ probe [event],
Events - - SystemTap supports multiple events per probe; as shown in , multiple events are delimited by a comma (,). Sample [event]s include: +SystemTap events can be broadly classified into two types: synchronous and asynchronous. - - - - begin - - The startup of a SystemTap session; i.e. as soon as the SystemTap script is run. - - +Synchronous Events + A synchronous event occurs when any processor executes an instruction matched by the specification. This gives other events a reference point (or instruction address) from which more contextual data may be available. + - - end - - The end of a SystemTap session. - - +Examples of synchronous events include: + kernel.function("[function]") @@ -100,6 +90,56 @@ probe kernel.function("*@net/socket.c").return { } To identify what system calls are made by a specific program/command, use strace command. + + + module("[module]").function("[function]") + + Allows you to probe functions within modules. For example: + + Module Probe + + probe module("ext3").function("*") { } + probe module("ext3").function("*").return { } + + + + + The first probe in points to the entry of all functions for the ext3 module. The second probe points to the exits of all entries for that same module; the use of the .return suffix is similar to kernel.function(). Note that the probes in also do not contain probe bodies, and as such will not print any useful data (as in ). + + + + A system's loaded modules are typically located in /lib/modules/[kernel version], where kernel version refers to the currently loaded kernel. Modules use the filename extension .ko. + + + + + + + + + Asynchronous Events + Asynchronous events, on the other hand, do not point to any reference point. This family of probe points consists mainly of counters, timers, and similar constructs. + + + Examples of asynchronous events include: + + + + + begin + + The startup of a SystemTap session; i.e. as soon as the SystemTap script is run. + + + + + end + + The end of a SystemTap session. + + + + timer.ms() @@ -122,28 +162,7 @@ probe timer.ms(4000) - - module("[module]").function("[function]") - - Allows you to probe functions within modules. For example: - -Module Probe - -probe module("ext3").function("*") { } -probe module("ext3").function("*").return { } - - - - - The first probe in points to the entry of all functions for the ext3 module. The second probe points to the exits of all entries for that same module; the use of the .return suffix is similar to kernel.function(). Note that the probes in also do not contain probe bodies, and as such will not print any useful data (as in ). - - - - A system's loaded modules are typically located in /lib/modules/[kernel version], where kernel version refers to the currently loaded kernel. Modules use the filename extension .ko. - - -