Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Tom Zanussi and committed by
Arnaldo Carvalho de Melo
c3f5fd28 fefb0b94

+6 -2
+1 -1
tools/perf/scripts/perl/bin/failed-syscalls-report
··· 2 2 # description: system-wide failed syscalls 3 3 # args: [comm] 4 4 if [ $# -gt 0 ] ; then 5 - if ! expr match "$1" "-" ; then 5 + if ! expr match "$1" "-" > /dev/null ; then 6 6 comm=$1 7 7 shift 8 8 fi
+5 -1
tools/perf/scripts/perl/failed-syscalls.pl
··· 11 11 use Perf::Trace::Context; 12 12 use Perf::Trace::Util; 13 13 14 + my $for_comm = shift; 15 + 14 16 my %failed_syscalls; 15 17 16 18 sub raw_syscalls::sys_exit ··· 35 33 36 34 foreach my $comm (sort {$failed_syscalls{$b} <=> $failed_syscalls{$a}} 37 35 keys %failed_syscalls) { 38 - printf("%-20s %10s\n", $comm, $failed_syscalls{$comm}); 36 + next if ($for_comm && $comm ne $for_comm); 37 + 38 + printf("%-20s %10s\n", $comm, $failed_syscalls{$comm}); 39 39 } 40 40 }