From: Tom Zanussi Date: Mon, 10 May 2010 04:46:52 +0000 (-0500) Subject: perf/trace/scripting: failed-syscalls script cleanup X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=c3f5fd287aa897f710f3305367a1d256c9cf3e83;p=mv-sheeva.git 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 Cc: Ingo Molnar LKML-Reference: <1273466820-9330-2-git-send-email-tzanussi@gmail.com> Signed-off-by: Tom Zanussi Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/scripts/perl/bin/failed-syscalls-report b/tools/perf/scripts/perl/bin/failed-syscalls-report index f6346082a8f..e3a5e55d54f 100644 --- a/tools/perf/scripts/perl/bin/failed-syscalls-report +++ b/tools/perf/scripts/perl/bin/failed-syscalls-report @@ -2,7 +2,7 @@ # description: system-wide failed syscalls # args: [comm] if [ $# -gt 0 ] ; then - if ! expr match "$1" "-" ; then + if ! expr match "$1" "-" > /dev/null ; then comm=$1 shift fi diff --git a/tools/perf/scripts/perl/failed-syscalls.pl b/tools/perf/scripts/perl/failed-syscalls.pl index c18e7e27a84..94bc25a347e 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; use Perf::Trace::Context; use Perf::Trace::Util; +my $for_comm = shift; + my %failed_syscalls; sub raw_syscalls::sys_exit @@ -33,6 +35,8 @@ sub trace_end foreach my $comm (sort {$failed_syscalls{$b} <=> $failed_syscalls{$a}} keys %failed_syscalls) { - printf("%-20s %10s\n", $comm, $failed_syscalls{$comm}); + next if ($for_comm && $comm ne $for_comm); + + printf("%-20s %10s\n", $comm, $failed_syscalls{$comm}); } }