From 708a511bd92ec7ba3ff8787c67b3058dbdaa5f3a Mon Sep 17 00:00:00 2001 From: wcohen Date: Fri, 5 May 2006 20:35:30 +0000 Subject: 2006-05-05 Will Cohen * small_demos/fileopen.stp: Shows use of target() to look at pid. * small_demos/rwtiming.stp: Shows per executable histograms of time spent in read and write system calls. --- examples/small_demos/fileopen.stp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 examples/small_demos/fileopen.stp (limited to 'examples/small_demos/fileopen.stp') diff --git a/examples/small_demos/fileopen.stp b/examples/small_demos/fileopen.stp new file mode 100644 index 00000000..5d59ee55 --- /dev/null +++ b/examples/small_demos/fileopen.stp @@ -0,0 +1,19 @@ +# fileopen.stp +# +# This is based on dtrace script from +# http://www.gnome.org/~gman/blog/2006/Jan +# +#stap fileopen.stp -c "zenity --about" + +global opens + +probe syscall.open { + if (target() == pid()) opens[filename] ++ +} + +probe end { + foreach([name] in opens+) { + printf("%-70s%5d\n", name, opens[name]) + } +} + -- cgit