[PATCH 2/3] tracing: Add and use event_trigger_lseek()
From: Tom Zanussi
Date: Sat Dec 21 2013 - 17:44:47 EST
event_trigger_fops is currently using ftrace_filter_lseek, which
doesn't work out so well if CONFIG_FUNCTION_TRACER isn't configured
(compile error).
We also wanted to be completely decoupled from ftrace anyway, so
create our own version and use it instead.
Reported-by: kbuild test robot <fengguang.wu@xxxxxxxxx>
Signed-off-by: Tom Zanussi <tom.zanussi@xxxxxxxxxxxxxxx>
---
kernel/trace/trace_events_trigger.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/kernel/trace/trace_events_trigger.c b/kernel/trace/trace_events_trigger.c
index f5b3f78..ff4d51e 100644
--- a/kernel/trace/trace_events_trigger.c
+++ b/kernel/trace/trace_events_trigger.c
@@ -277,11 +277,24 @@ event_trigger_release(struct inode *inode, struct file *file)
return event_trigger_regex_release(inode, file);
}
+static loff_t
+event_trigger_lseek(struct file *file, loff_t offset, int whence)
+{
+ loff_t ret;
+
+ if (file->f_mode & FMODE_READ)
+ ret = seq_lseek(file, offset, whence);
+ else
+ file->f_pos = ret = 1;
+
+ return ret;
+}
+
const struct file_operations event_trigger_fops = {
.open = event_trigger_open,
.read = seq_read,
.write = event_trigger_write,
- .llseek = ftrace_filter_lseek,
+ .llseek = event_trigger_lseek,
.release = event_trigger_release,
};
--
1.8.3.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/