]> git.karo-electronics.de Git - linux-beck.git/commitdiff
perf/trace/scripting: failed-syscalls script cleanup
authorTom Zanussi <tzanussi@gmail.com>
Mon, 10 May 2010 04:46:52 +0000 (23:46 -0500)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 10 May 2010 22:50:54 +0000 (19:50 -0300)
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>
tools/perf/scripts/perl/bin/failed-syscalls-report
tools/perf/scripts/perl/failed-syscalls.pl

index f6346082a8fca1ebde1abcce56f906f6b395789b..e3a5e55d54ff6706f620e9517d1a33f4b991364c 100644 (file)
@@ -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
index c18e7e27a84b6b801c845afffb6f143f4af19113..94bc25a347ebf7b4688f8cdda37499868d21ddf9 100644 (file)
@@ -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});
     }
 }