summaryrefslogtreecommitdiffstats
path: root/tools/perf/scripts/perl/failed-syscalls.pl
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2010-03-04 11:51:29 +0100
committerIngo Molnar <mingo@elte.hu>2010-03-04 11:51:29 +0100
commite02c4fd3142dfb9412531bbfabd510a2a7c6ea46 (patch)
tree61b64506b2c016e050f940a89d1ffd36b7c00fdf /tools/perf/scripts/perl/failed-syscalls.pl
parenttracing: Include irqflags headers from trace clock (diff)
parenttracing: Fix warning in s_next of trace file ops (diff)
downloadlinux-e02c4fd3142dfb9412531bbfabd510a2a7c6ea46.tar.xz
linux-e02c4fd3142dfb9412531bbfabd510a2a7c6ea46.zip
Merge branch 'tip/tracing/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace into tracing/urgent
Diffstat (limited to 'tools/perf/scripts/perl/failed-syscalls.pl')
-rw-r--r--tools/perf/scripts/perl/failed-syscalls.pl38
1 files changed, 38 insertions, 0 deletions
diff --git a/tools/perf/scripts/perl/failed-syscalls.pl b/tools/perf/scripts/perl/failed-syscalls.pl
new file mode 100644
index 000000000000..c18e7e27a84b
--- /dev/null
+++ b/tools/perf/scripts/perl/failed-syscalls.pl
@@ -0,0 +1,38 @@
+# 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 %failed_syscalls;
+
+sub raw_syscalls::sys_exit
+{
+ my ($event_name, $context, $common_cpu, $common_secs, $common_nsecs,
+ $common_pid, $common_comm,
+ $id, $ret) = @_;
+
+ if ($ret < 0) {
+ $failed_syscalls{$common_comm}++;
+ }
+}
+
+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) {
+ printf("%-20s %10s\n", $comm, $failed_syscalls{$comm});
+ }
+}