Skip to content

Commit c3f5fd2

Browse files
zanussiacmel
authored andcommitted
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>
1 parent fefb0b9 commit c3f5fd2

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

‎tools/perf/scripts/perl/bin/failed-syscalls-report‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# description: system-wide failed syscalls
33
# args: [comm]
44
if [ $# -gt 0 ] ; then
5-
if ! expr match "$1" "-" ; then
5+
if ! expr match "$1" "-" > /dev/null ; then
66
comm=$1
77
shift
88
fi

‎tools/perf/scripts/perl/failed-syscalls.pl‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
use Perf::Trace::Context;
1212
use Perf::Trace::Util;
1313

14+
my $for_comm = shift;
15+
1416
my %failed_syscalls;
1517

1618
sub raw_syscalls::sys_exit
@@ -33,6 +35,8 @@ sub trace_end
3335

3436
foreach my $comm (sort {$failed_syscalls{$b} <=> $failed_syscalls{$a}}
3537
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});
3741
}
3842
}

0 commit comments

Comments
 (0)