diff options
author | hunt <hunt> | 2007-08-16 15:58:19 +0000 |
---|---|---|
committer | hunt <hunt> | 2007-08-16 15:58:19 +0000 |
commit | bf49da0383481795d0a8d608beee27f6b1a251dc (patch) | |
tree | 4397940a3f816fc48ffe8ae378cf73272fbcf533 /testsuite | |
parent | 8353d520121fcca1b6697a10d49e23e371ded720 (diff) | |
download | systemtap-steved-bf49da0383481795d0a8d608beee27f6b1a251dc.tar.gz systemtap-steved-bf49da0383481795d0a8d608beee27f6b1a251dc.tar.xz systemtap-steved-bf49da0383481795d0a8d608beee27f6b1a251dc.zip |
2007-08-16 Martin Hunt <hunt@redhat.com>
* all_syscalls.stp: New file. Useful for debugging.
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/systemtap.syscall/ChangeLog | 4 | ||||
-rwxr-xr-x | testsuite/systemtap.syscall/all_syscalls.stp | 41 |
2 files changed, 45 insertions, 0 deletions
diff --git a/testsuite/systemtap.syscall/ChangeLog b/testsuite/systemtap.syscall/ChangeLog index b849537f..8a1c3e99 100644 --- a/testsuite/systemtap.syscall/ChangeLog +++ b/testsuite/systemtap.syscall/ChangeLog @@ -1,3 +1,7 @@ +2007-08-16 Martin Hunt <hunt@redhat.com> + + * all_syscalls.stp: New file. Useful for debugging. + 2007-07-31 Martin Hunt <hunt@redhat.com> * clock.c (main): Change flags to hex. diff --git a/testsuite/systemtap.syscall/all_syscalls.stp b/testsuite/systemtap.syscall/all_syscalls.stp new file mode 100755 index 00000000..2178d84f --- /dev/null +++ b/testsuite/systemtap.syscall/all_syscalls.stp @@ -0,0 +1,41 @@ +#!/usr/bin/env stap + +# Show all the systemcalls that an executable makes. +# Usage: stap -c progname all_syscalls.stp OR +# ./all_syscalls.stp -c progname + +global indent, indent_str + +probe begin { + indent = 0 + for (i=0; i<20; i++) { + if (i == 0) + indent_str[0] = "" + else + indent_str[i] = indent_str[i-1] . " " + } +} + + +probe kernel.function("sys_*") ?, + kernel.function("sys32_*") ?, + kernel.function("compat_sys_*") ? +{ + if (pid() == target()) { + printf("%s%s\n", indent_str[indent], pp()) + indent++ + } +} + +probe kernel.function("sys_*").return ?, + kernel.function("sys32_*").return ?, + kernel.function("compat_sys_*").return ? +{ + if (pid() == target()) { + if (indent) indent-- + } +} + +probe end { + printf("\n") +} |