Measuring heart failure time

When a process crashes, I want to measure how long it takes to dumpcore. My understanding is its a core function that does dumpcore. All kernel experts can point to the right places where I can add the coredump timing hooks? This is in 64-bit kernel, version 2.6.3 *

+3


source to share


1 answer


You don't need to modify the kernel. The inotify utility for the Linux kernel can be used to tell you when the main file is being created, and you can use the file modification time to tell you when the kernel dump has ended.

But if you have access to the source code for the process, you can have it



  • catch the signal that would cause a coredump
  • Write a timestamp somewhere
  • reset signal handler returns to standard
  • re-send the signal by itself, which this time will cause a coredump.

The coredump interval is the last time the main file was modified, minus the timestamp that the process previously wrote.

+1


source







All Articles