Skip to content

Instantly share code, notes, and snippets.

@deanwilson
Created April 29, 2011 10:24
Show Gist options
  • Select an option

  • Save deanwilson/948153 to your computer and use it in GitHub Desktop.

Select an option

Save deanwilson/948153 to your computer and use it in GitHub Desktop.
systemtap signal counter
#! /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