diff options
author | fche <fche> | 2008-02-27 23:11:19 +0000 |
---|---|---|
committer | fche <fche> | 2008-02-27 23:11:19 +0000 |
commit | a20617af34e3dbeba682cfa6bf6366f3fc0f8e14 (patch) | |
tree | cd840323c6adb32af3f5fa8136a396a3a4f8562b /doc/tutorial/functions.stp | |
parent | 9a5de18784b77de82e5121861fac892c2d4d2630 (diff) | |
download | systemtap-steved-a20617af34e3dbeba682cfa6bf6366f3fc0f8e14.tar.gz systemtap-steved-a20617af34e3dbeba682cfa6bf6366f3fc0f8e14.tar.xz systemtap-steved-a20617af34e3dbeba682cfa6bf6366f3fc0f8e14.zip |
PR5697: include tutorial & language reference guide
Diffstat (limited to 'doc/tutorial/functions.stp')
-rw-r--r-- | doc/tutorial/functions.stp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/doc/tutorial/functions.stp b/doc/tutorial/functions.stp new file mode 100644 index 00000000..6a825722 --- /dev/null +++ b/doc/tutorial/functions.stp @@ -0,0 +1,18 @@ +# Red Hat convention +function system_uid_p (u) { return u < 500 } + +# kernel device number assembly macro +function makedev (major,minor) { return major << 20 | minor } + +function trace_common () +{ + printf("%d %s(%d)", gettimeofday_s(), execname(), pid()) + # no return value +} + +function fibonacci (i) +{ + if (i < 1) return 0 + else if (i < 2) return 1 + else return fibonacci(i-1) + fibonacci(i-2) +} |