From 1cc8a4c78bff79ea8b60e916e5cd01571b469b03 Mon Sep 17 00:00:00 2001 From: William Cohen Date: Fri, 30 Jan 2009 12:33:14 -0500 Subject: Move the scf.stp example from systemtap.samples to systemtap.examples. --- testsuite/systemtap.examples/index.html | 3 +++ testsuite/systemtap.examples/index.txt | 10 ++++++++++ testsuite/systemtap.examples/interrupt/scf.meta | 13 +++++++++++++ testsuite/systemtap.examples/interrupt/scf.stp | 21 +++++++++++++++++++++ testsuite/systemtap.examples/keyword-index.html | 11 ++++++++++- testsuite/systemtap.examples/keyword-index.txt | 22 ++++++++++++++++++++++ 6 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 testsuite/systemtap.examples/interrupt/scf.meta create mode 100644 testsuite/systemtap.examples/interrupt/scf.stp (limited to 'testsuite/systemtap.examples') diff --git a/testsuite/systemtap.examples/index.html b/testsuite/systemtap.examples/index.html index b67aa226..87a5a50e 100644 --- a/testsuite/systemtap.examples/index.html +++ b/testsuite/systemtap.examples/index.html @@ -49,6 +49,9 @@ keywords: SIMPLE
  • general/para-callgraph.stp - Callgraph tracing with arguments
    keywords: TRACE CALLGRAPH

    Print a timed per-thread callgraph, complete with function parameters and return values. The first parameter names the function probe points to trace. The optional second parameter names the probe points for trigger functions, which acts to enable tracing for only those functions that occur while the current thread is nested within the trigger.

  • +
  • interrupt/scf.stp - Tally Backtraces for Inter-Processor Interrupt (IPI)
    +keywords: INTERRUPT BACKTRACE
    +

    The Linux kernel function smp_call_function causes expensive inter-processor interrupts (IPIs). The scf.stp script tallies the processes and backtraces causing the interprocessor interrupts to identify the cause of the expensive IPI. On exit the script prints the tallies in descending frequency.

  • io/disktop.stp - Summarize Disk Read/Write Traffic
    keywords: DISK

    Get the status of reading/writing disk every 5 seconds, output top ten entries during that period.

  • diff --git a/testsuite/systemtap.examples/index.txt b/testsuite/systemtap.examples/index.txt index f45f4c43..5ffc341a 100644 --- a/testsuite/systemtap.examples/index.txt +++ b/testsuite/systemtap.examples/index.txt @@ -27,6 +27,16 @@ keywords: trace callgraph the trigger. +interrupt/scf.stp - Tally Backtraces for Inter-Processor Interrupt (IPI) +keywords: interrupt backtrace + + The Linux kernel function smp_call_function causes expensive + inter-processor interrupts (IPIs). The scf.stp script tallies the + processes and backtraces causing the interprocessor interrupts to + identify the cause of the expensive IPI. On exit the script prints + the tallies in descending frequency. + + io/disktop.stp - Summarize Disk Read/Write Traffic keywords: disk diff --git a/testsuite/systemtap.examples/interrupt/scf.meta b/testsuite/systemtap.examples/interrupt/scf.meta new file mode 100644 index 00000000..1d6ec3d8 --- /dev/null +++ b/testsuite/systemtap.examples/interrupt/scf.meta @@ -0,0 +1,13 @@ +title: Tally Backtraces for Inter-Processor Interrupt (IPI) +name: scf.stp +version: 1.0 +author: William Cohen +keywords: interrupt backtrace +subsystem: kernel +status: production +exit: user-controlled +output: sorted-list +scope: system-wide +description: The Linux kernel function smp_call_function causes expensive inter-processor interrupts (IPIs). The scf.stp script tallies the processes and backtraces causing the interprocessor interrupts to identify the cause of the expensive IPI. On exit the script prints the tallies in descending frequency. +test_check: stap -p4 scf.stp +test_installcheck: stap scf.stp -c "sleep 1" diff --git a/testsuite/systemtap.examples/interrupt/scf.stp b/testsuite/systemtap.examples/interrupt/scf.stp new file mode 100644 index 00000000..f84c2494 --- /dev/null +++ b/testsuite/systemtap.examples/interrupt/scf.stp @@ -0,0 +1,21 @@ +#! /usr/bin/env stap +# scf.stp +# A reimplementation of user script:smp_call_function example given at OLS 2005 +# in the current language. + +global traces + +probe begin { print("Starting probe, type control-c to stop.\n") } + +probe kernel.function("smp_call_function") +{ + traces[pid(), pexecname(), backtrace()] ++ +} + +probe end { + foreach ([pid, name, stack] in traces-) { # sort by frequency encountered + printf ("traces[%d,%s,\n", pid, name) + print_stack (stack) + printf ("] = %d\n", traces[pid, name, stack]); + } +} diff --git a/testsuite/systemtap.examples/keyword-index.html b/testsuite/systemtap.examples/keyword-index.html index 34dedc9a..9ff68c8d 100644 --- a/testsuite/systemtap.examples/keyword-index.html +++ b/testsuite/systemtap.examples/keyword-index.html @@ -39,9 +39,12 @@

    Examples by Keyword

    -

    BACKTRACE CALLGRAPH CPU DISK FUNCTIONS FUTEX GRAPH IO LOCKING NETWORK PER-PROCESS PROFILING READ SCHEDULER SIGNALS SIMPLE SLEEP SOCKET SYSCALL TIME TRACE TRAFFIC USE WAIT4 WRITE

    +

    BACKTRACE CALLGRAPH CPU DISK FUNCTIONS FUTEX GRAPH INTERRUPT IO LOCKING NETWORK PER-PROCESS PROFILING READ SCHEDULER SIGNALS SIMPLE SLEEP SOCKET SYSCALL TIME TRACE TRAFFIC USE WAIT4 WRITE

    BACKTRACE

    +

    INTERRUPT

    +

    IO