This patch changes filter_check_discard() to make use of the new
ring_buffer_discard_commit() function and modifies the current users to
call the old commit function in the non-discard case. It also
introduces a version of filter_check_discard() that uses the global
trace buffer (filter_current_check_discard()) for those cases.
Signed-off-by: Tom Zanussi <[email protected]>
---
kernel/trace/kmemtrace.c | 10 +++----
kernel/trace/trace.c | 45 ++++++++++++++++++----------------
kernel/trace/trace.h | 14 ++++++++--
kernel/trace/trace_branch.c | 5 +--
kernel/trace/trace_events_stage_3.h | 5 +---
kernel/trace/trace_hw_branches.c | 4 +-
kernel/trace/trace_power.c | 8 +++---
7 files changed, 48 insertions(+), 43 deletions(-)
diff --git a/kernel/trace/kmemtrace.c b/kernel/trace/kmemtrace.c
index 65aba48..91cd0a5 100644
--- a/kernel/trace/kmemtrace.c
+++ b/kernel/trace/kmemtrace.c
@@ -63,9 +63,8 @@ static inline void kmemtrace_alloc(enum kmemtrace_type_id type_id,
entry->gfp_flags = gfp_flags;
entry->node = node;
- filter_check_discard(call, entry, event);
-
- ring_buffer_unlock_commit(tr->buffer, event);
+ if (!filter_check_discard(call, entry, tr->buffer, event))
+ ring_buffer_unlock_commit(tr->buffer, event);
trace_wake_up();
}
@@ -90,9 +89,8 @@ static inline void kmemtrace_free(enum kmemtrace_type_id type_id,
entry->call_site = call_site;
entry->ptr = ptr;
- filter_check_discard(call, entry, event);
-
- ring_buffer_unlock_commit(tr->buffer, event);
+ if (!filter_check_discard(call, entry, tr->buffer, event))
+ ring_buffer_unlock_commit(tr->buffer, event);
trace_wake_up();
}
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 106f1f3..dc3bed6 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -171,6 +171,12 @@ static struct trace_array global_trace;
static DEFINE_PER_CPU(struct trace_array_cpu, global_trace_cpu);
+int filter_current_check_discard(struct ftrace_event_call *call, void *rec,
+ struct ring_buffer_event *event)
+{
+ return filter_check_discard(call, rec, global_trace.buffer, event);
+}
+
cycle_t ftrace_now(int cpu)
{
u64 ts;
@@ -919,9 +925,8 @@ trace_function(struct trace_array *tr,
entry->ip = ip;
entry->parent_ip = parent_ip;
- filter_check_discard(call, entry, event);
-
- ring_buffer_unlock_commit(tr->buffer, event);
+ if (!filter_check_discard(call, entry, tr->buffer, event))
+ ring_buffer_unlock_commit(tr->buffer, event);
}
#ifdef CONFIG_FUNCTION_GRAPH_TRACER
@@ -943,8 +948,8 @@ static int __trace_graph_entry(struct trace_array *tr,
return 0;
entry = ring_buffer_event_data(event);
entry->graph_ent = *trace;
- filter_check_discard(call, entry, event);
- ring_buffer_unlock_commit(global_trace.buffer, event);
+ if (!filter_current_check_discard(call, entry, event))
+ ring_buffer_unlock_commit(global_trace.buffer, event);
return 1;
}
@@ -967,8 +972,8 @@ static void __trace_graph_return(struct trace_array *tr,
return;
entry = ring_buffer_event_data(event);
entry->ret = *trace;
- filter_check_discard(call, entry, event);
- ring_buffer_unlock_commit(global_trace.buffer, event);
+ if (!filter_current_check_discard(call, entry, event))
+ ring_buffer_unlock_commit(global_trace.buffer, event);
}
#endif
@@ -1004,8 +1009,8 @@ static void __ftrace_trace_stack(struct trace_array *tr,
trace.entries = entry->caller;
save_stack_trace(&trace);
- filter_check_discard(call, entry, event);
- ring_buffer_unlock_commit(tr->buffer, event);
+ if (!filter_check_discard(call, entry, tr->buffer, event))
+ ring_buffer_unlock_commit(tr->buffer, event);
#endif
}
@@ -1052,8 +1057,8 @@ static void ftrace_trace_userstack(struct trace_array *tr,
trace.entries = entry->caller;
save_stack_trace_user(&trace);
- filter_check_discard(call, entry, event);
- ring_buffer_unlock_commit(tr->buffer, event);
+ if (!filter_check_discard(call, entry, tr->buffer, event))
+ ring_buffer_unlock_commit(tr->buffer, event);
#endif
}
@@ -1114,9 +1119,8 @@ tracing_sched_switch_trace(struct trace_array *tr,
entry->next_state = next->state;
entry->next_cpu = task_cpu(next);
- filter_check_discard(call, entry, event);
-
- trace_buffer_unlock_commit(tr, event, flags, pc);
+ if (!filter_check_discard(call, entry, tr->buffer, event))
+ trace_buffer_unlock_commit(tr, event, flags, pc);
}
void
@@ -1142,9 +1146,8 @@ tracing_sched_wakeup_trace(struct trace_array *tr,
entry->next_state = wakee->state;
entry->next_cpu = task_cpu(wakee);
- filter_check_discard(call, entry, event);
-
- ring_buffer_unlock_commit(tr->buffer, event);
+ if (!filter_check_discard(call, entry, tr->buffer, event))
+ ring_buffer_unlock_commit(tr->buffer, event);
ftrace_trace_stack(tr, flags, 6, pc);
ftrace_trace_userstack(tr, flags, pc);
}
@@ -1285,8 +1288,8 @@ int trace_vbprintk(unsigned long ip, const char *fmt, va_list args)
entry->fmt = fmt;
memcpy(entry->buf, trace_buf, sizeof(u32) * len);
- filter_check_discard(call, entry, event);
- ring_buffer_unlock_commit(tr->buffer, event);
+ if (!filter_check_discard(call, entry, tr->buffer, event))
+ ring_buffer_unlock_commit(tr->buffer, event);
out_unlock:
__raw_spin_unlock(&trace_buf_lock);
@@ -1341,8 +1344,8 @@ int trace_vprintk(unsigned long ip, const char *fmt, va_list args)
memcpy(&entry->buf, trace_buf, len);
entry->buf[len] = 0;
- filter_check_discard(call, entry, event);
- ring_buffer_unlock_commit(tr->buffer, event);
+ if (!filter_check_discard(call, entry, tr->buffer, event))
+ ring_buffer_unlock_commit(tr->buffer, event);
out_unlock:
__raw_spin_unlock(&trace_buf_lock);
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index cffd1e5..e052bc2 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -860,13 +860,21 @@ extern int filter_match_preds(struct ftrace_event_call *call, void *rec);
extern void filter_free_subsystem_preds(struct event_subsystem *system);
extern int filter_add_subsystem_pred(struct event_subsystem *system,
struct filter_pred *pred);
+extern int filter_current_check_discard(struct ftrace_event_call *call,
+ void *rec,
+ struct ring_buffer_event *event);
-static inline void
+static inline int
filter_check_discard(struct ftrace_event_call *call, void *rec,
+ struct ring_buffer *buffer,
struct ring_buffer_event *event)
{
- if (unlikely(call->preds) && !filter_match_preds(call, rec))
- ring_buffer_event_discard(event);
+ if (unlikely(call->preds) && !filter_match_preds(call, rec)) {
+ ring_buffer_discard_commit(buffer, event);
+ return 1;
+ }
+
+ return 0;
}
#define __common_field(type, item) \
diff --git a/kernel/trace/trace_branch.c b/kernel/trace/trace_branch.c
index c95c25d..6a38a10 100644
--- a/kernel/trace/trace_branch.c
+++ b/kernel/trace/trace_branch.c
@@ -74,9 +74,8 @@ probe_likely_condition(struct ftrace_branch_data *f, int val, int expect)
entry->line = f->line;
entry->correct = val == expect;
- filter_check_discard(call, entry, event);
-
- ring_buffer_unlock_commit(tr->buffer, event);
+ if !(filter_check_discard(call, entry, event))
+ ring_buffer_unlock_commit(tr->buffer, event);
out:
atomic_dec(&tr->data[cpu]->disabled);
diff --git a/kernel/trace/trace_events_stage_3.h b/kernel/trace/trace_events_stage_3.h
index d2f34bf..b2b2982 100644
--- a/kernel/trace/trace_events_stage_3.h
+++ b/kernel/trace/trace_events_stage_3.h
@@ -222,11 +222,8 @@ static void ftrace_raw_event_##call(proto) \
\
assign; \
\
- if (call->preds && !filter_match_preds(call, entry)) \
- trace_current_buffer_discard_commit(event); \
- else \
+ if (!filter_current_check_discard(call, entry, event)) \
trace_nowake_buffer_unlock_commit(event, irq_flags, pc); \
- \
} \
\
static int ftrace_raw_reg_event_##call(void) \
diff --git a/kernel/trace/trace_hw_branches.c b/kernel/trace/trace_hw_branches.c
index e6b275b..8683d50 100644
--- a/kernel/trace/trace_hw_branches.c
+++ b/kernel/trace/trace_hw_branches.c
@@ -195,8 +195,8 @@ void trace_hw_branch(u64 from, u64 to)
entry->ent.type = TRACE_HW_BRANCHES;
entry->from = from;
entry->to = to;
- filter_check_discard(call, entry, event);
- trace_buffer_unlock_commit(tr, event, 0, 0);
+ if (!filter_check_discard(call, entry, tr->buffer, event))
+ trace_buffer_unlock_commit(tr, event, 0, 0);
out:
atomic_dec(&tr->data[cpu]->disabled);
diff --git a/kernel/trace/trace_power.c b/kernel/trace/trace_power.c
index 8ce7d7d..810a5b7 100644
--- a/kernel/trace/trace_power.c
+++ b/kernel/trace/trace_power.c
@@ -55,8 +55,8 @@ static void probe_power_end(struct power_trace *it)
goto out;
entry = ring_buffer_event_data(event);
entry->state_data = *it;
- filter_check_discard(call, entry, event);
- trace_buffer_unlock_commit(tr, event, 0, 0);
+ if (!filter_check_discard(call, entry, tr->buffer, event))
+ trace_buffer_unlock_commit(tr, event, 0, 0);
out:
preempt_enable();
}
@@ -87,8 +87,8 @@ static void probe_power_mark(struct power_trace *it, unsigned int type,
goto out;
entry = ring_buffer_event_data(event);
entry->state_data = *it;
- filter_check_discard(call, entry, event);
- trace_buffer_unlock_commit(tr, event, 0, 0);
+ if (!filter_check_discard(call, entry, tr->buffer, event))
+ trace_buffer_unlock_commit(tr, event, 0, 0);
out:
preempt_enable();
}
--
1.5.6.3
* Tom Zanussi <[email protected]> wrote:
> This patch changes filter_check_discard() to make use of the new
> ring_buffer_discard_commit() function and modifies the current
> users to call the old commit function in the non-discard case. It
> also introduces a version of filter_check_discard() that uses the
> global trace buffer (filter_current_check_discard()) for those
> cases.
Nice!
I've merged it into tip/tracing/filters but it cannot go into
tip/master yet due to build failures. I fixed the obvious typo
problem (find the fix below) but punted on this one for now:
kernel/built-in.o: In function `filter_check_discard':
trace.c:(.text+0x613fc): undefined reference to `filter_match_preds'
kernel/built-in.o: In function `trace_vprintk':
(.text+0x6154f): undefined reference to `event_print'
kernel/built-in.o: In function `trace_vbprintk':
(.text+0x61717): undefined reference to `event_bprint'
kernel/built-in.o: In function `__ftrace_trace_stack':
config attached.
Ingo
Index: linux/kernel/trace/trace_branch.c
===================================================================
--- linux.orig/kernel/trace/trace_branch.c
+++ linux/kernel/trace/trace_branch.c
@@ -74,7 +74,7 @@ probe_likely_condition(struct ftrace_bra
entry->line = f->line;
entry->correct = val == expect;
- if !(filter_check_discard(call, entry, event))
+ if (!(filter_check_discard(call, entry, tr->buffer, event)))
ring_buffer_unlock_commit(tr->buffer, event);
out:
On Tue, 2009-04-07 at 15:08 +0200, Ingo Molnar wrote:
> * Tom Zanussi <[email protected]> wrote:
>
> > This patch changes filter_check_discard() to make use of the new
> > ring_buffer_discard_commit() function and modifies the current
> > users to call the old commit function in the non-discard case. It
> > also introduces a version of filter_check_discard() that uses the
> > global trace buffer (filter_current_check_discard()) for those
> > cases.
>
> Nice!
>
> I've merged it into tip/tracing/filters but it cannot go into
> tip/master yet due to build failures. I fixed the obvious typo
> problem (find the fix below) but punted on this one for now:
>
> kernel/built-in.o: In function `filter_check_discard':
> trace.c:(.text+0x613fc): undefined reference to `filter_match_preds'
> kernel/built-in.o: In function `trace_vprintk':
> (.text+0x6154f): undefined reference to `event_print'
> kernel/built-in.o: In function `trace_vbprintk':
> (.text+0x61717): undefined reference to `event_bprint'
> kernel/built-in.o: In function `__ftrace_trace_stack':
>
> config attached.
>
> Ingo
>
> Index: linux/kernel/trace/trace_branch.c
> ===================================================================
> --- linux.orig/kernel/trace/trace_branch.c
> +++ linux/kernel/trace/trace_branch.c
> @@ -74,7 +74,7 @@ probe_likely_condition(struct ftrace_bra
> entry->line = f->line;
> entry->correct = val == expect;
>
> - if !(filter_check_discard(call, entry, event))
> + if (!(filter_check_discard(call, entry, tr->buffer, event)))
> ring_buffer_unlock_commit(tr->buffer, event);
>
> out:
>
Wow, I can't believe I missed that - didn't have CONFIG_BRANCH_TRACE on
I guess.
As for the other errors, it's the CONFIG_EVENT_TRACER not being turned
on again. I think the tracing config patch below would be a better
solution than the one I previously posted...
It adds a new config option, CONFIG_EVENT_TRACING that gets selected
when CONFIG_TRACING is selected and adds everything needed by the stuff
in trace_export - basically all the event tracing support needed by e.g.
bprint, minus the actual events, which are only included if
CONFIG_EVENT_TRACER is selected. So CONFIG_EVENT_TRACER can be used to
turn on or off the generated events (what I think of as the 'event
tracer'), while CONFIG_EVENT_TRACING turns on or off the base event
tracing support used by both the event tracer and the other things such
as bprint that can't be configured out.
Signed-off-by: Tom Zanussi <[email protected]>
---
include/asm-generic/vmlinux.lds.h | 2 +-
kernel/trace/Kconfig | 4 ++++
kernel/trace/Makefile | 6 +++---
3 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 7fa660f..7e9b1e9 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -61,7 +61,7 @@
#define BRANCH_PROFILE()
#endif
-#ifdef CONFIG_EVENT_TRACER
+#ifdef CONFIG_EVENT_TRACING
#define FTRACE_EVENTS() VMLINUX_SYMBOL(__start_ftrace_events) = .; \
*(_ftrace_events) \
VMLINUX_SYMBOL(__stop_ftrace_events) = .;
diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig
index 23b96eb..644606e 100644
--- a/kernel/trace/Kconfig
+++ b/kernel/trace/Kconfig
@@ -48,6 +48,9 @@ config FTRACE_NMI_ENTER
depends on HAVE_FTRACE_NMI_ENTER
default y
+config EVENT_TRACING
+ bool
+
config TRACING
bool
select DEBUG_FS
@@ -56,6 +59,7 @@ config TRACING
select TRACEPOINTS
select NOP_TRACER
select BINARY_PRINTF
+ select EVENT_TRACING
#
# Minimum requirements an architecture has to meet for us to
diff --git a/kernel/trace/Makefile b/kernel/trace/Makefile
index 2630f51..3ad367e 100644
--- a/kernel/trace/Makefile
+++ b/kernel/trace/Makefile
@@ -40,11 +40,11 @@ obj-$(CONFIG_POWER_TRACER) += trace_power.o
obj-$(CONFIG_KMEMTRACE) += kmemtrace.o
obj-$(CONFIG_WORKQUEUE_TRACER) += trace_workqueue.o
obj-$(CONFIG_BLK_DEV_IO_TRACE) += blktrace.o
-obj-$(CONFIG_EVENT_TRACER) += trace_events.o
+obj-$(CONFIG_EVENT_TRACING) += trace_events.o
obj-$(CONFIG_EVENT_TRACER) += events.o
-obj-$(CONFIG_EVENT_TRACER) += trace_export.o
+obj-$(CONFIG_EVENT_TRACING) += trace_export.o
obj-$(CONFIG_FTRACE_SYSCALLS) += trace_syscalls.o
obj-$(CONFIG_EVENT_PROFILE) += trace_event_profile.o
-obj-$(CONFIG_EVENT_TRACER) += trace_events_filter.o
+obj-$(CONFIG_EVENT_TRACING) += trace_events_filter.o
libftrace-y := ftrace.o
--
1.5.6.3
* Tom Zanussi <[email protected]> wrote:
> As for the other errors, it's the CONFIG_EVENT_TRACER not being
> turned on again. I think the tracing config patch below would be
> a better solution than the one I previously posted...
Agreed, this is a very nice patch, i have applied it. I'll check
whether this solves all the build problems.
This fits nicely into the 'tracing plugin life cycle' and basically
this is what we want to see happen for ftrace plugins: they first
start as standalone experiments. Once they prove to be useful and
other tracer plugins desire its capabilities too, they become part
of the tracing infrastructure, not part of a standalone plugin.
This gives some leeway in allowing people to do plugins even if
plugin utility is not immediately obvious, and we can then observe
its use and let features/capabilities percolate down into the core
code.
There's also plugin functionality that works best when left
standalone - they are specifically shaped for one very particular
development activity: for example mmiotrace to debug drivers.
It's a bit like how Firefox developers manage their plugin space,
and this concept seems to have worked well in a number of cases in
the tracing tree too.
Ingo
On Wed, Apr 08, 2009 at 03:14:01AM -0500, Tom Zanussi wrote:
> On Tue, 2009-04-07 at 15:08 +0200, Ingo Molnar wrote:
> > * Tom Zanussi <[email protected]> wrote:
> >
> > > This patch changes filter_check_discard() to make use of the new
> > > ring_buffer_discard_commit() function and modifies the current
> > > users to call the old commit function in the non-discard case. It
> > > also introduces a version of filter_check_discard() that uses the
> > > global trace buffer (filter_current_check_discard()) for those
> > > cases.
> >
> > Nice!
> >
> > I've merged it into tip/tracing/filters but it cannot go into
> > tip/master yet due to build failures. I fixed the obvious typo
> > problem (find the fix below) but punted on this one for now:
> >
> > kernel/built-in.o: In function `filter_check_discard':
> > trace.c:(.text+0x613fc): undefined reference to `filter_match_preds'
> > kernel/built-in.o: In function `trace_vprintk':
> > (.text+0x6154f): undefined reference to `event_print'
> > kernel/built-in.o: In function `trace_vbprintk':
> > (.text+0x61717): undefined reference to `event_bprint'
> > kernel/built-in.o: In function `__ftrace_trace_stack':
> >
> > config attached.
> >
> > Ingo
> >
> > Index: linux/kernel/trace/trace_branch.c
> > ===================================================================
> > --- linux.orig/kernel/trace/trace_branch.c
> > +++ linux/kernel/trace/trace_branch.c
> > @@ -74,7 +74,7 @@ probe_likely_condition(struct ftrace_bra
> > entry->line = f->line;
> > entry->correct = val == expect;
> >
> > - if !(filter_check_discard(call, entry, event))
> > + if (!(filter_check_discard(call, entry, tr->buffer, event)))
> > ring_buffer_unlock_commit(tr->buffer, event);
> >
> > out:
> >
>
> Wow, I can't believe I missed that - didn't have CONFIG_BRANCH_TRACE on
> I guess.
>
> As for the other errors, it's the CONFIG_EVENT_TRACER not being turned
> on again. I think the tracing config patch below would be a better
> solution than the one I previously posted...
>
> It adds a new config option, CONFIG_EVENT_TRACING that gets selected
> when CONFIG_TRACING is selected and adds everything needed by the stuff
> in trace_export - basically all the event tracing support needed by e.g.
> bprint, minus the actual events, which are only included if
> CONFIG_EVENT_TRACER is selected. So CONFIG_EVENT_TRACER can be used to
> turn on or off the generated events (what I think of as the 'event
> tracer'), while CONFIG_EVENT_TRACING turns on or off the base event
> tracing support used by both the event tracer and the other things such
> as bprint that can't be configured out.
>
> Signed-off-by: Tom Zanussi <[email protected]>
>
> ---
> include/asm-generic/vmlinux.lds.h | 2 +-
> kernel/trace/Kconfig | 4 ++++
> kernel/trace/Makefile | 6 +++---
> 3 files changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
> index 7fa660f..7e9b1e9 100644
> --- a/include/asm-generic/vmlinux.lds.h
> +++ b/include/asm-generic/vmlinux.lds.h
> @@ -61,7 +61,7 @@
> #define BRANCH_PROFILE()
> #endif
>
> -#ifdef CONFIG_EVENT_TRACER
> +#ifdef CONFIG_EVENT_TRACING
> #define FTRACE_EVENTS() VMLINUX_SYMBOL(__start_ftrace_events) = .; \
> *(_ftrace_events) \
> VMLINUX_SYMBOL(__stop_ftrace_events) = .;
> diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig
> index 23b96eb..644606e 100644
> --- a/kernel/trace/Kconfig
> +++ b/kernel/trace/Kconfig
> @@ -48,6 +48,9 @@ config FTRACE_NMI_ENTER
> depends on HAVE_FTRACE_NMI_ENTER
> default y
>
> +config EVENT_TRACING
> + bool
> +
> config TRACING
> bool
> select DEBUG_FS
> @@ -56,6 +59,7 @@ config TRACING
> select TRACEPOINTS
> select NOP_TRACER
> select BINARY_PRINTF
> + select EVENT_TRACING
>
> #
> # Minimum requirements an architecture has to meet for us to
> diff --git a/kernel/trace/Makefile b/kernel/trace/Makefile
> index 2630f51..3ad367e 100644
> --- a/kernel/trace/Makefile
> +++ b/kernel/trace/Makefile
> @@ -40,11 +40,11 @@ obj-$(CONFIG_POWER_TRACER) += trace_power.o
> obj-$(CONFIG_KMEMTRACE) += kmemtrace.o
> obj-$(CONFIG_WORKQUEUE_TRACER) += trace_workqueue.o
> obj-$(CONFIG_BLK_DEV_IO_TRACE) += blktrace.o
> -obj-$(CONFIG_EVENT_TRACER) += trace_events.o
> +obj-$(CONFIG_EVENT_TRACING) += trace_events.o
> obj-$(CONFIG_EVENT_TRACER) += events.o
> -obj-$(CONFIG_EVENT_TRACER) += trace_export.o
> +obj-$(CONFIG_EVENT_TRACING) += trace_export.o
> obj-$(CONFIG_FTRACE_SYSCALLS) += trace_syscalls.o
> obj-$(CONFIG_EVENT_PROFILE) += trace_event_profile.o
> -obj-$(CONFIG_EVENT_TRACER) += trace_events_filter.o
> +obj-$(CONFIG_EVENT_TRACING) += trace_events_filter.o
>
> libftrace-y := ftrace.o
> --
> 1.5.6.3
>
>
>
Yeah, looks good this way!
Commit-ID: 5f77a88b3f8268b11940b51d2e03d26a663ceb90
Gitweb: http://git.kernel.org/tip/5f77a88b3f8268b11940b51d2e03d26a663ceb90
Author: Tom Zanussi <[email protected]>
AuthorDate: Wed, 8 Apr 2009 03:14:01 -0500
Committer: Ingo Molnar <[email protected]>
CommitDate: Tue, 14 Apr 2009 00:00:55 +0200
tracing/infrastructure: separate event tracer from event support
Add a new config option, CONFIG_EVENT_TRACING that gets selected
when CONFIG_TRACING is selected and adds everything needed by the stuff
in trace_export - basically all the event tracing support needed by e.g.
bprint, minus the actual events, which are only included if
CONFIG_EVENT_TRACER is selected.
So CONFIG_EVENT_TRACER can be used to turn on or off the generated events
(what I think of as the 'event tracer'), while CONFIG_EVENT_TRACING turns
on or off the base event tracing support used by both the event tracer and
the other things such as bprint that can't be configured out.
Signed-off-by: Tom Zanussi <[email protected]>
Cc: Steven Rostedt <[email protected]>
Cc: [email protected]
LKML-Reference: <1239178441.10295.34.camel@tropicana>
Signed-off-by: Ingo Molnar <[email protected]>
---
include/asm-generic/vmlinux.lds.h | 2 +-
kernel/trace/Kconfig | 4 ++++
kernel/trace/Makefile | 6 +++---
3 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 7fa660f..7e9b1e9 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -61,7 +61,7 @@
#define BRANCH_PROFILE()
#endif
-#ifdef CONFIG_EVENT_TRACER
+#ifdef CONFIG_EVENT_TRACING
#define FTRACE_EVENTS() VMLINUX_SYMBOL(__start_ftrace_events) = .; \
*(_ftrace_events) \
VMLINUX_SYMBOL(__stop_ftrace_events) = .;
diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig
index 23b96eb..644606e 100644
--- a/kernel/trace/Kconfig
+++ b/kernel/trace/Kconfig
@@ -48,6 +48,9 @@ config FTRACE_NMI_ENTER
depends on HAVE_FTRACE_NMI_ENTER
default y
+config EVENT_TRACING
+ bool
+
config TRACING
bool
select DEBUG_FS
@@ -56,6 +59,7 @@ config TRACING
select TRACEPOINTS
select NOP_TRACER
select BINARY_PRINTF
+ select EVENT_TRACING
#
# Minimum requirements an architecture has to meet for us to
diff --git a/kernel/trace/Makefile b/kernel/trace/Makefile
index 2630f51..3ad367e 100644
--- a/kernel/trace/Makefile
+++ b/kernel/trace/Makefile
@@ -40,11 +40,11 @@ obj-$(CONFIG_POWER_TRACER) += trace_power.o
obj-$(CONFIG_KMEMTRACE) += kmemtrace.o
obj-$(CONFIG_WORKQUEUE_TRACER) += trace_workqueue.o
obj-$(CONFIG_BLK_DEV_IO_TRACE) += blktrace.o
-obj-$(CONFIG_EVENT_TRACER) += trace_events.o
+obj-$(CONFIG_EVENT_TRACING) += trace_events.o
obj-$(CONFIG_EVENT_TRACER) += events.o
-obj-$(CONFIG_EVENT_TRACER) += trace_export.o
+obj-$(CONFIG_EVENT_TRACING) += trace_export.o
obj-$(CONFIG_FTRACE_SYSCALLS) += trace_syscalls.o
obj-$(CONFIG_EVENT_PROFILE) += trace_event_profile.o
-obj-$(CONFIG_EVENT_TRACER) += trace_events_filter.o
+obj-$(CONFIG_EVENT_TRACING) += trace_events_filter.o
libftrace-y := ftrace.o
Ug, this change is pretty meaningless with the new event tracing patches
that I'm trying to finish.
On Mon, 13 Apr 2009, tip-bot for Tom Zanussi wrote:
> Commit-ID: 5f77a88b3f8268b11940b51d2e03d26a663ceb90
> Gitweb: http://git.kernel.org/tip/5f77a88b3f8268b11940b51d2e03d26a663ceb90
> Author: Tom Zanussi <[email protected]>
> AuthorDate: Wed, 8 Apr 2009 03:14:01 -0500
> Committer: Ingo Molnar <[email protected]>
> CommitDate: Tue, 14 Apr 2009 00:00:55 +0200
>
> tracing/infrastructure: separate event tracer from event support
>
> Add a new config option, CONFIG_EVENT_TRACING that gets selected
> when CONFIG_TRACING is selected and adds everything needed by the stuff
> in trace_export - basically all the event tracing support needed by e.g.
> bprint, minus the actual events, which are only included if
> CONFIG_EVENT_TRACER is selected.
>
> So CONFIG_EVENT_TRACER can be used to turn on or off the generated events
> (what I think of as the 'event tracer'), while CONFIG_EVENT_TRACING turns
> on or off the base event tracing support used by both the event tracer and
> the other things such as bprint that can't be configured out.
>
> Signed-off-by: Tom Zanussi <[email protected]>
> Cc: Steven Rostedt <[email protected]>
> Cc: [email protected]
> LKML-Reference: <1239178441.10295.34.camel@tropicana>
> Signed-off-by: Ingo Molnar <[email protected]>
>
>
> ---
> include/asm-generic/vmlinux.lds.h | 2 +-
> kernel/trace/Kconfig | 4 ++++
> kernel/trace/Makefile | 6 +++---
> 3 files changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
> index 7fa660f..7e9b1e9 100644
> --- a/include/asm-generic/vmlinux.lds.h
> +++ b/include/asm-generic/vmlinux.lds.h
> @@ -61,7 +61,7 @@
> #define BRANCH_PROFILE()
> #endif
>
> -#ifdef CONFIG_EVENT_TRACER
> +#ifdef CONFIG_EVENT_TRACING
> #define FTRACE_EVENTS() VMLINUX_SYMBOL(__start_ftrace_events) = .; \
> *(_ftrace_events) \
> VMLINUX_SYMBOL(__stop_ftrace_events) = .;
> diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig
> index 23b96eb..644606e 100644
> --- a/kernel/trace/Kconfig
> +++ b/kernel/trace/Kconfig
> @@ -48,6 +48,9 @@ config FTRACE_NMI_ENTER
> depends on HAVE_FTRACE_NMI_ENTER
> default y
>
> +config EVENT_TRACING
> + bool
> +
> config TRACING
> bool
> select DEBUG_FS
> @@ -56,6 +59,7 @@ config TRACING
> select TRACEPOINTS
> select NOP_TRACER
> select BINARY_PRINTF
> + select EVENT_TRACING
>
> #
> # Minimum requirements an architecture has to meet for us to
> diff --git a/kernel/trace/Makefile b/kernel/trace/Makefile
> index 2630f51..3ad367e 100644
> --- a/kernel/trace/Makefile
> +++ b/kernel/trace/Makefile
> @@ -40,11 +40,11 @@ obj-$(CONFIG_POWER_TRACER) += trace_power.o
> obj-$(CONFIG_KMEMTRACE) += kmemtrace.o
> obj-$(CONFIG_WORKQUEUE_TRACER) += trace_workqueue.o
> obj-$(CONFIG_BLK_DEV_IO_TRACE) += blktrace.o
> -obj-$(CONFIG_EVENT_TRACER) += trace_events.o
> +obj-$(CONFIG_EVENT_TRACING) += trace_events.o
> obj-$(CONFIG_EVENT_TRACER) += events.o
The only thing left that uses EVENT_TRACER no longer exists :-/
-- Steve
> -obj-$(CONFIG_EVENT_TRACER) += trace_export.o
> +obj-$(CONFIG_EVENT_TRACING) += trace_export.o
> obj-$(CONFIG_FTRACE_SYSCALLS) += trace_syscalls.o
> obj-$(CONFIG_EVENT_PROFILE) += trace_event_profile.o
> -obj-$(CONFIG_EVENT_TRACER) += trace_events_filter.o
> +obj-$(CONFIG_EVENT_TRACING) += trace_events_filter.o
>
> libftrace-y := ftrace.o
>