From cffd1e12179857f6fc50d848c7ecc35742aca75e Mon Sep 17 00:00:00 2001 From: William Cohen Date: Mon, 15 Dec 2008 14:29:30 -0500 Subject: Minor edits and format corrections. --- doc/SystemTap_Beginners_Guide/en-US/Scripts.xml | 138 ++++++++++++------------ 1 file changed, 69 insertions(+), 69 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 fe2e69f4..bb71625e 100644 --- a/doc/SystemTap_Beginners_Guide/en-US/Scripts.xml +++ b/doc/SystemTap_Beginners_Guide/en-US/Scripts.xml @@ -129,7 +129,7 @@ SystemTap scripts use the file extension .stp, and - are conatains probes written in the following format: + contains probes written in the following format: @@ -555,21 +555,21 @@ probe timer.s(4) Consider the following sample script: - helloworld.stp - - probe begin - { - printf ("hello world\n") - exit () - } - - +helloworld.stp + +probe begin +{ + printf ("hello world\n") + exit () +} + + In , the event begin (i.e. the start of the session) triggers the handler enclosed in { }, which simply prints hello - world, then exits. + world followed by a new-line, then exits. @@ -666,15 +666,15 @@ probe timer.s(4) To illustrate this, consider the following probe example: - - variables-in-printf-statements.stp - - probe syscall.open - { - printf ("%s(%d) open\n", execname(), pid()) - } - - + +variables-in-printf-statements.stp + +probe syscall.open +{ + printf ("%s(%d) open\n", execname(), pid()) +} + + instructs SystemTap to probe all entries to @@ -688,16 +688,16 @@ probe timer.s(4) to "argument1", "format specifier2" is to "argument2", or is this clear enough? - - vmware-guestd(2206) open - hald(2360) open - hald(2360) open - hald(2360) open - df(3433) open - df(3433) open - df(3433) open - hald(2360) open - + +vmware-guestd(2206) open +hald(2360) open +hald(2360) open +hald(2360) open +df(3433) open +df(3433) open +df(3433) open +hald(2360) open + SystemTap Functions @@ -945,42 +945,42 @@ probe timer.s(4) thread_indent(): - thread_indent.stp - - probe kernel.function("*@net/socket.c") - { - printf ("%s -> %s\n", thread_indent(1), probefunc()) - } - probe kernel.function("*@net/socket.c").return - { - printf ("%s <- %s\n", thread_indent(-1), probefunc()) - } - - +thread_indent.stp + +probe kernel.function("*@net/socket.c") +{ + printf ("%s -> %s\n", thread_indent(1), probefunc()) +} +probe kernel.function("*@net/socket.c").return +{ + printf ("%s <- %s\n", thread_indent(-1), probefunc()) +} + + prints out the thread_indent() and probe functions at each event in the following format: - - 0 ftp(7223): -> sys_socketcall - 1159 ftp(7223): -> sys_socket - 2173 ftp(7223): -> __sock_create - 2286 ftp(7223): -> sock_alloc_inode - 2737 ftp(7223): <- sock_alloc_inode - 3349 ftp(7223): -> sock_alloc - 3389 ftp(7223): <- sock_alloc - 3417 ftp(7223): <- __sock_create - 4117 ftp(7223): -> sock_create - 4160 ftp(7223): <- sock_create - 4301 ftp(7223): -> sock_map_fd - 4644 ftp(7223): -> sock_map_file - 4699 ftp(7223): <- sock_map_file - 4715 ftp(7223): <- sock_map_fd - 4732 ftp(7223): <- sys_socket - 4775 ftp(7223): <- sys_socketcall - + +0 ftp(7223): -> sys_socketcall +1159 ftp(7223): -> sys_socket +2173 ftp(7223): -> __sock_create +2286 ftp(7223): -> sock_alloc_inode +2737 ftp(7223): <- sock_alloc_inode +3349 ftp(7223): -> sock_alloc +3389 ftp(7223): <- sock_alloc +3417 ftp(7223): <- __sock_create +4117 ftp(7223): -> sock_create +4160 ftp(7223): <- sock_create +4301 ftp(7223): -> sock_map_fd +4644 ftp(7223): -> sock_map_file +4699 ftp(7223): <- sock_map_file +4715 ftp(7223): <- sock_map_fd +4732 ftp(7223): <- sys_socket +4775 ftp(7223): <- sys_socketcall + This sample output contains the following information: @@ -1073,15 +1073,15 @@ probe timer.s(4) to it. For example: - - targetexample.stp - - probe syscall.* { - if (pid() == target()) - printf("%s/n", name) - } - - + +targetexample.stp + +probe syscall.* { + if (pid() == target()) + printf("%s/n", name) +} + + When is run with the argument -- cgit From 70be2c5b7a1ae10d23bb092a04031a119136aa47 Mon Sep 17 00:00:00 2001 From: ddomingo Date: Tue, 16 Dec 2008 12:06:35 +1000 Subject: corrected index entries as per wcohen --- doc/SystemTap_Beginners_Guide/en-US/Scripts.xml | 100 ++++++++++++------------ 1 file changed, 50 insertions(+), 50 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 bb71625e..88aa42ab 100644 --- a/doc/SystemTap_Beginners_Guide/en-US/Scripts.xml +++ b/doc/SystemTap_Beginners_Guide/en-US/Scripts.xml @@ -581,7 +581,7 @@ probe begin exit() - Handlers + functions SystemTap scripts continue to run until the @@ -732,20 +732,20 @@ hald(2360) open functions - handler functions - tid() + tid() + - handler functions - Handlers - tid() + functions + tid() + tid() - Handlers - handler functions + functions + The ID of the current thread. @@ -757,20 +757,20 @@ hald(2360) open functions - handler functions - uid() + + uid() - + uid() - Handlers - handler functions + functions + The ID of the current user. @@ -781,20 +781,20 @@ hald(2360) open functions - handler functions - cpu() + + cpu() - + cpu() - Handlers - handler functions + functions + The current CPU number. @@ -805,20 +805,20 @@ hald(2360) open functions - handler functions - gettimeofday_s() + + gettimeofday_s() - + gettimeofday_s() - Handlers - handler functions + functions + The number of seconds since UNIX epoch (January 1, 1970). @@ -830,20 +830,20 @@ hald(2360) open functions - handler functions - ctime() + + ctime() - + ctime() - Handlers - handler functions + functions + Convert number of seconds since UNIX epoch to date. @@ -865,20 +865,20 @@ hald(2360) open functions - handler functions - pp() + + pp() - + pp() - Handlers - handler functions + functions + A string describing the probe point currently being handled. @@ -897,20 +897,20 @@ hald(2360) open functions - handler functions - thread_indent() + + thread_indent() - + thread_indent() - Handlers - handler functions + functions + This particular function is quite useful, providing you with a way @@ -1047,20 +1047,20 @@ probe kernel.function("*@net/socket.c").return functions - handler functions - target() + + target() - + target() - Handlers - handler functions + functions + Used in conjunction with stap -- cgit