Skip to content

Commit

Permalink
perf/trace/scripting: failed-syscalls script cleanup
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Tom Zanussi authored and Arnaldo Carvalho de Melo committed May 10, 2010
1 parent fefb0b9 commit c3f5fd2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tools/perf/scripts/perl/bin/failed-syscalls-report
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion tools/perf/scripts/perl/failed-syscalls.pl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
use Perf::Trace::Context;
use Perf::Trace::Util;

my $for_comm = shift;

my %failed_syscalls;

sub raw_syscalls::sys_exit
Expand All @@ -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});
}
}

0 comments on commit c3f5fd2

Please sign in to comment.