Link: https://lore.kernel.org/r/20260217200002.683975158@linuxfoundation.org Tested-by: Florian Fainelli <florian.fainelli@broadcom.com> Tested-by: Takeshi Ogasawara <takeshi.ogasawara@futuring-girl.com> Tested-by: Peter Schneider <pschneider1968@googlemail.com> Tested-by: Jon Hunter <jonathanh@nvidia.com> Tested-by: Salvatore Bonaccorso <carnil@debian.org> Tested-by: Brett A C Sheffield <bacs@librecast.net> Tested-by: Mark Brown <broonie@kernel.org> Tested-by: Luna Jernberg <droidbittin@gmail.com> Tested-by: Ronald Warsow <rwarsow@gmx.de> Tested-by: Justin M. Forbes <jforbes@fedoraproject.org> Tested-by: Ron Economos <re@w6rz.net> Tested-by: Miguel Ojeda <ojeda@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
48 lines
1.1 KiB
Raku
48 lines
1.1 KiB
Raku
# failed system call counts
|
|
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
|
|
# Licensed under the terms of the GNU GPL License version 2
|
|
#
|
|
# Displays system-wide failed system call totals
|
|
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
|
|
|
|
use lib "$ENV{'PERF_EXEC_PATH'}/scripts/perl/Perf-Trace-Util/lib";
|
|
use lib "./Perf-Trace-Util/lib";
|
|
use Perf::Trace::Core;
|
|
use Perf::Trace::Context;
|
|
use Perf::Trace::Util;
|
|
|
|
my $for_comm = shift;
|
|
|
|
my %failed_syscalls;
|
|
|
|
sub raw_syscalls::sys_exit
|
|
{
|
|
my ($event_name, $context, $common_cpu, $common_secs, $common_nsecs,
|
|
$common_pid, $common_comm, $common_callchain,
|
|
$id, $ret) = @_;
|
|
|
|
if ($ret < 0) {
|
|
$failed_syscalls{$common_comm}++;
|
|
}
|
|
}
|
|
|
|
sub syscalls::sys_exit
|
|
{
|
|
raw_syscalls::sys_exit(@_)
|
|
}
|
|
|
|
sub trace_end
|
|
{
|
|
printf("\nfailed syscalls by comm:\n\n");
|
|
|
|
printf("%-20s %10s\n", "comm", "# errors");
|
|
printf("%-20s %6s %10s\n", "--------------------", "----------");
|
|
|
|
foreach my $comm (sort {$failed_syscalls{$b} <=> $failed_syscalls{$a}}
|
|
keys %failed_syscalls) {
|
|
next if ($for_comm && $comm ne $for_comm);
|
|
|
|
printf("%-20s %10s\n", $comm, $failed_syscalls{$comm});
|
|
}
|
|
}
|