The Diagnosys Project

A paper on Diagnosys was accepted at ASE'12 (Best paper award) -- Read

The Linux kernel does not export a stable, well-defined kernel interface, complicating the development of kernel-level services, such as device drivers and file systems. While there does exist a set of functions that are exported to external modules, these are continually changing, and have implicit, ill-documented preconditions, which, if not satisfied, can cause the entire system to crash or hang. However, no specific debugging support is provided.

We have designed and implemented Diagnosys, an approach to automatically constructing a debugging interface for the Linux kernel. In our approach, a designated kernel maintainer uses Diagnosys to identify pre and post conditions on the use of the exported functions. The maintainer then publishes this information for download by service developers, who can use Diagnosys to generate a debugging interface specialized to their code. This interface is then included within a service implementation, such that when the service is tested it records information about potential problems. The recorded information is then made available to the service developer on reboot after a kernel crash or hang.

Document Highlights on how to set up and harness Diagnosys:

  • Describing the analysis of kernel exported functions : review of the SHAna's semantic matches

  • Patching the kernel to make it Diagnosys compatible : implementing the logging mechanism at the kernel level

  • Using Diagnosys-tools to enable/disable the Dlog logging mechanism : usage of dlog

  • Generating the wrappers and compiling an out-of-tree driver with DIGen and dmake

  • Displaying Diagnosys log through the /dev/dlog virtual device

Tip A quick tutorial on how to compile a vanilla kernel is provided. You should also visit Google to find more detailed tutorials.