aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/scripts/perl/Perf-Trace-Util/lib/Perf/Trace
diff options
context:
space:
mode:
authorTom Zanussi <tzanussi@gmail.com>2010-04-01 23:59:23 -0500
committerIngo Molnar <mingo@elte.hu>2010-04-14 11:56:08 +0200
commit47902f3611b392209e2a412bf7ec02dca95e666d (patch)
tree9fa26305e87a6f6354b3461067967b908a1d0a08 /tools/perf/scripts/perl/Perf-Trace-Util/lib/Perf/Trace
parentperf: Convert perf header build_ids into build_id events (diff)
downloadlinux-dev-47902f3611b392209e2a412bf7ec02dca95e666d.tar.xz
linux-dev-47902f3611b392209e2a412bf7ec02dca95e666d.zip
perf trace/scripting: Add rwtop and sctop scripts
A couple of scripts, one in Python and the other in Perl, that demonstrate 'live mode' tracing. For each, the output of the perf event stream is fed continuously to the script, which continuously aggregates the data and reports the current results every 3 seconds, or at the optionally specified interval. After the current results are displayed, the aggregations are cleared and the cycle begins anew. To run the scripts, simply pipe the output of the 'perf trace record' step as input to the corresponding 'perf trace report' step, using '-' as the filename to -o and -i: $ perf trace record sctop -o - | perf trace report sctop -i - Also adds clear_term() utility functions to the Util.pm and Util.py utility modules, for use by any script to clear the screen. Signed-off-by: Tom Zanussi <tzanussi@gmail.com> Acked-by: Thomas Gleixner <tglx@linutronix.de> Cc: fweisbec@gmail.com Cc: rostedt@goodmis.org Cc: k-keiichi@bx.jp.nec.com Cc: acme@ghostprotocols.net LKML-Reference: <1270184365-8281-10-git-send-email-tzanussi@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/scripts/perl/Perf-Trace-Util/lib/Perf/Trace')
-rw-r--r--tools/perf/scripts/perl/Perf-Trace-Util/lib/Perf/Trace/Util.pm6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/perf/scripts/perl/Perf-Trace-Util/lib/Perf/Trace/Util.pm b/tools/perf/scripts/perl/Perf-Trace-Util/lib/Perf/Trace/Util.pm
index f869c48dc9b0..d94b40c8ac85 100644
--- a/tools/perf/scripts/perl/Perf-Trace-Util/lib/Perf/Trace/Util.pm
+++ b/tools/perf/scripts/perl/Perf-Trace-Util/lib/Perf/Trace/Util.pm
@@ -15,6 +15,7 @@ our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
our @EXPORT = qw(
avg nsecs nsecs_secs nsecs_nsecs nsecs_usecs print_nsecs
+clear_term
);
our $VERSION = '0.01';
@@ -55,6 +56,11 @@ sub nsecs_str {
return $str;
}
+sub clear_term
+{
+ print "\x1b[H\x1b[2J";
+}
+
1;
__END__
=head1 NAME