mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tom Zanussi <tom.zanussi@linux.intel.com>
To: rostedt@goodmis.org
Cc: linux-kernel@vger.kernel.org, Tom Zanussi <tom.zanussi@linux.intel.com>
Subject: [PATCH 2/3] tracing: Add and use event_trigger_lseek()
Date: Sat, 21 Dec 2013 16:44:01 -0600	[thread overview]
Message-ID: <b6945a78cef7c0af80a5035e6c7814819ddcc7e0.1387662969.git.tom.zanussi@linux.intel.com> (raw)
In-Reply-To: <cover.1387662969.git.tom.zanussi@linux.intel.com>
In-Reply-To: <cover.1387662969.git.tom.zanussi@linux.intel.com>

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@intel.com>
Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
---
 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


  parent reply	other threads:[~2013-12-21 22:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-21 22:43 [PATCH 0/3] tracing: A few trace event triggers fixes Tom Zanussi
2013-12-21 22:44 ` [PATCH 1/3] tracing: Move tracing_alloc_snapshot() declaration to tracing.h Tom Zanussi
2013-12-22  2:59   ` Steven Rostedt
2013-12-21 22:44 ` Tom Zanussi [this message]
2013-12-21 22:44 ` [PATCH 3/3] tracing: Add rcu annotation for event_trigger_data.filter Tom Zanussi
2013-12-21 22:53 ` [PATCH 0/3] tracing: A few trace event triggers fixes Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b6945a78cef7c0af80a5035e6c7814819ddcc7e0.1387662969.git.tom.zanussi@linux.intel.com \
    --to=tom.zanussi@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®