move register_trace_console logic into library/kdebug.c
make some functions to be static
fully support kdebug.dumpstack

add macro for linux version below 3.9.0