Debugging Linux Kernel using ftrace Part5 - trace_printk

ftrace has introduced a new form of printk - trace_printk. The problem with the current printk() is

  • Using printk in interrupt context such as timer interrupts, scheduler, network can create a live lock
  • Sometimes bug disappear when we add few printk's if something is time sensitive
  • printk when writing to the serial console may take several milliseconds
With trace_printk
  • writing will be in the order of microseconds as it writes to a ring buffer instead of console
  • can be used in any context (interrupt, scheduler, NMI Code)
  • can be read via the 'trace' file
Let's update our Keyboard character press driver code to use trace_printk instead of printk.

Code:



Output:




Comments

Popular posts from this blog

bb.utils.contains yocto

Difference between RDEPENDS and DEPENDS in Yocto

PR, PN and PV Variable in Yocto