Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c3f5fd28 authored by Tom Zanussi's avatar Tom Zanussi Committed by Arnaldo Carvalho de Melo
Browse files

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: default avatarTom Zanussi <tzanussi@gmail.com>
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent fefb0b94
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -2,7 +2,7 @@
# description: system-wide failed syscalls
# description: system-wide failed syscalls
# args: [comm]
# args: [comm]
if [ $# -gt 0 ] ; then
if [ $# -gt 0 ] ; then
    if ! expr match "$1" "-" ; then
    if ! expr match "$1" "-" > /dev/null ; then
	comm=$1
	comm=$1
	shift
	shift
    fi
    fi
+5 −1
Original line number Original line Diff line number Diff line
@@ -11,6 +11,8 @@ use Perf::Trace::Core;
use Perf::Trace::Context;
use Perf::Trace::Context;
use Perf::Trace::Util;
use Perf::Trace::Util;


my $for_comm = shift;

my %failed_syscalls;
my %failed_syscalls;


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


    foreach my $comm (sort {$failed_syscalls{$b} <=> $failed_syscalls{$a}}
    foreach my $comm (sort {$failed_syscalls{$b} <=> $failed_syscalls{$a}}
		      keys %failed_syscalls) {
		      keys %failed_syscalls) {
	next if ($for_comm && $comm ne $for_comm);

	printf("%-20s  %10s\n", $comm, $failed_syscalls{$comm});
	printf("%-20s  %10s\n", $comm, $failed_syscalls{$comm});
    }
    }
}
}