Tuesday, October 02, 2007

A Signal Profiler

As I wrote last week, recently I'm looking into SIGNAL handling of Linux, especially SIGSEGV.

I have some crash dump files to see, but I thought it better if we have a new but simple mechanism giving us statistics of SIGNALS sent in a running system.

At first, I thought 'sar -B' could be used to see how many segmentation faults were generated in a system. But, that didn't work well for me, and I wanted to see more direct information that how many SIGNALs were sent in total at each sampling time.
Thus, I wrote one. :)

There are some more TODOs to make it public, and it's a homework of this weekend. :)

Here is an example of the profiler.
# head -15 /proc/sigprof
SIG COUNT
[ 0] 0
[ 1] 4
[ 2] 52
[ 3] 0
[ 4] 0
[ 5] 0
[ 6] 0
[ 7] 0
[ 8] 0
[ 9] 0
[10] 4
[11] 70384086 <== SIGSEGV : 70M SEGVs!? Because of the SEGV storm generator. :)
[12] 12
[13] 0

No comments: