开发者

How to Print to Console (Terminal) inside a system call

开发者 https://www.devze.com 2023-01-23 01:41 出处:网络
how can i print something (for debugging purpose) to console inside a linux system call? Or is there any not very dif开发者_StackOverflow社区fucult way of debugging kernel code?

how can i print something (for debugging purpose) to console inside a linux system call?

Or is there any not very dif开发者_StackOverflow社区fucult way of debugging kernel code?

thanks


The accepted way of printing inside the kernel is via printk().


You should also check the different modifiers to printk (such as KERNEL_DEBUG) which will control where/how the messages are printed, including whether they are printed to all active terminals or just the system buffer

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号