lkml.org 
[lkml]   [2013]   [Mar]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Subjectsnapshot error on non allocated buffer?
From
Date
Hi Hiraku,

I'm doing a lot of reconstruction of ftrace's buffering, and I'm also
modifying a lot of the snapshot feature to work with the new stuff
that's coming.

I'm looking at the -EINVAL when you write something other than '0' or
'1' into the snapshot file when the snapshot is not allocated. I'm
thinking that it should just return as if it succeeded. I don't
understand why it should return -EINVAL?

Now if you want to know if the snapshot is allocated or not, I have a
patch that shows how to use the snapshot feature when the snapshot is
empty, and also give the status of the snapshot itself:

[root] # cat /debug/tracing/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')

[root] # echo 1 > /debug/tracing/snapshot
[root] # echo 2 > /debug/tracing/snapshot
[root] # cat /debug/tracing/snapshot
# tracer: nop
#
#
# * Snapshot is allocated *
#
# 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 this is a new feature for 3.9, and we are still in -rc1, I think this
might be a good thing to add now. As well as not returning -EINVAL on
writing to the file when the snapshot buffer isn't allocated.

What do you think?

-- Steve




\
 
 \ /
  Last update: 2013-03-05 17:21    [W:0.175 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site