I am making a simple enque/deque program in kernel. I want to print message in kernel, and this is what I got:
[18594.595747] Enqueue 3
[18594.595748] queu
-
Debugging by printing
printk(KERN_ERR "Doing something was ");
/* <100 lines of whatever>*/
if (success)
printk(KERN_CONT "successful\n");
else
printk(KERN_CONT "NOT successful\n");
Logging prints should be safe: SFP vs single CPU.
讨论(0)
-
To prevent a new line from being started, use KERN_CONT
:
printk(KERN_ALERT "self destruction commences in ");
printk(KERN_CONT "%d", time_remaining);
printk(KERN_CONT " minutes\n");
讨论(0)
- 热议问题