From 457debd23eb3eef17d24ecf3534891ec640684f6 Mon Sep 17 00:00:00 2001 From: David Smith Date: Wed, 11 Mar 2009 16:07:39 -0500 Subject: Make printf tests fail when stap fails. 2009-03-11 David Smith * systemtap.printf/end1.exp: The test fails when stap fails. * systemtap.printf/end1b.exp: Ditto. * systemtap.printf/mixed_out.exp: Ditto. * systemtap.printf/mixed_outb.exp: Ditto. * systemtap.printf/out1.exp: Ditto. * systemtap.printf/out1b.exp: Ditto. * systemtap.printf/out2.exp: Ditto. * systemtap.printf/out2b.exp: Ditto. * systemtap.printf/out3.exp: Ditto. * systemtap.printf/out3b.exp: Ditto. --- testsuite/systemtap.printf/end1.exp | 6 +++--- testsuite/systemtap.printf/end1b.exp | 2 +- testsuite/systemtap.printf/mixed_out.exp | 4 ++-- testsuite/systemtap.printf/mixed_outb.exp | 2 +- testsuite/systemtap.printf/out1.exp | 2 +- testsuite/systemtap.printf/out1b.exp | 2 +- testsuite/systemtap.printf/out2.exp | 2 +- testsuite/systemtap.printf/out2b.exp | 2 +- testsuite/systemtap.printf/out3.exp | 2 +- testsuite/systemtap.printf/out3b.exp | 2 +- 10 files changed, 13 insertions(+), 13 deletions(-) (limited to 'testsuite') diff --git a/testsuite/systemtap.printf/end1.exp b/testsuite/systemtap.printf/end1.exp index 0a4dd32e..e4f164f5 100644 --- a/testsuite/systemtap.printf/end1.exp +++ b/testsuite/systemtap.printf/end1.exp @@ -11,15 +11,15 @@ if {[catch {exec mktemp -t staptestXXXXX} tmpfile]} { } if {[catch {exec stap -o $tmpfile $tpath} res]} { - untested $TEST_NAME - puts "$res" + fail $TEST_NAME + puts "stap failed: $res" catch {exec rm -f $tmpfile} return } if {[catch {exec cmp $tmpfile $srcdir/$subdir/large_output} res]} { - fail $TEST_NAME puts "$res" + fail $TEST_NAME catch {exec rm -f $tmpfile} return } diff --git a/testsuite/systemtap.printf/end1b.exp b/testsuite/systemtap.printf/end1b.exp index 1764a383..08cfa648 100644 --- a/testsuite/systemtap.printf/end1b.exp +++ b/testsuite/systemtap.printf/end1b.exp @@ -16,8 +16,8 @@ if {[catch {exec mktemp -t staptestXXXXX} tmpfile]} { } if {[catch {exec stap -b -o $tmpfile $test} res]} { - untested $TEST_NAME puts "stap failed: $res" + fail $TEST_NAME as_root "/bin/rm -f [glob ${tmpfile}*]" return } diff --git a/testsuite/systemtap.printf/mixed_out.exp b/testsuite/systemtap.printf/mixed_out.exp index 093a8ca1..d73a55a6 100644 --- a/testsuite/systemtap.printf/mixed_out.exp +++ b/testsuite/systemtap.printf/mixed_out.exp @@ -11,8 +11,8 @@ if {[catch {exec mktemp -t staptestXXXXX} tmpfile]} { } if {[catch {exec stap -DMAXACTION=100000 -o $tmpfile $tpath} res]} { - untested $TEST_NAME - puts "$res" + fail $TEST_NAME + puts "stap failed: $res" catch {exec rm -f $tmpfile} return } diff --git a/testsuite/systemtap.printf/mixed_outb.exp b/testsuite/systemtap.printf/mixed_outb.exp index cbf7b920..30c0c92f 100644 --- a/testsuite/systemtap.printf/mixed_outb.exp +++ b/testsuite/systemtap.printf/mixed_outb.exp @@ -16,7 +16,7 @@ if {[catch {exec mktemp -t staptestXXXXX} tmpfile]} { } if {[catch {exec stap -DMAXACTION=100000 -b -o $tmpfile $test} res]} { - untested $TEST_NAME + fail $TEST_NAME puts "stap failed: $res" as_root "/bin/rm -f [glob ${tmpfile}*]" return diff --git a/testsuite/systemtap.printf/out1.exp b/testsuite/systemtap.printf/out1.exp index f89d39bf..d5728c0f 100644 --- a/testsuite/systemtap.printf/out1.exp +++ b/testsuite/systemtap.printf/out1.exp @@ -11,7 +11,7 @@ if {[catch {exec mktemp -t staptestXXXXX} tmpfile]} { } if {[catch {exec stap -o $tmpfile $tpath} res]} { - untested $TEST_NAME + fail $TEST_NAME puts "$res" catch {exec rm -f $tmpfile} return diff --git a/testsuite/systemtap.printf/out1b.exp b/testsuite/systemtap.printf/out1b.exp index 378ea5cd..2f702a2f 100644 --- a/testsuite/systemtap.printf/out1b.exp +++ b/testsuite/systemtap.printf/out1b.exp @@ -16,7 +16,7 @@ if {[catch {exec mktemp -t staptestXXXXX} tmpfile]} { } if {[catch {exec stap -b -o $tmpfile $test} res]} { - untested $TEST_NAME + fail $TEST_NAME puts "stap failed: $res" as_root "/bin/rm -f [glob ${tmpfile}*]" return diff --git a/testsuite/systemtap.printf/out2.exp b/testsuite/systemtap.printf/out2.exp index 7b312b11..dd96f394 100644 --- a/testsuite/systemtap.printf/out2.exp +++ b/testsuite/systemtap.printf/out2.exp @@ -11,7 +11,7 @@ if {[catch {exec mktemp -t staptestXXXXX} tmpfile]} { } if {[catch {exec stap -o $tmpfile $tpath} res]} { - untested $TEST_NAME + fail $TEST_NAME puts "$res" catch {exec rm -f $tmpfile} return diff --git a/testsuite/systemtap.printf/out2b.exp b/testsuite/systemtap.printf/out2b.exp index f7fdef6b..0b56c940 100644 --- a/testsuite/systemtap.printf/out2b.exp +++ b/testsuite/systemtap.printf/out2b.exp @@ -16,7 +16,7 @@ if {[catch {exec mktemp -t staptestXXXXX} tmpfile]} { } if {[catch {exec stap -b -o $tmpfile $test} res]} { - untested $TEST_NAME + fail $TEST_NAME puts "stap failed: $res" as_root "/bin/rm -f [glob ${tmpfile}*]" return diff --git a/testsuite/systemtap.printf/out3.exp b/testsuite/systemtap.printf/out3.exp index c16db391..96ca2bc5 100644 --- a/testsuite/systemtap.printf/out3.exp +++ b/testsuite/systemtap.printf/out3.exp @@ -11,7 +11,7 @@ if {[catch {exec mktemp -t staptestXXXXX} tmpfile]} { } if {[catch {exec stap -DMAXACTION=100000 -o $tmpfile $tpath} res]} { - untested $TEST_NAME + fail $TEST_NAME puts "$res" catch {exec rm -f $tmpfile} return diff --git a/testsuite/systemtap.printf/out3b.exp b/testsuite/systemtap.printf/out3b.exp index 16ee2182..c42d03b7 100644 --- a/testsuite/systemtap.printf/out3b.exp +++ b/testsuite/systemtap.printf/out3b.exp @@ -16,7 +16,7 @@ if {[catch {exec mktemp -t staptestXXXXX} tmpfile]} { } if {[catch {exec stap -DMAXACTION=100000 -b -o $tmpfile $test} res]} { - untested $TEST_NAME + fail $TEST_NAME puts "stap failed: $res" as_root "/bin/rm -f [glob ${tmpfile}*]" return -- cgit From e6b653c8c2e63d54a3b33036130a6d8272680f54 Mon Sep 17 00:00:00 2001 From: William Cohen Date: Fri, 19 Jun 2009 11:33:29 -0400 Subject: Add froktracker.stp example. --- testsuite/systemtap.examples/index.html | 3 +++ testsuite/systemtap.examples/index.txt | 8 ++++++++ testsuite/systemtap.examples/keyword-index.html | 6 ++++++ testsuite/systemtap.examples/keyword-index.txt | 16 +++++++++++++++ .../systemtap.examples/process/forktracker.meta | 13 ++++++++++++ .../systemtap.examples/process/forktracker.stp | 23 ++++++++++++++++++++++ 6 files changed, 69 insertions(+) create mode 100644 testsuite/systemtap.examples/process/forktracker.meta create mode 100644 testsuite/systemtap.examples/process/forktracker.stp (limited to 'testsuite') diff --git a/testsuite/systemtap.examples/index.html b/testsuite/systemtap.examples/index.html index a5fddb4e..c485713c 100644 --- a/testsuite/systemtap.examples/index.html +++ b/testsuite/systemtap.examples/index.html @@ -112,6 +112,9 @@ keywords: NETWORK process/errsnoop.stp - tabulate system call errors
keywords: PROCESS SYSCALL

The script prints a periodic tabular report about failing system calls, by process and by syscall failure. The first optional argument specifies the reporting interval (in seconds, default 5); the second optional argument gives a screen height (number of lines in the report, default 20).

+
  • process/forktracker.stp - Trace Creation of Processes
    +keywords: PROCESS SCHEDULER
    +

    The forktracker.stp script prints out a time-stamped entry showing each fork and exec operation on the machine. This can be useful for determine what process is creating a flurry of short-lived processes.

  • process/futexes.stp - System-Wide Futex Contention
    keywords: SYSCALL LOCKING FUTEX

    The script watches the futex syscall on the system. On exit the futexes address, the number of contentions, and the average time for each contention on the futex are printed from lowest pid number to highest.

  • diff --git a/testsuite/systemtap.examples/index.txt b/testsuite/systemtap.examples/index.txt index 95e81435..caf1a5ff 100644 --- a/testsuite/systemtap.examples/index.txt +++ b/testsuite/systemtap.examples/index.txt @@ -224,6 +224,14 @@ keywords: process syscall in the report, default 20). +process/forktracker.stp - Trace Creation of Processes +keywords: process scheduler + + The forktracker.stp script prints out a time-stamped entry showing + each fork and exec operation on the machine. This can be useful for + determine what process is creating a flurry of short-lived processes. + + process/futexes.stp - System-Wide Futex Contention keywords: syscall locking futex diff --git a/testsuite/systemtap.examples/keyword-index.html b/testsuite/systemtap.examples/keyword-index.html index e144337c..9852c992 100644 --- a/testsuite/systemtap.examples/keyword-index.html +++ b/testsuite/systemtap.examples/keyword-index.html @@ -210,6 +210,9 @@ keywords: NETWORK process/errsnoop.stp - tabulate system call errors
    keywords: PROCESS SYSCALL

    The script prints a periodic tabular report about failing system calls, by process and by syscall failure. The first optional argument specifies the reporting interval (in seconds, default 5); the second optional argument gives a screen height (number of lines in the report, default 20).

    +
  • process/forktracker.stp - Trace Creation of Processes
    +keywords: PROCESS SCHEDULER
    +

    The forktracker.stp script prints out a time-stamped entry showing each fork and exec operation on the machine. This can be useful for determine what process is creating a flurry of short-lived processes.

  • process/schedtimes.stp - Track Time Processes Spend in Various States using Tracepoints
    keywords: PROCESS SCHEDULER TIME TRACEPOINT

    The schedtimes.stp script instruments the scheduler to track the amount of time that each process spends running, sleeping, queued, and waiting for io. On exit the script prints out the accumulated time for each state of processes observed. Optionally, this script can be used with the '-c' or '-x' options to focus on a specific PID.

  • @@ -243,6 +246,9 @@ keywords: SYSCALL SCHEDULER
      +
    • process/forktracker.stp - Trace Creation of Processes
      +keywords: PROCESS SCHEDULER
      +

      The forktracker.stp script prints out a time-stamped entry showing each fork and exec operation on the machine. This can be useful for determine what process is creating a flurry of short-lived processes.

    • process/schedtimes.stp - Track Time Processes Spend in Various States using Tracepoints
      keywords: PROCESS SCHEDULER TIME TRACEPOINT

      The schedtimes.stp script instruments the scheduler to track the amount of time that each process spends running, sleeping, queued, and waiting for io. On exit the script prints out the accumulated time for each state of processes observed. Optionally, this script can be used with the '-c' or '-x' options to focus on a specific PID.

    • diff --git a/testsuite/systemtap.examples/keyword-index.txt b/testsuite/systemtap.examples/keyword-index.txt index 8305e208..4778afc7 100644 --- a/testsuite/systemtap.examples/keyword-index.txt +++ b/testsuite/systemtap.examples/keyword-index.txt @@ -390,6 +390,14 @@ keywords: process syscall in the report, default 20). +process/forktracker.stp - Trace Creation of Processes +keywords: process scheduler + + The forktracker.stp script prints out a time-stamped entry showing + each fork and exec operation on the machine. This can be useful for + determine what process is creating a flurry of short-lived processes. + + process/schedtimes.stp - Track Time Processes Spend in Various States using Tracepoints keywords: process scheduler time tracepoint @@ -480,6 +488,14 @@ keywords: syscall read write time io = SCHEDULER = +process/forktracker.stp - Trace Creation of Processes +keywords: process scheduler + + The forktracker.stp script prints out a time-stamped entry showing + each fork and exec operation on the machine. This can be useful for + determine what process is creating a flurry of short-lived processes. + + process/schedtimes.stp - Track Time Processes Spend in Various States using Tracepoints keywords: process scheduler time tracepoint diff --git a/testsuite/systemtap.examples/process/forktracker.meta b/testsuite/systemtap.examples/process/forktracker.meta new file mode 100644 index 00000000..f3ef3709 --- /dev/null +++ b/testsuite/systemtap.examples/process/forktracker.meta @@ -0,0 +1,13 @@ +title: Trace Creation of Processes +name: forktracker.stp +version: 0.1 +author: Phil Muldoon at Red Hat +keywords: process scheduler +subsystem: scheduler +status: production +exit: user-controlled +output: trace +scope: system-wide +description: The forktracker.stp script prints out a time-stamped entry showing each fork and exec operation on the machine. This can be useful for determine what process is creating a flurry of short-lived processes. +test_check: stap -p4 forktracker.stp +test_installcheck: stap forkracker.stp -c "sleep 1" diff --git a/testsuite/systemtap.examples/process/forktracker.stp b/testsuite/systemtap.examples/process/forktracker.stp new file mode 100644 index 00000000..525aa0a5 --- /dev/null +++ b/testsuite/systemtap.examples/process/forktracker.stp @@ -0,0 +1,23 @@ +#! /usr/bin/env stap +# +# This is a stap script to monitor process creations (fork(), exec()'s). +# Based off of stap script found: http://picobot.org/wordpress/?p=27 +# With some minor modifications (i.e. timestamping) +# +# Usage: stap forktracker.stp +# +# Sample output: +# +# timestamp: process_name (pid) new_pid +# +# Version 0.1 + +probe kprocess.create { + printf("%-25s: %s (%d) created %d\n", + ctime(gettimeofday_s()), execname(), pid(), new_pid) +} + +probe kprocess.exec { + printf("%-25s: %s (%d) is exec'ing %s\n", + ctime(gettimeofday_s()), execname(), pid(), filename) +} -- cgit From 0c98234c86877cfea3df762dc8627b3f05c38e75 Mon Sep 17 00:00:00 2001 From: William Cohen Date: Fri, 19 Jun 2009 11:38:28 -0400 Subject: Make examples-index-gen.pl executable. --- testsuite/systemtap.examples/examples-index-gen.pl | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 testsuite/systemtap.examples/examples-index-gen.pl (limited to 'testsuite') diff --git a/testsuite/systemtap.examples/examples-index-gen.pl b/testsuite/systemtap.examples/examples-index-gen.pl old mode 100644 new mode 100755 -- cgit From e94030f6ab5c9022e69c3b362d9fe3639718f06d Mon Sep 17 00:00:00 2001 From: William Cohen Date: Fri, 19 Jun 2009 11:47:53 -0400 Subject: Make forktracker.stp example executable. --- testsuite/systemtap.examples/process/forktracker.stp | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 testsuite/systemtap.examples/process/forktracker.stp (limited to 'testsuite') diff --git a/testsuite/systemtap.examples/process/forktracker.stp b/testsuite/systemtap.examples/process/forktracker.stp old mode 100644 new mode 100755 -- cgit From 92b1a0c0ead841e781783e8f94cf22fa4694fc35 Mon Sep 17 00:00:00 2001 From: William Cohen Date: Fri, 19 Jun 2009 12:07:19 -0400 Subject: Revert "Make examples-index-gen.pl executable." This reverts commit 0c98234c86877cfea3df762dc8627b3f05c38e75. --- testsuite/systemtap.examples/examples-index-gen.pl | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 testsuite/systemtap.examples/examples-index-gen.pl (limited to 'testsuite') diff --git a/testsuite/systemtap.examples/examples-index-gen.pl b/testsuite/systemtap.examples/examples-index-gen.pl old mode 100755 new mode 100644 -- cgit