]> sourceware.org Git - systemtap.git/commitdiff
Added a couple simple syscall example scripts.
authormmason <mmason>
Tue, 24 Apr 2007 23:04:43 +0000 (23:04 +0000)
committermmason <mmason>
Tue, 24 Apr 2007 23:04:43 +0000 (23:04 +0000)
examples/syscalls_by_pid.stp [new file with mode: 0755]
examples/syscalls_by_pid.txt [new file with mode: 0644]
examples/syscalls_by_proc.stp [new file with mode: 0755]
examples/syscalls_by_proc.txt [new file with mode: 0644]

diff --git a/examples/syscalls_by_pid.stp b/examples/syscalls_by_pid.stp
new file mode 100755 (executable)
index 0000000..6870f28
--- /dev/null
@@ -0,0 +1,28 @@
+#! stap
+
+# Copyright (C) 2006 IBM Corp.
+#
+# This file is part of systemtap, and is free software.  You can
+# redistribute it and/or modify it under the terms of the GNU General
+# Public License (GPL); either version 2, or (at your option) any
+# later version.
+
+#
+# Print the system call count by process ID in descending order.
+#
+
+global syscalls
+
+probe begin {
+       print ("Collecting data... Type Ctrl-C to exit and display results\n")
+}
+
+probe syscall.* {
+       syscalls[pid()]++
+}
+
+probe end {
+       printf ("%-10s %-s\n", "#SysCalls", "PID")
+       foreach (pid in syscalls-)
+               printf("%-10d %-d\n", syscalls[pid], pid)
+}
diff --git a/examples/syscalls_by_pid.txt b/examples/syscalls_by_pid.txt
new file mode 100644 (file)
index 0000000..4943a13
--- /dev/null
@@ -0,0 +1,35 @@
+# stap syscalls_by_pid.stp
+Collecting data... Type Ctrl-C to exit and display results
+^C
+#SysCalls  PID
+2293       31866
+765        31081
+567        30983
+557        30965
+554        31008
+523        30985
+273        30991
+118        9585
+115        2130
+77         30928
+65         1988
+50         31006
+42         2492
+40         31077
+36         2487
+35         2490
+23         2257
+22         2366
+20         8682
+20         2048
+17         31197
+16         31067
+14         2313
+10         31011
+8          1
+5          31074
+3          1978
+3          1975
+3          2467
+3          30932
+
diff --git a/examples/syscalls_by_proc.stp b/examples/syscalls_by_proc.stp
new file mode 100755 (executable)
index 0000000..b28d455
--- /dev/null
@@ -0,0 +1,28 @@
+#! stap
+
+# Copyright (C) 2006 IBM Corp.
+#
+# This file is part of systemtap, and is free software.  You can
+# redistribute it and/or modify it under the terms of the GNU General
+# Public License (GPL); either version 2, or (at your option) any
+# later version.
+
+#
+# Print the system call count by process name in descending order.
+#
+
+global syscalls
+
+probe begin {
+        print ("Collecting data... Type Ctrl-C to exit and display results\n")
+}
+
+probe syscall.* {
+       syscalls[execname()]++
+}
+
+probe end {
+       printf ("%-10s %-s\n", "#SysCalls", "Process Name")
+       foreach (proc in syscalls-)
+               printf("%-10d %-s\n", syscalls[proc], proc)
+}
diff --git a/examples/syscalls_by_proc.txt b/examples/syscalls_by_proc.txt
new file mode 100644 (file)
index 0000000..dd55408
--- /dev/null
@@ -0,0 +1,58 @@
+# stap syscalls_by_proc.stp
+Collecting data... Type Ctrl-C to exit and display results
+^C
+#SysCalls  Process Name
+53832      make
+15275      sh
+6764       staprun
+2291       gcc
+2225       mixer_applet2
+1638       gnome-settings-
+1603       gnome-panel
+1577       rm
+1567       nautilus
+1557       trashapplet
+1443       cat
+1404       sshd
+1207       cc1
+779        ls
+764        gnome-vfs-daemo
+638        bash
+610        collect2
+356        mkdir
+354        artsd
+340        hald-addon-stor
+338        hidd
+280        ld
+260        irqbalance
+238        xterm
+212        automount
+182        sed
+176        as
+141        dnsdomainname
+130        date
+129        cmp
+124        clock-applet
+122        nm-applet
+104        grep
+88         hostname
+75         whoami
+70         rpc.idmapd
+68         httpd
+68         python
+61         gam_server
+56         pam_timestamp_c
+53         wc
+49         sendmail
+46         echo
+40         tail
+39         expr
+37         uname
+35         pam-panel-icon
+24         init
+17         mapping-daemon
+9          syslogd
+3          klogd
+3          hald
+3          gconfd-2
+1          cupsd
This page took 0.031106 seconds and 5 git commands to generate.