I wrote a sample program to test the preempt-depth field of the output of ftrace.
preempt-depth
From ftrace documentation: