From 3b735623b8c878f52e0945074b4be4cdcd0bc257 Mon Sep 17 00:00:00 2001 From: Key Meyer Date: Mon, 27 Apr 2009 18:36:32 -0400 Subject: traceio sample: tolerate more than a few hundred processes ... rather than exiting with MAXACTIONS exceeded --- testsuite/systemtap.examples/io/traceio.stp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'testsuite/systemtap.examples') diff --git a/testsuite/systemtap.examples/io/traceio.stp b/testsuite/systemtap.examples/io/traceio.stp index 9e2deec6..a5d79fde 100755 --- a/testsuite/systemtap.examples/io/traceio.stp +++ b/testsuite/systemtap.examples/io/traceio.stp @@ -10,22 +10,20 @@ global reads, writes, total_io probe vfs.read.return { - reads[execname()] += $return + reads[pid(),execname()] += $return + total_io[pid(),execname()] += $return } probe vfs.write.return { - writes[execname()] += $return + writes[pid(),execname()] += $return + total_io[pid(),execname()] += $return } probe timer.s(1) { - foreach (p in reads) - total_io[p] += reads[p] - foreach (p in writes) - total_io[p] += writes[p] - foreach(p in total_io- limit 10) - printf("%15s r: %8d KiB w: %8d KiB\n", - p, reads[p]/1024, - writes[p]/1024) + foreach([p,e] in total_io- limit 10) + printf("%8d %15s r: %8d MiB w: %8d MiB\n", + p, e, reads[p,e]/1024/1024, + writes[p,e]/1024/1024) printf("\n") # Note we don't zero out reads, writes and total_io, # so the values are cumulative since the script started. -- cgit From 676c0d81a7d650c8c4e25a7a2495d2b19b50b2b8 Mon Sep 17 00:00:00 2001 From: Key Meyer Date: Mon, 27 Apr 2009 19:12:14 -0400 Subject: traceio: add human-readable byte-count output --- testsuite/systemtap.examples/io/traceio.stp | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'testsuite/systemtap.examples') diff --git a/testsuite/systemtap.examples/io/traceio.stp b/testsuite/systemtap.examples/io/traceio.stp index a5d79fde..875000cb 100755 --- a/testsuite/systemtap.examples/io/traceio.stp +++ b/testsuite/systemtap.examples/io/traceio.stp @@ -1,6 +1,9 @@ #! /usr/bin/env stap # traceio.stp # Copyright (C) 2007 Red Hat, Inc., Eugene Teo +# Copyright (C) 2009 Kai Meyer +# Fixed a bug that allows this to run longer +# And added the humanreadable function # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as @@ -19,11 +22,23 @@ probe vfs.write.return { total_io[pid(),execname()] += $return } +function humanreadable(bytes) { + if (bytes > 1024*1024*1024) { + return sprintf("%d GiB", bytes/1024/1024/1024) + } else if (bytes > 1024*1024) { + return sprintf("%d MiB", bytes/1024/1024) + } else if (bytes > 1024) { + return sprintf("%d KiB", bytes/1024) + } else { + return sprintf("%d B", bytes) + } +} + probe timer.s(1) { foreach([p,e] in total_io- limit 10) - printf("%8d %15s r: %8d MiB w: %8d MiB\n", - p, e, reads[p,e]/1024/1024, - writes[p,e]/1024/1024) + printf("%8d %15s r: %12s w: %12s\n", + p, e, humanreadable(reads[p,e]), + humanreadable(writes[p,e])) printf("\n") # Note we don't zero out reads, writes and total_io, # so the values are cumulative since the script started. -- cgit From ea7d087ab3866eb99c19444b237c9586e8dc9b17 Mon Sep 17 00:00:00 2001 From: Ananth N Mavinakayanahalli Date: Thu, 30 Apr 2009 17:00:38 +0530 Subject: PR10007: Avoid probing syscall entry points in the testsuite. While there, fix minor issues with the s390x syscall tapset. --- testsuite/systemtap.examples/general/para-callgraph.meta | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'testsuite/systemtap.examples') diff --git a/testsuite/systemtap.examples/general/para-callgraph.meta b/testsuite/systemtap.examples/general/para-callgraph.meta index 87af07cf..84d1c93f 100644 --- a/testsuite/systemtap.examples/general/para-callgraph.meta +++ b/testsuite/systemtap.examples/general/para-callgraph.meta @@ -3,5 +3,5 @@ name: para-callgraph.stp keywords: trace callgraph subsystem: general description: 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. -test_check: stap -p4 para-callgraph.stp kernel.function("*@fs/proc*.c") kernel.function("sys_read") -test_installcheck: stap para-callgraph.stp kernel.function("*@fs/proc*.c") kernel.function("sys_read") -c "cat /proc/sys/vm/*" +test_check: stap -p4 para-callgraph.stp kernel.function("*@fs/proc*.c") kernel.function("vfs_read") +test_installcheck: stap para-callgraph.stp kernel.function("*@fs/proc*.c") kernel.function("vfs_read") -c "cat /proc/sys/vm/*" -- cgit