From 67f8611b9ed9e40a7be946601293ac5b42c52686 Mon Sep 17 00:00:00 2001 From: William Cohen Date: Tue, 17 Mar 2009 16:45:30 -0400 Subject: Replace systemtap.samples/ioblocktest.stp with ioblktime.stp. --- testsuite/systemtap.examples/index.html | 3 +++ testsuite/systemtap.examples/index.txt | 13 +++++++++++ testsuite/systemtap.examples/io/ioblktime.meta | 13 +++++++++++ testsuite/systemtap.examples/io/ioblktime.stp | 29 +++++++++++++++++++++++++ testsuite/systemtap.examples/keyword-index.html | 3 +++ testsuite/systemtap.examples/keyword-index.txt | 13 +++++++++++ 6 files changed, 74 insertions(+) create mode 100644 testsuite/systemtap.examples/io/ioblktime.meta create mode 100755 testsuite/systemtap.examples/io/ioblktime.stp (limited to 'testsuite/systemtap.examples') diff --git a/testsuite/systemtap.examples/index.html b/testsuite/systemtap.examples/index.html index 7b76baa1..0f4b2572 100644 --- a/testsuite/systemtap.examples/index.html +++ b/testsuite/systemtap.examples/index.html @@ -58,6 +58,9 @@ keywords: DISK
  • io/io_submit.stp - Tally Reschedule Reason During AIO io_submit Call
    keywords: IO BACKTRACE

    When a reschedule occurs during an AIO io_submit call, accumulate the traceback in a histogram. When the script exits prints out a sorted list from most common to least common backtrace.

  • +
  • io/ioblktime.stp - Average Time Block IO Requests Spend in Queue
    +keywords: IO
    +

    The ioblktime.stp script tracks the amount of time that each block IO requests spend waiting for completion. The script compute the average time waiting time for block IO per device and prints list every 10 seconds. In some cases there can be too many oustanding block IO operations and the script may exceed the default number of MAXMAPENTRIES allowed. In this case the allowed number can be increased with "-DMAXMAPENTRIES=10000" option on the stap command line.

  • io/iostats.stp - List Executables Reading and Writing the Most Data
    keywords: IO PROFILING

    The iostat.stp script measures the amount of data successfully read and written by all the executables on the system. The output is sorted from most greatest sum of bytes read and written by an executable to the least. The output contains the count of operations (opens, reads, and writes), the totals and averages for the number of bytes read and written.

  • diff --git a/testsuite/systemtap.examples/index.txt b/testsuite/systemtap.examples/index.txt index fdcd3b31..e31baf4f 100644 --- a/testsuite/systemtap.examples/index.txt +++ b/testsuite/systemtap.examples/index.txt @@ -52,6 +52,19 @@ keywords: io backtrace list from most common to least common backtrace. +io/ioblktime.stp - Average Time Block IO Requests Spend in Queue +keywords: io + + The ioblktime.stp script tracks the amount of time that each block IO + requests spend waiting for completion. The script compute the average + time waiting time for block IO per device and prints list every 10 + seconds. In some cases there can be too many oustanding block IO + operations and the script may exceed the default number of + MAXMAPENTRIES allowed. In this case the allowed number can be + increased with "-DMAXMAPENTRIES=10000" option on the stap command + line. + + io/iostats.stp - List Executables Reading and Writing the Most Data keywords: io profiling diff --git a/testsuite/systemtap.examples/io/ioblktime.meta b/testsuite/systemtap.examples/io/ioblktime.meta new file mode 100644 index 00000000..18a8b168 --- /dev/null +++ b/testsuite/systemtap.examples/io/ioblktime.meta @@ -0,0 +1,13 @@ +title: Average Time Block IO Requests Spend in Queue +name: ioblktime.stp +version: 1.0 +author: William Cohen +keywords: io +subsystem: kernel +status: production +exit: user-controlled +output: sorted-list +scope: system-wide +description: The ioblktime.stp script tracks the amount of time that each block IO requests spend waiting for completion. The script computes the average time waiting time for block IO per device and prints list every 10 seconds. In some cases there can be too many oustanding block IO operations and the script may exceed the default number of MAXMAPENTRIES allowed. In this case the allowed number can be increased with "-DMAXMAPENTRIES=10000" option on the stap command line. +test_check: stap -p4 ioblktime.stp +test_installcheck: stap ioblktime.stp -c "sleep 1" diff --git a/testsuite/systemtap.examples/io/ioblktime.stp b/testsuite/systemtap.examples/io/ioblktime.stp new file mode 100755 index 00000000..5ff59cf7 --- /dev/null +++ b/testsuite/systemtap.examples/io/ioblktime.stp @@ -0,0 +1,29 @@ +#! /usr/bin/env stap + +global req_time, etimes + +probe ioblock.request +{ + req_time[$bio] = gettimeofday_us() +} + +probe ioblock.end +{ + t = gettimeofday_us() + s = req_time[$bio] + delete req_time[$bio] + if (s) { + etimes[devname, bio_rw_str(rw)] <<< t - s + } +} + +probe timer.s(10), end { + printf("\033[2J\033[1;1H") /* clear screen */ + printf("%10s %3s %10s %10s %10s\n", + "device", "rw", "total (us)", "count", "avg (us)") + foreach ([dev,rw] in etimes - limit 20) { + printf("%10s %3s %10d %10d %10d\n", dev, rw, + @sum(etimes[dev,rw]), @count(etimes[dev,rw]), @avg(etimes[dev,rw])) + } + delete etimes +} diff --git a/testsuite/systemtap.examples/keyword-index.html b/testsuite/systemtap.examples/keyword-index.html index b3ea0943..75768709 100644 --- a/testsuite/systemtap.examples/keyword-index.html +++ b/testsuite/systemtap.examples/keyword-index.html @@ -102,6 +102,9 @@ keywords: INTERRUPT io/io_submit.stp - Tally Reschedule Reason During AIO io_submit Call
    keywords: IO BACKTRACE

    When a reschedule occurs during an AIO io_submit call, accumulate the traceback in a histogram. When the script exits prints out a sorted list from most common to least common backtrace.

    +
  • io/ioblktime.stp - Average Time Block IO Requests Spend in Queue
    +keywords: IO
    +

    The ioblktime.stp script tracks the amount of time that each block IO requests spend waiting for completion. The script compute the average time waiting time for block IO per device and prints list every 10 seconds. In some cases there can be too many oustanding block IO operations and the script may exceed the default number of MAXMAPENTRIES allowed. In this case the allowed number can be increased with "-DMAXMAPENTRIES=10000" option on the stap command line.

  • io/iostats.stp - List Executables Reading and Writing the Most Data
    keywords: IO PROFILING

    The iostat.stp script measures the amount of data successfully read and written by all the executables on the system. The output is sorted from most greatest sum of bytes read and written by an executable to the least. The output contains the count of operations (opens, reads, and writes), the totals and averages for the number of bytes read and written.

  • diff --git a/testsuite/systemtap.examples/keyword-index.txt b/testsuite/systemtap.examples/keyword-index.txt index 5f382e75..d3a9617f 100644 --- a/testsuite/systemtap.examples/keyword-index.txt +++ b/testsuite/systemtap.examples/keyword-index.txt @@ -125,6 +125,19 @@ keywords: io backtrace list from most common to least common backtrace. +io/ioblktime.stp - Average Time Block IO Requests Spend in Queue +keywords: io + + The ioblktime.stp script tracks the amount of time that each block IO + requests spend waiting for completion. The script compute the average + time waiting time for block IO per device and prints list every 10 + seconds. In some cases there can be too many oustanding block IO + operations and the script may exceed the default number of + MAXMAPENTRIES allowed. In this case the allowed number can be + increased with "-DMAXMAPENTRIES=10000" option on the stap command + line. + + io/iostats.stp - List Executables Reading and Writing the Most Data keywords: io profiling -- cgit From 52064a4bd37f8d81e1f488fe9d32fe6ccee63bd7 Mon Sep 17 00:00:00 2001 From: Breno Leitao Date: Fri, 20 Mar 2009 11:40:04 -0400 Subject: Added functions to grab IP source and destination from a socket, and functions to grab TCP source and destination port from a socket. Also, used this function inside some TCP probe functions, as recvmsg, to provide a richer set of fields. --- testsuite/systemtap.examples/network/tcp.stp | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 testsuite/systemtap.examples/network/tcp.stp (limited to 'testsuite/systemtap.examples') diff --git a/testsuite/systemtap.examples/network/tcp.stp b/testsuite/systemtap.examples/network/tcp.stp new file mode 100644 index 00000000..ebe72a1c --- /dev/null +++ b/testsuite/systemtap.examples/network/tcp.stp @@ -0,0 +1,11 @@ +//A simple TCP tapset example + +probe begin { + printf("Expected IP 7.91.205.21 .... %s\n", ip_ntop(123456789)) + printf("Expected IP 58.222.104.177 .... %s\n", ip_ntop(987654321)) + printf("Expected IP 9.3.191.111 ... %s\n", ip_ntop(151240559)) +} + +probe tcp.recvmsg { + printf("received a message from %s on port %d from port %d\n", saddr, dport, sport) +} -- cgit