From 27cffb521607b81eec660ab9f5b8b607d014c692 Mon Sep 17 00:00:00 2001 From: fche Date: Wed, 3 Aug 2005 16:54:12 +0000 Subject: 2005-08-03 Frank Ch. Eigler * README: Be more specific about prerequisites. * tapset/builtin_string.stp: New builtin. * testsuite/buildok/seven.stp, semko/eighteen.stp: New tests. --- ChangeLog | 6 ++++++ README | 7 ++++--- stap.1 | 21 +++++++++++++++++++-- tapset/builtin_string.stp | 7 +++++++ testsuite/buildok/seven.stp | 6 ++++++ testsuite/semko/eighteen.stp | 5 +++++ 6 files changed, 47 insertions(+), 5 deletions(-) create mode 100644 tapset/builtin_string.stp create mode 100755 testsuite/buildok/seven.stp create mode 100755 testsuite/semko/eighteen.stp diff --git a/ChangeLog b/ChangeLog index ecb99666..f029081a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-08-03 Frank Ch. Eigler + + * README: Be more specific about prerequisites. + * tapset/builtin_string.stp: New builtin. + * testsuite/buildok/seven.stp, semko/eighteen.stp: New tests. + 2005-08-03 Roland McGrath * configure.ac, systemtap.spec.in: Version 0.2.1. diff --git a/README b/README index cb5bfd3f..e1d7c268 100644 --- a/README +++ b/README @@ -10,8 +10,9 @@ See the INSTALL file for generic build instructions. Prerequisites: - linux kernel 2.6.11+ with kprobes -- kernel module build environment -- C compiler -- elfutils with libdwfl +- kernel module build environment (kernel-devel or kernel-smp-devel rpm) +- kernel debugging information (kernel-debuginfo rpm) +- C compiler (same as what kernel was compiled with) +- elfutils with libdwfl (from fedora rawhide) - root privileges diff --git a/stap.1 b/stap.1 index 78d6d763..f313790f 100644 --- a/stap.1 +++ b/stap.1 @@ -209,8 +209,11 @@ instructions, and any auxiliary definitions for use by other embedded code. The other place where embedded code is permitted is as a function body. -.SS BUILT-IN FUNCTIONS - +.SS BUILT-INS +A set of builtin functions and probe aliases are provided by the +scripts installed under the +.IR /usr/share/systemtap/tapset +directory. .SH PROCESSING The translator begins pass 1 by parsing the given input script, @@ -287,6 +290,20 @@ kernel into temporary files, until the user sends an interrupt signal. Finally, it unloads the module, and cleans up. .SH EXAMPLES +To trace entry and exit from a function, use a pair of probes: +.RS +.br +probe kernel.function("foo") { log ("enter") } +probe kernel.function("foo").return { log ("exit") } +.RE + +To list the probeable functions in the kernel, use +.RS +.br +stap -p2 -e 'probe kernel.function("*") {}' +.RE + + .SH SAFETY AND SECURITY Systemtap is an administrative tool at this time. It exposes kernel diff --git a/tapset/builtin_string.stp b/tapset/builtin_string.stp new file mode 100644 index 00000000..d068febb --- /dev/null +++ b/tapset/builtin_string.stp @@ -0,0 +1,7 @@ +function _string (num) %{ + sprintf (THIS->__retvalue, "%lld", (long long) THIS->num); +%} + +function string (num) { + return "" . _string (num + 0) +} diff --git a/testsuite/buildok/seven.stp b/testsuite/buildok/seven.stp new file mode 100755 index 00000000..236222df --- /dev/null +++ b/testsuite/buildok/seven.stp @@ -0,0 +1,6 @@ +#! stap -p4 + +probe kernel.function("scheduler_tick") { + log ("scheduler_tick (" . string ($user_ticks) . ", " . + string ($sys_ticks) . ")") +} diff --git a/testsuite/semko/eighteen.stp b/testsuite/semko/eighteen.stp new file mode 100755 index 00000000..d7ad325b --- /dev/null +++ b/testsuite/semko/eighteen.stp @@ -0,0 +1,5 @@ +#! stap -p2 + +probe kernel.function("schedule") { + log ($no_such_variable_anywhere) +} -- cgit