aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace.c
diff options
context:
space:
mode:
authorSteven Rostedt (Red Hat) <rostedt@goodmis.org>2013-12-21 17:39:40 -0500
committerSteven Rostedt <rostedt@goodmis.org>2014-01-02 16:17:12 -0500
commit098c879e1f2d6ee7afbfe959f6b04070065cec90 (patch)
tree22a2d64f30c82b70619786bc541ddcbe320f5d44 /kernel/trace/trace.c
parentac38fb8582d86ba887b5d07c0912dec135bf6931 (diff)
tracing: Add generic tracing_lseek() function
Trace event triggers added a lseek that uses the ftrace_filter_lseek() function. Unfortunately, when function tracing is not configured in that function is not defined and the kernel fails to build. This is the second time that function was added to a file ops and it broke the build due to requiring special config dependencies. Make a generic tracing_lseek() that all the tracing utilities may use. Also, modify the old ftrace_filter_lseek() to return 0 instead of 1 on WRONLY. Not sure why it was a 1 as that does not make sense. This also changes the old tracing_seek() to modify the file pos pointer on WRONLY as well. Reported-by: kbuild test robot <fengguang.wu@intel.com> Tested-by: Tom Zanussi <tom.zanussi@linux.intel.com> Acked-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace/trace.c')
-rw-r--r--kernel/trace/trace.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 59bf5b56ccc0..e32a2f48dde1 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -3183,19 +3183,23 @@ tracing_write_stub(struct file *filp, const char __user *ubuf,
3183 return count; 3183 return count;
3184} 3184}
3185 3185
3186static loff_t tracing_seek(struct file *file, loff_t offset, int origin) 3186loff_t tracing_lseek(struct file *file, loff_t offset, int whence)
3187{ 3187{
3188 int ret;
3189
3188 if (file->f_mode & FMODE_READ) 3190 if (file->f_mode & FMODE_READ)
3189 return seq_lseek(file, offset, origin); 3191 ret = seq_lseek(file, offset, whence);
3190 else 3192 else
3191 return 0; 3193 file->f_pos = ret = 0;
3194
3195 return ret;
3192} 3196}
3193 3197
3194static const struct file_operations tracing_fops = { 3198static const struct file_operations tracing_fops = {
3195 .open = tracing_open, 3199 .open = tracing_open,
3196 .read = seq_read, 3200 .read = seq_read,
3197 .write = tracing_write_stub, 3201 .write = tracing_write_stub,
3198 .llseek = tracing_seek, 3202 .llseek = tracing_lseek,
3199 .release = tracing_release, 3203 .release = tracing_release,
3200}; 3204};
3201 3205
@@ -4940,7 +4944,7 @@ static const struct file_operations snapshot_fops = {
4940 .open = tracing_snapshot_open, 4944 .open = tracing_snapshot_open,
4941 .read = seq_read, 4945 .read = seq_read,
4942 .write = tracing_snapshot_write, 4946 .write = tracing_snapshot_write,
4943 .llseek = tracing_seek, 4947 .llseek = tracing_lseek,
4944 .release = tracing_snapshot_release, 4948 .release = tracing_snapshot_release,
4945}; 4949};
4946 4950