diff options
Diffstat (limited to 'testsuite/systemtap.samples')
-rw-r--r-- | testsuite/systemtap.samples/kmalloc-stacks.stp | 35 | ||||
-rwxr-xr-x | testsuite/systemtap.samples/kmalloc-top | 97 | ||||
-rw-r--r-- | testsuite/systemtap.samples/poll_map.exp | 14 | ||||
-rwxr-xr-x | testsuite/systemtap.samples/poll_map.stp | 33 |
4 files changed, 0 insertions, 179 deletions
diff --git a/testsuite/systemtap.samples/kmalloc-stacks.stp b/testsuite/systemtap.samples/kmalloc-stacks.stp deleted file mode 100644 index 25a23f2d..00000000 --- a/testsuite/systemtap.samples/kmalloc-stacks.stp +++ /dev/null @@ -1,35 +0,0 @@ -global kmalloc_stack - -function reset_maxaction () %{ - if (CONTEXT && CONTEXT->actioncount) - CONTEXT->actioncount=0; -%} - -function write_output() -{ - foreach (stack in kmalloc_stack) { - log("<hashkey>"); - print_stack(stack); - log("</hashkey>"); - print("<hashval>"); - print(sprint(kmalloc_stack[stack])); - log("</hashval>"); - reset_maxaction(); - } -} - -probe timer.jiffies(5000) -{ - write_output(); - delete kmalloc_stack; -} - -probe kernel.function("__kmalloc") -{ - kmalloc_stack[backtrace()]++; -} - -probe end -{ - write_output(); -} diff --git a/testsuite/systemtap.samples/kmalloc-top b/testsuite/systemtap.samples/kmalloc-top deleted file mode 100755 index 42a6d152..00000000 --- a/testsuite/systemtap.samples/kmalloc-top +++ /dev/null @@ -1,97 +0,0 @@ -#!/usr/bin/perl -# -# This script accumulates the execution paths of all calls to kmalloc -# in the kernel. On Ctrl-C, it sorts, filters and displays them on -# stdout. -# -# The -e (exclude) option can be used to specify a comma-separated list -# - any stack with contents matching any of the items in the list will -# be excluded from the output. -# -# The -m (min) option can be used to specify the minimum number of -# occurrences a stack needs to be included in the output. -# -# Usage: ./kmalloc-top [-m min] [-i exclude list] -# Ctrl-c - -use Getopt::Std; - -my $kmalloc_stacks; -my $total_kmallocs; -my $sorted_stacks; -my $min_count = 1; -my $exclude; - -$SIG{INT} = \&sigint_handler; - -getopts('e:m:'); - -if ($opt_e) { - $exclude = join('|', split(/,/, $opt_e)); - print "Will exclude stacks containing: $exclude\n"; -} - -if ($opt_m) { - $min_count = $opt_n; -} -print "Will print stacks with counts >= $min_count.\n"; -print STDERR "Press Ctrl-C to stop.\n"; - -open STREAM, "stap -g kmalloc-stacks.stp |" or die "Couldn't get output stream $!"; - -while (<STREAM>) { - if (/<hashval>(.*?)<\/hashval>/) { - update_hash($key, $1); - $key = ""; - } elsif ($_ !~ (/<hashkey>|<\/hashkey>/)) { - $key .= $_; - } -} - -$num_keys_before_filtering = scalar keys %kmalloc_stacks; -filter_stacks(); -$num_keys_after_filtering = scalar keys %kmalloc_stacks; -sort_stacks(); -summarize(); -exit(); - -sub update_hash -{ - my($key, $val) = @_; - $kmalloc_stacks{$key} += $val; - $total_kmallocs += $val; -} - -sub filter_stacks -{ - while (($stack, $count) = each %kmalloc_stacks) { - if ($count < $min_count) { - delete $kmalloc_stacks{$stack}; - } elsif ($exclude && $stack =~ /$exclude/) { - delete $kmalloc_stacks{$stack}; - } - } -} - -sub sort_stacks -{ - @sorted_stacks = sort { $kmalloc_stacks{$b} <=> $kmalloc_stacks{$a} } keys %kmalloc_stacks; -} - -sub summarize { - print "\n"; - foreach $stack(@sorted_stacks) { - print "This path seen $kmalloc_stacks{$stack} times:\n$stack\n"; - } - - print "Total kmallocs (before filtering): $total_kmallocs\n"; - print "Num stacks before filtering: $num_keys_before_filtering\n"; - print "Num stacks after filtering: $num_keys_after_filtering\n"; - - close(STREAM); -} - -sub sigint_handler -{ - system("pkill kmalloc-stacks"); -} diff --git a/testsuite/systemtap.samples/poll_map.exp b/testsuite/systemtap.samples/poll_map.exp deleted file mode 100644 index 5ade48e6..00000000 --- a/testsuite/systemtap.samples/poll_map.exp +++ /dev/null @@ -1,14 +0,0 @@ -set test "poll_map" -if {![installtest_p]} { untested $test; return } - -spawn stap -g $srcdir/$subdir/poll_map.stp -set ok 0 -expect { - -timeout 400 - -ex "SUCCESS" { incr ok } - timeout { fail "$test (timeout)" } - eof { } -} -close -wait -if {$ok == 1} { pass "$test ($ok)" } { fail "$test ($ok)" } diff --git a/testsuite/systemtap.samples/poll_map.stp b/testsuite/systemtap.samples/poll_map.stp deleted file mode 100755 index cd39b433..00000000 --- a/testsuite/systemtap.samples/poll_map.stp +++ /dev/null @@ -1,33 +0,0 @@ -#! stap - -# test that polling loops do not exit when conflicts happen -# see PR 1379 - -global called, num_polls - -probe kernel.function( "sys_*" ).call { - called[execname(),probefunc()]++ -} - -probe timer.ms(1000) -{ - print("\n\n") - num_to_do = 10 - foreach ([n,f] in called-) { - printf("%s called %s\t%d times\n", n, f, called[n,f]) - num_to_do-- - if (num_to_do <= 0) - break - } - delete called - num_polls++ - if (num_polls > 30) - exit() -} - -probe end { - if (num_polls <= 30) - print ("FAIL\n") - else - print ("SUCCESS\n") -} |