简体   繁体   中英

Linux booting hang up after adding a printk statement in the kernel source code

I have added single printk statement in the kernel source code. After compiling and building the kernel, when I boot-up the system it is hanging by printing the statement.

printk(KERN_INFO "I'm inside the function!\n");

I'm using core i3 machine in ubuntu 13.04, the version of kernel is 3.4.106 ( I've tried some other versions too but same happened ). While doing the same changes in core 2 duo system , it is booting normally.

Using trace_printk() instead of printk() helps staying non-messy in some time critical functions.

And your prints should be in ftrace buffers.

      $ cd /sys/kernel/debug/tracing
      $ cat trace

Refer http://june-takeout.blogspot.dk/2010/01/debugging-kernel-using-ftrace-part-1.html and see section "Using trace_printk()"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM