diff options
author | Hiraku Toyooka <hiraku.toyooka.gu@hitachi.com> | 2012-12-26 03:53:00 +0100 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2013-01-30 17:02:06 +0100 |
commit | debdd57f5145f3c6a4b3f8d0126abd1a2def7fc6 (patch) | |
tree | 8dca457fbccaf115c48fdb9fb6ee6a9469b8b6de /include | |
parent | tracing: Replace static old_tracer check of tracer name (diff) | |
download | linux-debdd57f5145f3c6a4b3f8d0126abd1a2def7fc6.tar.xz linux-debdd57f5145f3c6a4b3f8d0126abd1a2def7fc6.zip |
tracing: Make a snapshot feature available from userspace
Ftrace has a snapshot feature available from kernel space and
latency tracers (e.g. irqsoff) are using it. This patch enables
user applictions to take a snapshot via debugfs.
Add "snapshot" debugfs file in "tracing" directory.
snapshot:
This is used to take a snapshot and to read the output of the
snapshot.
# echo 1 > snapshot
This will allocate the spare buffer for snapshot (if it is
not allocated), and take a snapshot.
# cat snapshot
This will show contents of the snapshot.
# echo 0 > snapshot
This will free the snapshot if it is allocated.
Any other positive values will clear the snapshot contents if
the snapshot is allocated, or return EINVAL if it is not allocated.
Link: http://lkml.kernel.org/r/20121226025300.3252.86850.stgit@liselsia
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: David Sharp <dhsharp@google.com>
Signed-off-by: Hiraku Toyooka <hiraku.toyooka.gu@hitachi.com>
[
Fixed irqsoff selftest and also a conflict with a change
that fixes the update_max_tr.
]
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/ftrace_event.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h index 6f8d0b77006b..13a54d0bdfa8 100644 --- a/include/linux/ftrace_event.h +++ b/include/linux/ftrace_event.h @@ -83,6 +83,9 @@ struct trace_iterator { long idx; cpumask_var_t started; + + /* it's true when current open file is snapshot */ + bool snapshot; }; enum trace_iter_flags { |