Skip to content

Commit 2e86421

Browse files
geyslanrostedt
authored andcommitted
tracing: Add helper function tracing_is_disabled()
This patch creates the function 'tracing_is_disabled', which can be used outside of trace.c. Link: http://lkml.kernel.org/r/1382141754-12155-1-git-send-email-geyslan@gmail.com Signed-off-by: Geyslan G. Bem <geyslan@gmail.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
1 parent b2f974d commit 2e86421

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

‎kernel/trace/trace.c‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2987,6 +2987,11 @@ int tracing_open_generic(struct inode *inode, struct file *filp)
29872987
return 0;
29882988
}
29892989

2990+
bool tracing_is_disabled(void)
2991+
{
2992+
return (tracing_disabled) ? true: false;
2993+
}
2994+
29902995
/*
29912996
* Open and update trace_array ref count.
29922997
* Must have the current trace_array passed to it.

‎kernel/trace/trace.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,7 @@ void tracing_reset_online_cpus(struct trace_buffer *buf);
514514
void tracing_reset_current(int cpu);
515515
void tracing_reset_all_online_cpus(void);
516516
int tracing_open_generic(struct inode *inode, struct file *filp);
517+
bool tracing_is_disabled(void);
517518
struct dentry *trace_create_file(const char *name,
518519
umode_t mode,
519520
struct dentry *parent,

0 commit comments

Comments
 (0)