How to trace the module after system freeze?

Hi,

I wrote a kernel module that did a virtual network protocol and library that provide interface for application use to interact with the kernel module by ioctl actions.

insmod the module and unload the module, there will be no problem. But once I call the library with my example application. The system freezed. And there is almost no any information on the console. So Are there any better solutions to track what happened?

Thanks very much.