[PATCH 0/2] [GIT PULL][3.9] tracing: Fix in snapshot API

From: Steven Rostedt
Date: Thu Mar 07 2013 - 10:51:59 EST



Ingo,

The snapshot feature has been added in the 3.9 merge window. But after
playing with it some more, I've come to realize that it needs a
self documenting help (I had to look at the code a few times to remember
how to use it, or look in Documentation), and it also gives an awkward
error code if you go to clear the buffer and the buffer does not exist.

These two patches fix this issues, and I strongly suggest they go in
before snapshot is part of a major release.

The first patch gives the user a nice description to how to use snapshot:

# tracer: nop
#
#
# * Snapshot is freed *
#
# Snapshot commands:
# echo 0 > snapshot : Clears and frees snapshot buffer
# echo 1 > snapshot : Allocates snapshot buffer, if not already allocated.
# Takes a snapshot of the main buffer.
# echo 2 > snapshot : Clears snapshot buffer (but does not allocate)
# (Doesn't have to be '2' works with any number that
# is not a '0' or '1')

as well as the state of the snapshot buffer (freed or allocated).

The second patch, returns success on a reset of the buffer even if
the buffer wasn't allocated. Returning -EINVAL is just confusing.

These should go into mainline before 3.9 is released.

Thanks!

Please pull the latest tip/perf/urgent tree, which can be found at:

git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git
tip/perf/urgent

Head SHA1: c9960e48543799f168c4c9486f9790fb686ce5a8


Steven Rostedt (Red Hat) (2):
tracing: Add help of snapshot feature when snapshot is empty
tracing: Do not return EINVAL in snapshot when not allocated

----
kernel/trace/trace.c | 27 ++++++++++++++++++++++++---
1 file changed, 24 insertions(+), 3 deletions(-)

Attachment: signature.asc
Description: This is a digitally signed message part