Skip to content

Commit

Permalink
tracing: Add helper function tracing_is_disabled()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Geyslan G. Bem authored and Steven Rostedt committed Nov 6, 2013
1 parent b2f974d commit 2e86421
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions kernel/trace/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -2987,6 +2987,11 @@ int tracing_open_generic(struct inode *inode, struct file *filp)
return 0;
}

bool tracing_is_disabled(void)
{
return (tracing_disabled) ? true: false;
}

/*
* Open and update trace_array ref count.
* Must have the current trace_array passed to it.
Expand Down
1 change: 1 addition & 0 deletions kernel/trace/trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,7 @@ void tracing_reset_online_cpus(struct trace_buffer *buf);
void tracing_reset_current(int cpu);
void tracing_reset_all_online_cpus(void);
int tracing_open_generic(struct inode *inode, struct file *filp);
bool tracing_is_disabled(void);
struct dentry *trace_create_file(const char *name,
umode_t mode,
struct dentry *parent,
Expand Down

0 comments on commit 2e86421

Please sign in to comment.