Created attachment 524246 [details]
patch to fix the bug
Description of problem:
Compiling the MRG kernel myself, the kernel would crash on the rttrace version.
The reason was that it was calling the wakeup tracer in the self tests that
happened to have function tracing enabled which traced arch_local_irq_save().
arch_local_irq_save() is suppose to be inlined, but because CC_OPTIMIZE_INLINING is enabled in the MRG config, my gcc decided it was best not to inline it causing ftrace to trace that function.
The problem arises when we enter the scheduler due to preemption. The preempt scheduler calls local_irq_save() which calls arch_local_irq_save() which gets traced. The wakeup function tracer disables preemption and then enables it later, which happens to notice the NEED_RESCHED flag set and calls back into the preempt_scheduler() code which again calls arch_local_irq_save() which gets traced again and then we continue this loop until we crash.
The simple answer is to not trace arch_local_irq_save(). In fact, we should not trace any of the arch_* functions. A simple patch is attached that makes these functions not traced.
This issue has not been updated in a while and will be closed WONTFIX. If you believe this is still an issue on our most recent MRG-2.5 3.10 Realtime release, please file a new issue for further investigation.