From 384c5fe974abe35ab11dce4446dc5eed86585a3b Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Thu, 7 Aug 2008 16:47:18 -0400 Subject: samples: separate into subdirectories by subsystem --- testsuite/systemtap.examples/io/iotop.stp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 testsuite/systemtap.examples/io/iotop.stp (limited to 'testsuite/systemtap.examples/io/iotop.stp') diff --git a/testsuite/systemtap.examples/io/iotop.stp b/testsuite/systemtap.examples/io/iotop.stp new file mode 100644 index 00000000..6050343c --- /dev/null +++ b/testsuite/systemtap.examples/io/iotop.stp @@ -0,0 +1,25 @@ +global reads, writes, total_io + +probe kernel.function("vfs_read") { + reads[execname()] += $count +} + +probe kernel.function("vfs_write") { + writes[execname()] += $count +} + +# print top 10 IO processes every 5 seconds +probe timer.s(5) { + foreach (name in writes) + total_io[name] += writes[name] + foreach (name in reads) + total_io[name] += reads[name] + printf ("%16s\t%10s\t%10s\n", "Process", "KB Read", "KB Written") + foreach (name in total_io- limit 10) + printf("%16s\t%10d\t%10d\n", name, + reads[name]/1024, writes[name]/1024) + delete reads + delete writes + delete total_io + print("\n") +} -- cgit From a81c61ac1947cb5c13d3a758fc793a119b88b4e0 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Mon, 11 Aug 2008 12:24:47 +0200 Subject: PR2895. Add proper #! /usr/bin/env stap line. Make example scripts executable. --- testsuite/systemtap.examples/io/iotop.stp | 2 ++ 1 file changed, 2 insertions(+) mode change 100644 => 100755 testsuite/systemtap.examples/io/iotop.stp (limited to 'testsuite/systemtap.examples/io/iotop.stp') diff --git a/testsuite/systemtap.examples/io/iotop.stp b/testsuite/systemtap.examples/io/iotop.stp old mode 100644 new mode 100755 index 6050343c..2fa3e3ae --- a/testsuite/systemtap.examples/io/iotop.stp +++ b/testsuite/systemtap.examples/io/iotop.stp @@ -1,3 +1,5 @@ +#! /usr/bin/env stap + global reads, writes, total_io probe kernel.function("vfs_read") { -- cgit