It has been suggested that I add a way to disable the function tracer on an oops. This code adds a ftrace_kill_atomic. It is not meant to be used in normal situations. It will disable the ftrace tracer, but will not perform the nice shutdown that requires scheduling.
Unified · Split
| @@ -89,6 +89,7 @@ void ftrace_enable_daemon(void); · 88 unmodified lines | ||
| 89 | 89 | |
| 90 | 90 | /* totally disable ftrace - can not re-enable after this */ |
| 91 | 91 | void ftrace_kill(void); |
| 92 | +void ftrace_kill_atomic(void); | |
| 92 | 93 | |
| 93 | 94 | static inline void tracer_disable(void) |
| 94 | 95 | { |
| @@ -1601,6 +1601,21 @@ core_initcall(ftrace_dynamic_init); · 1600 unmodified lines | ||
| 1601 | 1601 | # define ftrace_force_shutdown() do { } while (0) |
| 1602 | 1602 | #endif /* CONFIG_DYNAMIC_FTRACE */ |
| 1603 | 1603 | |
| 1604 | +/** | |
| 1605 | + * ftrace_kill_atomic - kill ftrace from critical sections | |
| 1606 | + * | |
| 1607 | + * This function should be used by panic code. It stops ftrace | |
| 1608 | + * but in a not so nice way. If you need to simply kill ftrace | |
| 1609 | + * from a non-atomic section, use ftrace_kill. | |
| 1610 | + */ | |
| 1611 | +void ftrace_kill_atomic(void) | |
| 1612 | +{ | |
| 1613 | + ftrace_disabled = 1; | |
| 1614 | + ftrace_enabled = 0; | |
| 1615 | + ftraced_suspend = -1; | |
| 1616 | + clear_ftrace_function(); | |
| 1617 | +} | |
| 1618 | + | |
| 1604 | 1619 | /** |
| 1605 | 1620 | * ftrace_kill - totally shutdown ftrace |
| 1606 | 1621 | * |