diff options
author | Steven Rostedt <srostedt@redhat.com> | 2012-08-03 16:10:49 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2013-03-15 00:34:44 -0400 |
commit | 277ba04461c2746cf935353474c0961161951b68 (patch) | |
tree | df2b8eb157c6725e606605f6acf40acbd4f13dd6 /kernel/trace/trace.h | |
parent | 12ab74ee00d154bc05ea2fc659b7ce6519e5d5a6 (diff) |
tracing: Add interface to allow multiple trace buffers
Add the interface ("instances" directory) to add multiple buffers
to ftrace. To create a new instance, simply do a mkdir in the
instances directory:
This will create a directory with the following:
# cd instances
# mkdir foo
# ls foo
buffer_size_kb free_buffer trace_clock trace_pipe
buffer_total_size_kb set_event trace_marker tracing_enabled
events/ trace trace_options tracing_on
Currently only events are able to be set, and there isn't a way
to delete a buffer when one is created (yet).
Note, the i_mutex lock is dropped from the parent "instances"
directory during the mkdir operation. As the "instances" directory
can not be renamed or deleted (created on boot), I do not see
any harm in dropping the lock. The creation of the sub directories
is protected by trace_types_lock mutex, which only lets one
instance get into the code path at a time. If two tasks try to
create or delete directories of the same name, only one will occur
and the other will fail with -EEXIST.
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace/trace.h')
-rw-r--r-- | kernel/trace/trace.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h index 68cad7a9e089..883fe0b62f0a 100644 --- a/kernel/trace/trace.h +++ b/kernel/trace/trace.h | |||
@@ -175,6 +175,7 @@ struct tracer; | |||
175 | struct trace_array { | 175 | struct trace_array { |
176 | struct ring_buffer *buffer; | 176 | struct ring_buffer *buffer; |
177 | struct list_head list; | 177 | struct list_head list; |
178 | char *name; | ||
178 | int cpu; | 179 | int cpu; |
179 | int buffer_disabled; | 180 | int buffer_disabled; |
180 | struct trace_cpu trace_cpu; /* place holder */ | 181 | struct trace_cpu trace_cpu; /* place holder */ |
@@ -999,6 +1000,7 @@ filter_check_discard(struct ftrace_event_call *call, void *rec, | |||
999 | } | 1000 | } |
1000 | 1001 | ||
1001 | extern void trace_event_enable_cmd_record(bool enable); | 1002 | extern void trace_event_enable_cmd_record(bool enable); |
1003 | extern int event_trace_add_tracer(struct dentry *parent, struct trace_array *tr); | ||
1002 | 1004 | ||
1003 | extern struct mutex event_mutex; | 1005 | extern struct mutex event_mutex; |
1004 | extern struct list_head ftrace_events; | 1006 | extern struct list_head ftrace_events; |