mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-28 17:41:50 +00:00
ftrace: add ftrace_off_permanent
Impact: add new API to disable all of ftrace on anomalies It case of a serious anomaly being detected (like something caught by lockdep) it is a good idea to disable all tracing immediately, without grabing any locks. This patch adds ftrace_off_permanent that disables the tracers, function tracing and ring buffers without a way to enable them again. This should only be used when something serious has been detected. Signed-off-by: Steven Rostedt <srostedt@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
parent
e58918ab9d
commit
69bb54ec05
2 changed files with 17 additions and 0 deletions
|
@ -257,6 +257,7 @@ extern int ftrace_dump_on_oops;
|
||||||
|
|
||||||
extern void tracing_start(void);
|
extern void tracing_start(void);
|
||||||
extern void tracing_stop(void);
|
extern void tracing_stop(void);
|
||||||
|
extern void ftrace_off_permanent(void);
|
||||||
|
|
||||||
extern void
|
extern void
|
||||||
ftrace_special(unsigned long arg1, unsigned long arg2, unsigned long arg3);
|
ftrace_special(unsigned long arg1, unsigned long arg2, unsigned long arg3);
|
||||||
|
@ -290,6 +291,7 @@ ftrace_printk(const char *fmt, ...) __attribute__ ((format (printf, 1, 0)));
|
||||||
|
|
||||||
static inline void tracing_start(void) { }
|
static inline void tracing_start(void) { }
|
||||||
static inline void tracing_stop(void) { }
|
static inline void tracing_stop(void) { }
|
||||||
|
static inline void ftrace_off_permanent(void) { }
|
||||||
static inline int
|
static inline int
|
||||||
ftrace_printk(const char *fmt, ...)
|
ftrace_printk(const char *fmt, ...)
|
||||||
{
|
{
|
||||||
|
|
|
@ -660,6 +660,21 @@ static void trace_init_cmdlines(void)
|
||||||
static int trace_stop_count;
|
static int trace_stop_count;
|
||||||
static DEFINE_SPINLOCK(tracing_start_lock);
|
static DEFINE_SPINLOCK(tracing_start_lock);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ftrace_off_permanent - disable all ftrace code permanently
|
||||||
|
*
|
||||||
|
* This should only be called when a serious anomally has
|
||||||
|
* been detected. This will turn off the function tracing,
|
||||||
|
* ring buffers, and other tracing utilites. It takes no
|
||||||
|
* locks and can be called from any context.
|
||||||
|
*/
|
||||||
|
void ftrace_off_permanent(void)
|
||||||
|
{
|
||||||
|
tracing_disabled = 1;
|
||||||
|
ftrace_stop();
|
||||||
|
tracing_off_permanent();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* tracing_start - quick start of the tracer
|
* tracing_start - quick start of the tracer
|
||||||
*
|
*
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue