aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/scripts
diff options
context:
space:
mode:
authorTom Zanussi <tzanussi@gmail.com>2010-05-10 00:46:52 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2010-05-10 18:50:54 -0400
commitc3f5fd287aa897f710f3305367a1d256c9cf3e83 (patch)
tree5b4b57633cb750923e7f427260ddd9a74c9bd56b /tools/perf/scripts
parentfefb0b94bbab858be0909a7eb5ef357e0f996a79 (diff)
perf/trace/scripting: failed-syscalls script cleanup
A couple small fixes for the failed syscalls script: - The script description says it can be restricted to a specific comm, make it so. - silence the match output in the shell script Cc: Frédéric Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> LKML-Reference: <1273466820-9330-2-git-send-email-tzanussi@gmail.com> Signed-off-by: Tom Zanussi <tzanussi@gmail.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/scripts')
-rw-r--r--tools/perf/scripts/perl/bin/failed-syscalls-report2
-rw-r--r--tools/perf/scripts/perl/failed-syscalls.pl6
2 files changed, 6 insertions, 2 deletions
diff --git a/tools/perf/scripts/perl/bin/failed-syscalls-report b/tools/perf/scripts/perl/bin/failed-syscalls-report
index f6346082a8fc..e3a5e55d54ff 100644
--- a/tools/perf/scripts/perl/bin/failed-syscalls-report
+++ b/tools/perf/scripts/perl/bin/failed-syscalls-report
@@ -2,7 +2,7 @@
2# description: system-wide failed syscalls 2# description: system-wide failed syscalls
3# args: [comm] 3# args: [comm]
4if [ $# -gt 0 ] ; then 4if [ $# -gt 0 ] ; then
5 if ! expr match "$1" "-" ; then 5 if ! expr match "$1" "-" > /dev/null ; then
6 comm=$1 6 comm=$1
7 shift 7 shift
8 fi 8 fi
diff --git a/tools/perf/scripts/perl/failed-syscalls.pl b/tools/perf/scripts/perl/failed-syscalls.pl
index c18e7e27a84b..94bc25a347eb 100644
--- a/tools/perf/scripts/perl/failed-syscalls.pl
+++ b/tools/perf/scripts/perl/failed-syscalls.pl
@@ -11,6 +11,8 @@ use Perf::Trace::Core;
11use Perf::Trace::Context; 11use Perf::Trace::Context;
12use Perf::Trace::Util; 12use Perf::Trace::Util;
13 13
14my $for_comm = shift;
15
14my %failed_syscalls; 16my %failed_syscalls;
15 17
16sub raw_syscalls::sys_exit 18sub raw_syscalls::sys_exit
@@ -33,6 +35,8 @@ sub trace_end
33 35
34 foreach my $comm (sort {$failed_syscalls{$b} <=> $failed_syscalls{$a}} 36 foreach my $comm (sort {$failed_syscalls{$b} <=> $failed_syscalls{$a}}
35 keys %failed_syscalls) { 37 keys %failed_syscalls) {
36 printf("%-20s %10s\n", $comm, $failed_syscalls{$comm}); 38 next if ($for_comm && $comm ne $for_comm);
39
40 printf("%-20s %10s\n", $comm, $failed_syscalls{$comm});
37 } 41 }
38} 42}