* [PATCH 0/3] tracing: A few trace event triggers fixes
@ 2013-12-21 22:43 Tom Zanussi
2013-12-21 22:44 ` [PATCH 1/3] tracing: Move tracing_alloc_snapshot() declaration to tracing.h Tom Zanussi
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Tom Zanussi @ 2013-12-21 22:43 UTC (permalink / raw)
To: rostedt; +Cc: linux-kernel, Tom Zanussi
This patchset fixes a few sparse warnings and build problems seen
under certain configurations, as uncovered by the kbuild test robot.
Applies to linux-trace.git ftrace/core.
The following changes since commit 611e9015501ab9597d6a43253813d4efd90936de:
tracing: Add documentation for trace event triggers (2013-12-20 23:24:20 -0500)
are available in the git repository at:
git://git.yoctoproject.org/linux-yocto-contrib.git tzanussi/event-triggers-ftrace-core-kbuild-robot-fixes
http://git.yoctoproject.org/cgit/cgit.cgi/linux-yocto-contrib/log/?h=tzanussi/event-triggers-ftrace-core-kbuild-robot-fixes
Tom Zanussi (3):
tracing: Move tracing_alloc_snapshot() declaration to tracing.h
tracing: Add and use event_trigger_lseek()
tracing: Add rcu annotation for event_trigger_data.filter
include/linux/kernel.h | 2 --
kernel/trace/trace.h | 3 ++-
kernel/trace/trace_events_trigger.c | 15 ++++++++++++++-
3 files changed, 16 insertions(+), 4 deletions(-)
--
1.8.3.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/3] tracing: Move tracing_alloc_snapshot() declaration to tracing.h
2013-12-21 22:43 [PATCH 0/3] tracing: A few trace event triggers fixes Tom Zanussi
@ 2013-12-21 22:44 ` Tom Zanussi
2013-12-22 2:59 ` Steven Rostedt
2013-12-21 22:44 ` [PATCH 2/3] tracing: Add and use event_trigger_lseek() Tom Zanussi
` (2 subsequent siblings)
3 siblings, 1 reply; 6+ messages in thread
From: Tom Zanussi @ 2013-12-21 22:44 UTC (permalink / raw)
To: rostedt; +Cc: linux-kernel, Tom Zanussi
tracing_alloc_snapshot() is only used internally by
alloc_tracing_snapshot() and trace_event_triggers.c and doesn't need
to be in kernel.h. Move it to trace.h, which is more appropriate and
both include.
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
---
include/linux/kernel.h | 2 --
kernel/trace/trace.h | 1 +
2 files changed, 1 insertion(+), 2 deletions(-)
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index d58541b..ecb8754 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -498,7 +498,6 @@ void tracing_on(void);
void tracing_off(void);
int tracing_is_on(void);
void tracing_snapshot(void);
-int tracing_alloc_snapshot(void);
void tracing_snapshot_alloc(void);
extern void tracing_start(void);
@@ -646,7 +645,6 @@ static inline void tracing_on(void) { }
static inline void tracing_off(void) { }
static inline int tracing_is_on(void) { return 0; }
static inline void tracing_snapshot(void) { }
-static inline int tracing_alloc_snapshot(void) { return -ENODEV; }
static inline void tracing_snapshot_alloc(void) { }
static inline __printf(1, 2)
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index 993f2fe..433bfc5 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -1220,6 +1220,7 @@ struct event_command {
extern int trace_event_enable_disable(struct ftrace_event_file *file,
int enable, int soft_disable);
+extern int tracing_alloc_snapshot(void);
extern const char *__start___trace_bprintk_fmt[];
extern const char *__stop___trace_bprintk_fmt[];
--
1.8.3.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/3] tracing: Add and use event_trigger_lseek()
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-21 22:44 ` Tom Zanussi
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
3 siblings, 0 replies; 6+ messages in thread
From: Tom Zanussi @ 2013-12-21 22:44 UTC (permalink / raw)
To: rostedt; +Cc: linux-kernel, Tom Zanussi
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
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/3] tracing: Add rcu annotation for event_trigger_data.filter
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-21 22:44 ` [PATCH 2/3] tracing: Add and use event_trigger_lseek() Tom Zanussi
@ 2013-12-21 22:44 ` Tom Zanussi
2013-12-21 22:53 ` [PATCH 0/3] tracing: A few trace event triggers fixes Steven Rostedt
3 siblings, 0 replies; 6+ messages in thread
From: Tom Zanussi @ 2013-12-21 22:44 UTC (permalink / raw)
To: rostedt; +Cc: linux-kernel, Tom Zanussi
sparse complains about rcu_assign_pointer() and RCU_INIT_POINTER()
assignments to event_trigger_data filter; annotate it with __rcu to
get rid of the warning.
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
---
kernel/trace/trace.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index 433bfc5..24b16fb 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -1055,7 +1055,7 @@ struct event_trigger_data {
int ref;
struct event_trigger_ops *ops;
struct event_command *cmd_ops;
- struct event_filter *filter;
+ struct event_filter __rcu *filter;
char *filter_str;
void *private_data;
struct list_head list;
--
1.8.3.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 0/3] tracing: A few trace event triggers fixes
2013-12-21 22:43 [PATCH 0/3] tracing: A few trace event triggers fixes Tom Zanussi
` (2 preceding siblings ...)
2013-12-21 22:44 ` [PATCH 3/3] tracing: Add rcu annotation for event_trigger_data.filter Tom Zanussi
@ 2013-12-21 22:53 ` Steven Rostedt
3 siblings, 0 replies; 6+ messages in thread
From: Steven Rostedt @ 2013-12-21 22:53 UTC (permalink / raw)
To: Tom Zanussi; +Cc: linux-kernel
On Sat, 21 Dec 2013 16:43:59 -0600
Tom Zanussi <tom.zanussi@linux.intel.com> wrote:
> This patchset fixes a few sparse warnings and build problems seen
> under certain configurations, as uncovered by the kbuild test robot.
>
> Applies to linux-trace.git ftrace/core.
>
> The following changes since commit 611e9015501ab9597d6a43253813d4efd90936de:
>
> tracing: Add documentation for trace event triggers (2013-12-20 23:24:20 -0500)
Thanks Tom, but I'm also in the process of fixing these up ;-)
>
> are available in the git repository at:
>
> git://git.yoctoproject.org/linux-yocto-contrib.git tzanussi/event-triggers-ftrace-core-kbuild-robot-fixes
> http://git.yoctoproject.org/cgit/cgit.cgi/linux-yocto-contrib/log/?h=tzanussi/event-triggers-ftrace-core-kbuild-robot-fixes
>
> Tom Zanussi (3):
> tracing: Move tracing_alloc_snapshot() declaration to tracing.h
Heh, my fix was just to return -1, but I'll use your fix instead.
> tracing: Add and use event_trigger_lseek()
I've actually changed added a generic tracing_lseek() for all to use.
I'll use my patch instead.
> tracing: Add rcu annotation for event_trigger_data.filter
Running sparse with this change required more than just the added
__rcu that you added (as I did too). I'll fix this up and start testing
as well. I'll post the two patches I did just for you to give an ack
on.
Thanks!
-- Steve
>
> include/linux/kernel.h | 2 --
> kernel/trace/trace.h | 3 ++-
> kernel/trace/trace_events_trigger.c | 15 ++++++++++++++-
> 3 files changed, 16 insertions(+), 4 deletions(-)
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/3] tracing: Move tracing_alloc_snapshot() declaration to tracing.h
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
0 siblings, 0 replies; 6+ messages in thread
From: Steven Rostedt @ 2013-12-22 2:59 UTC (permalink / raw)
To: Tom Zanussi; +Cc: linux-kernel
On Sat, 21 Dec 2013 16:44:00 -0600
Tom Zanussi <tom.zanussi@linux.intel.com> wrote:
> tracing_alloc_snapshot() is only used internally by
> alloc_tracing_snapshot() and trace_event_triggers.c and doesn't need
> to be in kernel.h. Move it to trace.h, which is more appropriate and
> both include.
>
> Reported-by: kbuild test robot <fengguang.wu@intel.com>
> Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
I simply folded this patch into "tracing: Add 'snapshot' event trigger
command".
The ftrace/core branch can be rebased. I haven't put this into my
for-next branch yet which I do not rebase (unless there's a major
reason to do so).
-- Steve
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-12-22 2:59 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH 2/3] tracing: Add and use event_trigger_lseek() Tom Zanussi
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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox