Created
April 29, 2011 10:24
-
-
Save deanwilson/948153 to your computer and use it in GitHub Desktop.
systemtap signal counter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /usr/bin/env stap | |
| global signals_sent | |
| global processes | |
| probe signal.send { | |
| printf("%s was sent to %s (pid:%d) by %s\n", | |
| sig_name, pid_name, sig_pid, execname()) | |
| signals_sent++ | |
| processes[pid_name]++ | |
| } | |
| probe end { | |
| printf("A total of [%d] signals were sent\n", signals_sent) | |
| foreach ( process in processes) { | |
| printf("%s received %d signals\n", process, processes[process]) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment