ftrace: system crash when changing current_tracer from function_graph via echo
Looks like you are not the only person to notice this behavior. I see
as a report of the problem, and
as a patch to the kernel that addresses it. Reading through that whole thread it appears that the issue is some compiler optimizations.