* [PATCH 0/8] [GIT PULL] TRACE_EVENT for modules
@ 2009-04-14 17:23 Steven Rostedt
2009-04-14 17:23 ` [PATCH 1/8] tracing: consolidate trace and trace_event headers Steven Rostedt
` (10 more replies)
0 siblings, 11 replies; 60+ messages in thread
From: Steven Rostedt @ 2009-04-14 17:23 UTC (permalink / raw)
To: linux-kernel
Cc: Ingo Molnar, Andrew Morton, Thomas Gleixner, Peter Zijlstra,
Frederic Weisbecker, Theodore Tso, Arjan van de Ven,
Christoph Hellwig, Mathieu Desnoyers, Jeremy Fitzhardinge,
Lai Jiangshan, Zhaolei, Li Zefan, KOSAKI Motohiro,
Masami Hiramatsu, Frank Ch. Eigler, Tom Zanussi, Jiaying Zhang,
Michael Rubin, Martin Bligh
Ingo,
This is the long awaited TRACE_EVENT for modules patch series.
Not only does it allow for modules to use the TRACE_EVENT infrastructure,
but it also cleans up the way TRACE_EVENTS are used in core kernel code.
Some of the clean ups are:
Removal of the two headers per trace system. No need to have
include/trace/sched.h and include/linux/sched_event_types.h
All the changes go into include/trace/sched.h. But note that how that
file is made is important. One could look at the sched.h file, or
skb.h, lockdep.h and kmem.h as an example.
Another clean up is that I got rid of the need to add these files
into include/trace/trace_events.h and include/trace/trace_event_types.h.
Those files have been deleted.
Another clean up is that we do not need to do the DEFINE_TRACE(name)
for every TRACE_EVENT (or TRACE_FORMAT and DECLARE_TRACE) in the
include/trace/ header. One only needs to define a CREATE_TRACE_POINTS
in one C file to do the work for them:
#define CREATE_TRACE_POINTS
#inlude <trace/sched.h>
That will do the DEFINE_TRACE for every defined trace item in sched.h.
I also removed the trace_events_stage_X.h files and combined them
into a include/trace/ftrace.h file.
I made sure that each stage did not break the code. Well, I tested
kmem at each level. kmem seems to be the most complex of the trace events.
At the end I made a module and tested it out as well. I even removed
the module as the trace was running. Note, if you remove the file
and view the trace, you will get something like:
<...>-4197 [002] 205.524992: Unknown type 47
<...>-4197 [002] 206.523325: Unknown type 47
<...>-4197 [002] 207.521665: Unknown type 47
<...>-4197 [002] 208.520118: Unknown type 47
The unknown type will appear. This is because the format to print the
string is in the module itself. When the code is removed, ftrace has
no way of knowing how to print that string out. But if you had a user
space tool that read the format file first, it could still parse the binary
data just fine.
Please pull the latest tip/tracing/core tree, which can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace.git
tip/tracing/core
Steven Rostedt (8):
tracing: consolidate trace and trace_event headers
tracing: create automated trace defines
tracing: make trace_seq operations available for core kernel
tracing/events: move declarations from trace directory to core include
tracing/events: move the ftrace event tracing code to core
tracing/events: convert event call sites to use a link list
tracing/events: add export symbols for trace events in modules
tracing/events: add support for modules to TRACE_EVENT
----
include/linux/ftrace_event.h | 150 +++++++++++
include/linux/module.h | 4 +
include/linux/trace_seq.h | 91 +++++++
include/linux/tracepoint.h | 9 +-
include/trace/define_trace.h | 79 ++++++
include/trace/ftrace.h | 493 +++++++++++++++++++++++++++++++++++
include/trace/irq.h | 56 ++++-
include/trace/irq_event_types.h | 55 ----
include/trace/kmem.h | 189 +++++++++++++-
include/trace/lockdep.h | 55 ++++-
include/trace/lockdep_event_types.h | 57 ----
include/trace/sched.h | 336 +++++++++++++++++++++++-
include/trace/sched_event_types.h | 337 ------------------------
include/trace/skb.h | 39 +++-
include/trace/skb_event_types.h | 38 ---
include/trace/trace_event_types.h | 7 -
include/trace/trace_events.h | 7 -
kernel/exit.c | 4 -
kernel/fork.c | 2 -
kernel/irq/handle.c | 7 +-
kernel/kthread.c | 3 -
kernel/lockdep.c | 12 +-
kernel/module.c | 7 +
kernel/sched.c | 10 +-
kernel/signal.c | 2 -
kernel/softirq.c | 3 -
kernel/trace/Makefile | 1 -
kernel/trace/events.c | 14 -
kernel/trace/trace.c | 3 +
kernel/trace/trace.h | 148 +----------
kernel/trace/trace_event_profile.c | 4 +-
kernel/trace/trace_events.c | 170 +++++++++----
kernel/trace/trace_events_filter.c | 10 +-
kernel/trace/trace_events_stage_1.h | 39 ---
kernel/trace/trace_events_stage_2.h | 170 ------------
kernel/trace/trace_events_stage_3.h | 279 --------------------
kernel/trace/trace_output.c | 3 +
kernel/trace/trace_output.h | 30 +--
mm/util.c | 11 +-
net/core/net-traces.c | 4 +-
40 files changed, 1648 insertions(+), 1290 deletions(-)
--
^ permalink raw reply [flat|nested] 60+ messages in thread
* [PATCH 1/8] tracing: consolidate trace and trace_event headers
2009-04-14 17:23 [PATCH 0/8] [GIT PULL] TRACE_EVENT for modules Steven Rostedt
@ 2009-04-14 17:23 ` Steven Rostedt
2009-04-14 21:51 ` Frederic Weisbecker
2009-04-14 17:23 ` [PATCH 2/8] tracing: create automated trace defines Steven Rostedt
` (9 subsequent siblings)
10 siblings, 1 reply; 60+ messages in thread
From: Steven Rostedt @ 2009-04-14 17:23 UTC (permalink / raw)
To: linux-kernel
Cc: Ingo Molnar, Andrew Morton, Thomas Gleixner, Peter Zijlstra,
Frederic Weisbecker, Theodore Tso, Arjan van de Ven,
Christoph Hellwig, Mathieu Desnoyers, Jeremy Fitzhardinge,
Lai Jiangshan, Zhaolei, Li Zefan, KOSAKI Motohiro,
Masami Hiramatsu, Frank Ch. Eigler, Tom Zanussi, Jiaying Zhang,
Michael Rubin, Martin Bligh, Jason Baron, Mathieu Desnoyers
[-- Attachment #1: 0001-tracing-consolidate-trace-and-trace_event-headers.patch --]
[-- Type: text/plain, Size: 34614 bytes --]
From: Steven Rostedt <srostedt@redhat.com>
Impact: clean up
Neil Horman (et. al.) criticized the way the trace events were broken up
into two files. The reason for that was that ftrace needed to separate out
the declarations from where the #include <linux/tracepoint.h> was used.
It then dawned on me that the tracepoint.h header only needs to define the
TRACE_EVENT macro if it is not already defined.
The solution is simply to test if TRACE_EVENT is defined, and if it is not
then the linux/tracepoint.h header can define it. This change consolidates
all the <traces>.h and <traces>_event_types.h into the <traces>.h file.
Reported-by: Neil Horman <nhorman@tuxdriver.com>
Reported-by: Theodore Tso <tytso@mit.edu>
Reported-by: Jiaying Zhang <jiayingz@google.com>
Cc: Zhaolei <zhaolei@cn.fujitsu.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Jason Baron <jbaron@redhat.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
include/linux/tracepoint.h | 9 +-
include/trace/irq.h | 51 +++++-
include/trace/irq_event_types.h | 55 ------
include/trace/kmem.h | 189 +++++++++++++++++++-
include/trace/lockdep.h | 52 +++++-
include/trace/lockdep_event_types.h | 57 ------
include/trace/sched.h | 333 ++++++++++++++++++++++++++++++++++-
include/trace/sched_event_types.h | 337 -----------------------------------
include/trace/skb.h | 36 ++++-
include/trace/skb_event_types.h | 38 ----
include/trace/trace_event_types.h | 7 -
kernel/trace/events.c | 1 +
kernel/trace/trace_events_stage_1.h | 4 +-
kernel/trace/trace_events_stage_2.h | 8 +-
kernel/trace/trace_events_stage_3.h | 4 +-
15 files changed, 663 insertions(+), 518 deletions(-)
delete mode 100644 include/trace/irq_event_types.h
delete mode 100644 include/trace/lockdep_event_types.h
delete mode 100644 include/trace/sched_event_types.h
delete mode 100644 include/trace/skb_event_types.h
delete mode 100644 include/trace/trace_event_types.h
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h
index d35a7ee..4353f3f 100644
--- a/include/linux/tracepoint.h
+++ b/include/linux/tracepoint.h
@@ -31,6 +31,8 @@ struct tracepoint {
* Keep in sync with vmlinux.lds.h.
*/
+#ifndef DECLARE_TRACE
+
#define TP_PROTO(args...) args
#define TP_ARGS(args...) args
@@ -114,6 +116,7 @@ static inline void tracepoint_update_probe_range(struct tracepoint *begin,
struct tracepoint *end)
{ }
#endif /* CONFIG_TRACEPOINTS */
+#endif /* DECLARE_TRACE */
/*
* Connect a probe to a tracepoint.
@@ -154,10 +157,13 @@ static inline void tracepoint_synchronize_unregister(void)
}
#define PARAMS(args...) args
+
+#ifndef TRACE_FORMAT
#define TRACE_FORMAT(name, proto, args, fmt) \
DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
+#endif
-
+#ifndef TRACE_EVENT
/*
* For use with the TRACE_EVENT macro:
*
@@ -262,5 +268,6 @@ static inline void tracepoint_synchronize_unregister(void)
#define TRACE_EVENT(name, proto, args, struct, assign, print) \
DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
+#endif
#endif
diff --git a/include/trace/irq.h b/include/trace/irq.h
index ff5d449..04ab4c6 100644
--- a/include/trace/irq.h
+++ b/include/trace/irq.h
@@ -1,9 +1,54 @@
-#ifndef _TRACE_IRQ_H
+#if !defined(_TRACE_IRQ_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_IRQ_H
-#include <linux/interrupt.h>
#include <linux/tracepoint.h>
+#include <linux/interrupt.h>
+
+#undef TRACE_SYSTEM
+#define TRACE_SYSTEM irq
+
+/*
+ * Tracepoint for entry of interrupt handler:
+ */
+TRACE_FORMAT(irq_handler_entry,
+ TP_PROTO(int irq, struct irqaction *action),
+ TP_ARGS(irq, action),
+ TP_FMT("irq=%d handler=%s", irq, action->name)
+ );
+
+/*
+ * Tracepoint for return of an interrupt handler:
+ */
+TRACE_EVENT(irq_handler_exit,
+
+ TP_PROTO(int irq, struct irqaction *action, int ret),
+
+ TP_ARGS(irq, action, ret),
+
+ TP_STRUCT__entry(
+ __field( int, irq )
+ __field( int, ret )
+ ),
+
+ TP_fast_assign(
+ __entry->irq = irq;
+ __entry->ret = ret;
+ ),
+
+ TP_printk("irq=%d return=%s",
+ __entry->irq, __entry->ret ? "handled" : "unhandled")
+);
+
+TRACE_FORMAT(softirq_entry,
+ TP_PROTO(struct softirq_action *h, struct softirq_action *vec),
+ TP_ARGS(h, vec),
+ TP_FMT("softirq=%d action=%s", (int)(h - vec), softirq_to_name[h-vec])
+ );
-#include <trace/irq_event_types.h>
+TRACE_FORMAT(softirq_exit,
+ TP_PROTO(struct softirq_action *h, struct softirq_action *vec),
+ TP_ARGS(h, vec),
+ TP_FMT("softirq=%d action=%s", (int)(h - vec), softirq_to_name[h-vec])
+ );
#endif
diff --git a/include/trace/irq_event_types.h b/include/trace/irq_event_types.h
deleted file mode 100644
index 85964eb..0000000
--- a/include/trace/irq_event_types.h
+++ /dev/null
@@ -1,55 +0,0 @@
-
-/* use <trace/irq.h> instead */
-#ifndef TRACE_FORMAT
-# error Do not include this file directly.
-# error Unless you know what you are doing.
-#endif
-
-#undef TRACE_SYSTEM
-#define TRACE_SYSTEM irq
-
-/*
- * Tracepoint for entry of interrupt handler:
- */
-TRACE_FORMAT(irq_handler_entry,
- TP_PROTO(int irq, struct irqaction *action),
- TP_ARGS(irq, action),
- TP_FMT("irq=%d handler=%s", irq, action->name)
- );
-
-/*
- * Tracepoint for return of an interrupt handler:
- */
-TRACE_EVENT(irq_handler_exit,
-
- TP_PROTO(int irq, struct irqaction *action, int ret),
-
- TP_ARGS(irq, action, ret),
-
- TP_STRUCT__entry(
- __field( int, irq )
- __field( int, ret )
- ),
-
- TP_fast_assign(
- __entry->irq = irq;
- __entry->ret = ret;
- ),
-
- TP_printk("irq=%d return=%s",
- __entry->irq, __entry->ret ? "handled" : "unhandled")
-);
-
-TRACE_FORMAT(softirq_entry,
- TP_PROTO(struct softirq_action *h, struct softirq_action *vec),
- TP_ARGS(h, vec),
- TP_FMT("softirq=%d action=%s", (int)(h - vec), softirq_to_name[h-vec])
- );
-
-TRACE_FORMAT(softirq_exit,
- TP_PROTO(struct softirq_action *h, struct softirq_action *vec),
- TP_ARGS(h, vec),
- TP_FMT("softirq=%d action=%s", (int)(h - vec), softirq_to_name[h-vec])
- );
-
-#undef TRACE_SYSTEM
diff --git a/include/trace/kmem.h b/include/trace/kmem.h
index 46efc24..d7d1218 100644
--- a/include/trace/kmem.h
+++ b/include/trace/kmem.h
@@ -1,9 +1,192 @@
-#ifndef _TRACE_KMEM_H
+#if !defined(_TRACE_KMEM_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_KMEM_H
#include <linux/types.h>
#include <linux/tracepoint.h>
-#include <trace/kmem_event_types.h>
+#undef TRACE_SYSTEM
+#define TRACE_SYSTEM kmem
-#endif /* _TRACE_KMEM_H */
+TRACE_EVENT(kmalloc,
+
+ TP_PROTO(unsigned long call_site,
+ const void *ptr,
+ size_t bytes_req,
+ size_t bytes_alloc,
+ gfp_t gfp_flags),
+
+ TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags),
+
+ TP_STRUCT__entry(
+ __field( unsigned long, call_site )
+ __field( const void *, ptr )
+ __field( size_t, bytes_req )
+ __field( size_t, bytes_alloc )
+ __field( gfp_t, gfp_flags )
+ ),
+
+ TP_fast_assign(
+ __entry->call_site = call_site;
+ __entry->ptr = ptr;
+ __entry->bytes_req = bytes_req;
+ __entry->bytes_alloc = bytes_alloc;
+ __entry->gfp_flags = gfp_flags;
+ ),
+
+ TP_printk("call_site=%lx ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%08x",
+ __entry->call_site,
+ __entry->ptr,
+ __entry->bytes_req,
+ __entry->bytes_alloc,
+ __entry->gfp_flags)
+);
+
+TRACE_EVENT(kmem_cache_alloc,
+
+ TP_PROTO(unsigned long call_site,
+ const void *ptr,
+ size_t bytes_req,
+ size_t bytes_alloc,
+ gfp_t gfp_flags),
+
+ TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags),
+
+ TP_STRUCT__entry(
+ __field( unsigned long, call_site )
+ __field( const void *, ptr )
+ __field( size_t, bytes_req )
+ __field( size_t, bytes_alloc )
+ __field( gfp_t, gfp_flags )
+ ),
+
+ TP_fast_assign(
+ __entry->call_site = call_site;
+ __entry->ptr = ptr;
+ __entry->bytes_req = bytes_req;
+ __entry->bytes_alloc = bytes_alloc;
+ __entry->gfp_flags = gfp_flags;
+ ),
+
+ TP_printk("call_site=%lx ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%08x",
+ __entry->call_site,
+ __entry->ptr,
+ __entry->bytes_req,
+ __entry->bytes_alloc,
+ __entry->gfp_flags)
+);
+
+TRACE_EVENT(kmalloc_node,
+
+ TP_PROTO(unsigned long call_site,
+ const void *ptr,
+ size_t bytes_req,
+ size_t bytes_alloc,
+ gfp_t gfp_flags,
+ int node),
+
+ TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags, node),
+
+ TP_STRUCT__entry(
+ __field( unsigned long, call_site )
+ __field( const void *, ptr )
+ __field( size_t, bytes_req )
+ __field( size_t, bytes_alloc )
+ __field( gfp_t, gfp_flags )
+ __field( int, node )
+ ),
+
+ TP_fast_assign(
+ __entry->call_site = call_site;
+ __entry->ptr = ptr;
+ __entry->bytes_req = bytes_req;
+ __entry->bytes_alloc = bytes_alloc;
+ __entry->gfp_flags = gfp_flags;
+ __entry->node = node;
+ ),
+
+ TP_printk("call_site=%lx ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%08x node=%d",
+ __entry->call_site,
+ __entry->ptr,
+ __entry->bytes_req,
+ __entry->bytes_alloc,
+ __entry->gfp_flags,
+ __entry->node)
+);
+
+TRACE_EVENT(kmem_cache_alloc_node,
+
+ TP_PROTO(unsigned long call_site,
+ const void *ptr,
+ size_t bytes_req,
+ size_t bytes_alloc,
+ gfp_t gfp_flags,
+ int node),
+
+ TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags, node),
+
+ TP_STRUCT__entry(
+ __field( unsigned long, call_site )
+ __field( const void *, ptr )
+ __field( size_t, bytes_req )
+ __field( size_t, bytes_alloc )
+ __field( gfp_t, gfp_flags )
+ __field( int, node )
+ ),
+
+ TP_fast_assign(
+ __entry->call_site = call_site;
+ __entry->ptr = ptr;
+ __entry->bytes_req = bytes_req;
+ __entry->bytes_alloc = bytes_alloc;
+ __entry->gfp_flags = gfp_flags;
+ __entry->node = node;
+ ),
+
+ TP_printk("call_site=%lx ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%08x node=%d",
+ __entry->call_site,
+ __entry->ptr,
+ __entry->bytes_req,
+ __entry->bytes_alloc,
+ __entry->gfp_flags,
+ __entry->node)
+);
+
+TRACE_EVENT(kfree,
+
+ TP_PROTO(unsigned long call_site, const void *ptr),
+
+ TP_ARGS(call_site, ptr),
+
+ TP_STRUCT__entry(
+ __field( unsigned long, call_site )
+ __field( const void *, ptr )
+ ),
+
+ TP_fast_assign(
+ __entry->call_site = call_site;
+ __entry->ptr = ptr;
+ ),
+
+ TP_printk("call_site=%lx ptr=%p", __entry->call_site, __entry->ptr)
+);
+
+TRACE_EVENT(kmem_cache_free,
+
+ TP_PROTO(unsigned long call_site, const void *ptr),
+
+ TP_ARGS(call_site, ptr),
+
+ TP_STRUCT__entry(
+ __field( unsigned long, call_site )
+ __field( const void *, ptr )
+ ),
+
+ TP_fast_assign(
+ __entry->call_site = call_site;
+ __entry->ptr = ptr;
+ ),
+
+ TP_printk("call_site=%lx ptr=%p", __entry->call_site, __entry->ptr)
+);
+
+#endif
diff --git a/include/trace/lockdep.h b/include/trace/lockdep.h
index 5ca67df..8ee7900 100644
--- a/include/trace/lockdep.h
+++ b/include/trace/lockdep.h
@@ -1,9 +1,57 @@
-#ifndef _TRACE_LOCKDEP_H
+#if !defined(_TRACE_LOCKDEP_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_LOCKDEP_H
#include <linux/lockdep.h>
#include <linux/tracepoint.h>
-#include <trace/lockdep_event_types.h>
+#undef TRACE_SYSTEM
+#define TRACE_SYSTEM lock
+
+#ifdef CONFIG_LOCKDEP
+
+TRACE_FORMAT(lock_acquire,
+ TP_PROTO(struct lockdep_map *lock, unsigned int subclass,
+ int trylock, int read, int check,
+ struct lockdep_map *next_lock, unsigned long ip),
+ TP_ARGS(lock, subclass, trylock, read, check, next_lock, ip),
+ TP_FMT("%s%s%s", trylock ? "try " : "",
+ read ? "read " : "", lock->name)
+ );
+
+TRACE_FORMAT(lock_release,
+ TP_PROTO(struct lockdep_map *lock, int nested, unsigned long ip),
+ TP_ARGS(lock, nested, ip),
+ TP_FMT("%s", lock->name)
+ );
+
+#ifdef CONFIG_LOCK_STAT
+
+TRACE_FORMAT(lock_contended,
+ TP_PROTO(struct lockdep_map *lock, unsigned long ip),
+ TP_ARGS(lock, ip),
+ TP_FMT("%s", lock->name)
+ );
+
+TRACE_EVENT(lock_acquired,
+ TP_PROTO(struct lockdep_map *lock, unsigned long ip, s64 waittime),
+
+ TP_ARGS(lock, ip, waittime),
+
+ TP_STRUCT__entry(
+ __field(const char *, name)
+ __field(unsigned long, wait_usec)
+ __field(unsigned long, wait_nsec_rem)
+ ),
+ TP_fast_assign(
+ __entry->name = lock->name;
+ __entry->wait_nsec_rem = do_div(waittime, NSEC_PER_USEC);
+ __entry->wait_usec = (unsigned long) waittime;
+ ),
+ TP_printk("%s (%lu.%03lu us)", __entry->name, __entry->wait_usec,
+ __entry->wait_nsec_rem)
+);
#endif
+#endif
+
+#endif /* _TRACE_LOCKDEP_H */
diff --git a/include/trace/lockdep_event_types.h b/include/trace/lockdep_event_types.h
deleted file mode 100644
index 863f1e4..0000000
--- a/include/trace/lockdep_event_types.h
+++ /dev/null
@@ -1,57 +0,0 @@
-
-#ifndef TRACE_FORMAT
-# error Do not include this file directly.
-# error Unless you know what you are doing.
-#endif
-
-#undef TRACE_SYSTEM
-#define TRACE_SYSTEM lock
-
-#ifdef CONFIG_LOCKDEP
-
-TRACE_FORMAT(lock_acquire,
- TP_PROTO(struct lockdep_map *lock, unsigned int subclass,
- int trylock, int read, int check,
- struct lockdep_map *next_lock, unsigned long ip),
- TP_ARGS(lock, subclass, trylock, read, check, next_lock, ip),
- TP_FMT("%s%s%s", trylock ? "try " : "",
- read ? "read " : "", lock->name)
- );
-
-TRACE_FORMAT(lock_release,
- TP_PROTO(struct lockdep_map *lock, int nested, unsigned long ip),
- TP_ARGS(lock, nested, ip),
- TP_FMT("%s", lock->name)
- );
-
-#ifdef CONFIG_LOCK_STAT
-
-TRACE_FORMAT(lock_contended,
- TP_PROTO(struct lockdep_map *lock, unsigned long ip),
- TP_ARGS(lock, ip),
- TP_FMT("%s", lock->name)
- );
-
-TRACE_EVENT(lock_acquired,
- TP_PROTO(struct lockdep_map *lock, unsigned long ip, s64 waittime),
-
- TP_ARGS(lock, ip, waittime),
-
- TP_STRUCT__entry(
- __field(const char *, name)
- __field(unsigned long, wait_usec)
- __field(unsigned long, wait_nsec_rem)
- ),
- TP_fast_assign(
- __entry->name = lock->name;
- __entry->wait_nsec_rem = do_div(waittime, NSEC_PER_USEC);
- __entry->wait_usec = (unsigned long) waittime;
- ),
- TP_printk("%s (%lu.%03lu us)", __entry->name, __entry->wait_usec,
- __entry->wait_nsec_rem)
-);
-
-#endif
-#endif
-
-#undef TRACE_SYSTEM
diff --git a/include/trace/sched.h b/include/trace/sched.h
index 4e372a1..5b1cf4a 100644
--- a/include/trace/sched.h
+++ b/include/trace/sched.h
@@ -1,9 +1,336 @@
-#ifndef _TRACE_SCHED_H
+#if !defined(_TRACE_SCHED_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_SCHED_H
#include <linux/sched.h>
#include <linux/tracepoint.h>
-#include <trace/sched_event_types.h>
+#undef TRACE_SYSTEM
+#define TRACE_SYSTEM sched
-#endif
+/*
+ * Tracepoint for calling kthread_stop, performed to end a kthread:
+ */
+TRACE_EVENT(sched_kthread_stop,
+
+ TP_PROTO(struct task_struct *t),
+
+ TP_ARGS(t),
+
+ TP_STRUCT__entry(
+ __array( char, comm, TASK_COMM_LEN )
+ __field( pid_t, pid )
+ ),
+
+ TP_fast_assign(
+ memcpy(__entry->comm, t->comm, TASK_COMM_LEN);
+ __entry->pid = t->pid;
+ ),
+
+ TP_printk("task %s:%d", __entry->comm, __entry->pid)
+);
+
+/*
+ * Tracepoint for the return value of the kthread stopping:
+ */
+TRACE_EVENT(sched_kthread_stop_ret,
+
+ TP_PROTO(int ret),
+
+ TP_ARGS(ret),
+
+ TP_STRUCT__entry(
+ __field( int, ret )
+ ),
+
+ TP_fast_assign(
+ __entry->ret = ret;
+ ),
+
+ TP_printk("ret %d", __entry->ret)
+);
+
+/*
+ * Tracepoint for waiting on task to unschedule:
+ *
+ * (NOTE: the 'rq' argument is not used by generic trace events,
+ * but used by the latency tracer plugin. )
+ */
+TRACE_EVENT(sched_wait_task,
+
+ TP_PROTO(struct rq *rq, struct task_struct *p),
+
+ TP_ARGS(rq, p),
+
+ TP_STRUCT__entry(
+ __array( char, comm, TASK_COMM_LEN )
+ __field( pid_t, pid )
+ __field( int, prio )
+ ),
+
+ TP_fast_assign(
+ memcpy(__entry->comm, p->comm, TASK_COMM_LEN);
+ __entry->pid = p->pid;
+ __entry->prio = p->prio;
+ ),
+
+ TP_printk("task %s:%d [%d]",
+ __entry->comm, __entry->pid, __entry->prio)
+);
+
+/*
+ * Tracepoint for waking up a task:
+ *
+ * (NOTE: the 'rq' argument is not used by generic trace events,
+ * but used by the latency tracer plugin. )
+ */
+TRACE_EVENT(sched_wakeup,
+
+ TP_PROTO(struct rq *rq, struct task_struct *p, int success),
+
+ TP_ARGS(rq, p, success),
+
+ TP_STRUCT__entry(
+ __array( char, comm, TASK_COMM_LEN )
+ __field( pid_t, pid )
+ __field( int, prio )
+ __field( int, success )
+ ),
+
+ TP_fast_assign(
+ memcpy(__entry->comm, p->comm, TASK_COMM_LEN);
+ __entry->pid = p->pid;
+ __entry->prio = p->prio;
+ __entry->success = success;
+ ),
+
+ TP_printk("task %s:%d [%d] success=%d",
+ __entry->comm, __entry->pid, __entry->prio,
+ __entry->success)
+);
+
+/*
+ * Tracepoint for waking up a new task:
+ *
+ * (NOTE: the 'rq' argument is not used by generic trace events,
+ * but used by the latency tracer plugin. )
+ */
+TRACE_EVENT(sched_wakeup_new,
+
+ TP_PROTO(struct rq *rq, struct task_struct *p, int success),
+
+ TP_ARGS(rq, p, success),
+
+ TP_STRUCT__entry(
+ __array( char, comm, TASK_COMM_LEN )
+ __field( pid_t, pid )
+ __field( int, prio )
+ __field( int, success )
+ ),
+
+ TP_fast_assign(
+ memcpy(__entry->comm, p->comm, TASK_COMM_LEN);
+ __entry->pid = p->pid;
+ __entry->prio = p->prio;
+ __entry->success = success;
+ ),
+
+ TP_printk("task %s:%d [%d] success=%d",
+ __entry->comm, __entry->pid, __entry->prio,
+ __entry->success)
+);
+
+/*
+ * Tracepoint for task switches, performed by the scheduler:
+ *
+ * (NOTE: the 'rq' argument is not used by generic trace events,
+ * but used by the latency tracer plugin. )
+ */
+TRACE_EVENT(sched_switch,
+
+ TP_PROTO(struct rq *rq, struct task_struct *prev,
+ struct task_struct *next),
+
+ TP_ARGS(rq, prev, next),
+
+ TP_STRUCT__entry(
+ __array( char, prev_comm, TASK_COMM_LEN )
+ __field( pid_t, prev_pid )
+ __field( int, prev_prio )
+ __array( char, next_comm, TASK_COMM_LEN )
+ __field( pid_t, next_pid )
+ __field( int, next_prio )
+ ),
+
+ TP_fast_assign(
+ memcpy(__entry->next_comm, next->comm, TASK_COMM_LEN);
+ __entry->prev_pid = prev->pid;
+ __entry->prev_prio = prev->prio;
+ memcpy(__entry->prev_comm, prev->comm, TASK_COMM_LEN);
+ __entry->next_pid = next->pid;
+ __entry->next_prio = next->prio;
+ ),
+
+ TP_printk("task %s:%d [%d] ==> %s:%d [%d]",
+ __entry->prev_comm, __entry->prev_pid, __entry->prev_prio,
+ __entry->next_comm, __entry->next_pid, __entry->next_prio)
+);
+
+/*
+ * Tracepoint for a task being migrated:
+ */
+TRACE_EVENT(sched_migrate_task,
+
+ TP_PROTO(struct task_struct *p, int orig_cpu, int dest_cpu),
+
+ TP_ARGS(p, orig_cpu, dest_cpu),
+
+ TP_STRUCT__entry(
+ __array( char, comm, TASK_COMM_LEN )
+ __field( pid_t, pid )
+ __field( int, prio )
+ __field( int, orig_cpu )
+ __field( int, dest_cpu )
+ ),
+
+ TP_fast_assign(
+ memcpy(__entry->comm, p->comm, TASK_COMM_LEN);
+ __entry->pid = p->pid;
+ __entry->prio = p->prio;
+ __entry->orig_cpu = orig_cpu;
+ __entry->dest_cpu = dest_cpu;
+ ),
+
+ TP_printk("task %s:%d [%d] from: %d to: %d",
+ __entry->comm, __entry->pid, __entry->prio,
+ __entry->orig_cpu, __entry->dest_cpu)
+);
+
+/*
+ * Tracepoint for freeing a task:
+ */
+TRACE_EVENT(sched_process_free,
+
+ TP_PROTO(struct task_struct *p),
+
+ TP_ARGS(p),
+
+ TP_STRUCT__entry(
+ __array( char, comm, TASK_COMM_LEN )
+ __field( pid_t, pid )
+ __field( int, prio )
+ ),
+
+ TP_fast_assign(
+ memcpy(__entry->comm, p->comm, TASK_COMM_LEN);
+ __entry->pid = p->pid;
+ __entry->prio = p->prio;
+ ),
+
+ TP_printk("task %s:%d [%d]",
+ __entry->comm, __entry->pid, __entry->prio)
+);
+
+/*
+ * Tracepoint for a task exiting:
+ */
+TRACE_EVENT(sched_process_exit,
+
+ TP_PROTO(struct task_struct *p),
+
+ TP_ARGS(p),
+
+ TP_STRUCT__entry(
+ __array( char, comm, TASK_COMM_LEN )
+ __field( pid_t, pid )
+ __field( int, prio )
+ ),
+
+ TP_fast_assign(
+ memcpy(__entry->comm, p->comm, TASK_COMM_LEN);
+ __entry->pid = p->pid;
+ __entry->prio = p->prio;
+ ),
+
+ TP_printk("task %s:%d [%d]",
+ __entry->comm, __entry->pid, __entry->prio)
+);
+
+/*
+ * Tracepoint for a waiting task:
+ */
+TRACE_EVENT(sched_process_wait,
+
+ TP_PROTO(struct pid *pid),
+
+ TP_ARGS(pid),
+
+ TP_STRUCT__entry(
+ __array( char, comm, TASK_COMM_LEN )
+ __field( pid_t, pid )
+ __field( int, prio )
+ ),
+
+ TP_fast_assign(
+ memcpy(__entry->comm, current->comm, TASK_COMM_LEN);
+ __entry->pid = pid_nr(pid);
+ __entry->prio = current->prio;
+ ),
+
+ TP_printk("task %s:%d [%d]",
+ __entry->comm, __entry->pid, __entry->prio)
+);
+
+/*
+ * Tracepoint for do_fork:
+ */
+TRACE_EVENT(sched_process_fork,
+
+ TP_PROTO(struct task_struct *parent, struct task_struct *child),
+
+ TP_ARGS(parent, child),
+
+ TP_STRUCT__entry(
+ __array( char, parent_comm, TASK_COMM_LEN )
+ __field( pid_t, parent_pid )
+ __array( char, child_comm, TASK_COMM_LEN )
+ __field( pid_t, child_pid )
+ ),
+
+ TP_fast_assign(
+ memcpy(__entry->parent_comm, parent->comm, TASK_COMM_LEN);
+ __entry->parent_pid = parent->pid;
+ memcpy(__entry->child_comm, child->comm, TASK_COMM_LEN);
+ __entry->child_pid = child->pid;
+ ),
+
+ TP_printk("parent %s:%d child %s:%d",
+ __entry->parent_comm, __entry->parent_pid,
+ __entry->child_comm, __entry->child_pid)
+);
+
+/*
+ * Tracepoint for sending a signal:
+ */
+TRACE_EVENT(sched_signal_send,
+
+ TP_PROTO(int sig, struct task_struct *p),
+
+ TP_ARGS(sig, p),
+
+ TP_STRUCT__entry(
+ __field( int, sig )
+ __array( char, comm, TASK_COMM_LEN )
+ __field( pid_t, pid )
+ ),
+
+ TP_fast_assign(
+ memcpy(__entry->comm, p->comm, TASK_COMM_LEN);
+ __entry->pid = p->pid;
+ __entry->sig = sig;
+ ),
+
+ TP_printk("sig: %d task %s:%d",
+ __entry->sig, __entry->comm, __entry->pid)
+);
+
+#endif /* _TRACE_SCHED_H */
diff --git a/include/trace/sched_event_types.h b/include/trace/sched_event_types.h
deleted file mode 100644
index 63547dc..0000000
--- a/include/trace/sched_event_types.h
+++ /dev/null
@@ -1,337 +0,0 @@
-
-/* use <trace/sched.h> instead */
-#ifndef TRACE_EVENT
-# error Do not include this file directly.
-# error Unless you know what you are doing.
-#endif
-
-#undef TRACE_SYSTEM
-#define TRACE_SYSTEM sched
-
-/*
- * Tracepoint for calling kthread_stop, performed to end a kthread:
- */
-TRACE_EVENT(sched_kthread_stop,
-
- TP_PROTO(struct task_struct *t),
-
- TP_ARGS(t),
-
- TP_STRUCT__entry(
- __array( char, comm, TASK_COMM_LEN )
- __field( pid_t, pid )
- ),
-
- TP_fast_assign(
- memcpy(__entry->comm, t->comm, TASK_COMM_LEN);
- __entry->pid = t->pid;
- ),
-
- TP_printk("task %s:%d", __entry->comm, __entry->pid)
-);
-
-/*
- * Tracepoint for the return value of the kthread stopping:
- */
-TRACE_EVENT(sched_kthread_stop_ret,
-
- TP_PROTO(int ret),
-
- TP_ARGS(ret),
-
- TP_STRUCT__entry(
- __field( int, ret )
- ),
-
- TP_fast_assign(
- __entry->ret = ret;
- ),
-
- TP_printk("ret %d", __entry->ret)
-);
-
-/*
- * Tracepoint for waiting on task to unschedule:
- *
- * (NOTE: the 'rq' argument is not used by generic trace events,
- * but used by the latency tracer plugin. )
- */
-TRACE_EVENT(sched_wait_task,
-
- TP_PROTO(struct rq *rq, struct task_struct *p),
-
- TP_ARGS(rq, p),
-
- TP_STRUCT__entry(
- __array( char, comm, TASK_COMM_LEN )
- __field( pid_t, pid )
- __field( int, prio )
- ),
-
- TP_fast_assign(
- memcpy(__entry->comm, p->comm, TASK_COMM_LEN);
- __entry->pid = p->pid;
- __entry->prio = p->prio;
- ),
-
- TP_printk("task %s:%d [%d]",
- __entry->comm, __entry->pid, __entry->prio)
-);
-
-/*
- * Tracepoint for waking up a task:
- *
- * (NOTE: the 'rq' argument is not used by generic trace events,
- * but used by the latency tracer plugin. )
- */
-TRACE_EVENT(sched_wakeup,
-
- TP_PROTO(struct rq *rq, struct task_struct *p, int success),
-
- TP_ARGS(rq, p, success),
-
- TP_STRUCT__entry(
- __array( char, comm, TASK_COMM_LEN )
- __field( pid_t, pid )
- __field( int, prio )
- __field( int, success )
- ),
-
- TP_fast_assign(
- memcpy(__entry->comm, p->comm, TASK_COMM_LEN);
- __entry->pid = p->pid;
- __entry->prio = p->prio;
- __entry->success = success;
- ),
-
- TP_printk("task %s:%d [%d] success=%d",
- __entry->comm, __entry->pid, __entry->prio,
- __entry->success)
-);
-
-/*
- * Tracepoint for waking up a new task:
- *
- * (NOTE: the 'rq' argument is not used by generic trace events,
- * but used by the latency tracer plugin. )
- */
-TRACE_EVENT(sched_wakeup_new,
-
- TP_PROTO(struct rq *rq, struct task_struct *p, int success),
-
- TP_ARGS(rq, p, success),
-
- TP_STRUCT__entry(
- __array( char, comm, TASK_COMM_LEN )
- __field( pid_t, pid )
- __field( int, prio )
- __field( int, success )
- ),
-
- TP_fast_assign(
- memcpy(__entry->comm, p->comm, TASK_COMM_LEN);
- __entry->pid = p->pid;
- __entry->prio = p->prio;
- __entry->success = success;
- ),
-
- TP_printk("task %s:%d [%d] success=%d",
- __entry->comm, __entry->pid, __entry->prio,
- __entry->success)
-);
-
-/*
- * Tracepoint for task switches, performed by the scheduler:
- *
- * (NOTE: the 'rq' argument is not used by generic trace events,
- * but used by the latency tracer plugin. )
- */
-TRACE_EVENT(sched_switch,
-
- TP_PROTO(struct rq *rq, struct task_struct *prev,
- struct task_struct *next),
-
- TP_ARGS(rq, prev, next),
-
- TP_STRUCT__entry(
- __array( char, prev_comm, TASK_COMM_LEN )
- __field( pid_t, prev_pid )
- __field( int, prev_prio )
- __array( char, next_comm, TASK_COMM_LEN )
- __field( pid_t, next_pid )
- __field( int, next_prio )
- ),
-
- TP_fast_assign(
- memcpy(__entry->next_comm, next->comm, TASK_COMM_LEN);
- __entry->prev_pid = prev->pid;
- __entry->prev_prio = prev->prio;
- memcpy(__entry->prev_comm, prev->comm, TASK_COMM_LEN);
- __entry->next_pid = next->pid;
- __entry->next_prio = next->prio;
- ),
-
- TP_printk("task %s:%d [%d] ==> %s:%d [%d]",
- __entry->prev_comm, __entry->prev_pid, __entry->prev_prio,
- __entry->next_comm, __entry->next_pid, __entry->next_prio)
-);
-
-/*
- * Tracepoint for a task being migrated:
- */
-TRACE_EVENT(sched_migrate_task,
-
- TP_PROTO(struct task_struct *p, int orig_cpu, int dest_cpu),
-
- TP_ARGS(p, orig_cpu, dest_cpu),
-
- TP_STRUCT__entry(
- __array( char, comm, TASK_COMM_LEN )
- __field( pid_t, pid )
- __field( int, prio )
- __field( int, orig_cpu )
- __field( int, dest_cpu )
- ),
-
- TP_fast_assign(
- memcpy(__entry->comm, p->comm, TASK_COMM_LEN);
- __entry->pid = p->pid;
- __entry->prio = p->prio;
- __entry->orig_cpu = orig_cpu;
- __entry->dest_cpu = dest_cpu;
- ),
-
- TP_printk("task %s:%d [%d] from: %d to: %d",
- __entry->comm, __entry->pid, __entry->prio,
- __entry->orig_cpu, __entry->dest_cpu)
-);
-
-/*
- * Tracepoint for freeing a task:
- */
-TRACE_EVENT(sched_process_free,
-
- TP_PROTO(struct task_struct *p),
-
- TP_ARGS(p),
-
- TP_STRUCT__entry(
- __array( char, comm, TASK_COMM_LEN )
- __field( pid_t, pid )
- __field( int, prio )
- ),
-
- TP_fast_assign(
- memcpy(__entry->comm, p->comm, TASK_COMM_LEN);
- __entry->pid = p->pid;
- __entry->prio = p->prio;
- ),
-
- TP_printk("task %s:%d [%d]",
- __entry->comm, __entry->pid, __entry->prio)
-);
-
-/*
- * Tracepoint for a task exiting:
- */
-TRACE_EVENT(sched_process_exit,
-
- TP_PROTO(struct task_struct *p),
-
- TP_ARGS(p),
-
- TP_STRUCT__entry(
- __array( char, comm, TASK_COMM_LEN )
- __field( pid_t, pid )
- __field( int, prio )
- ),
-
- TP_fast_assign(
- memcpy(__entry->comm, p->comm, TASK_COMM_LEN);
- __entry->pid = p->pid;
- __entry->prio = p->prio;
- ),
-
- TP_printk("task %s:%d [%d]",
- __entry->comm, __entry->pid, __entry->prio)
-);
-
-/*
- * Tracepoint for a waiting task:
- */
-TRACE_EVENT(sched_process_wait,
-
- TP_PROTO(struct pid *pid),
-
- TP_ARGS(pid),
-
- TP_STRUCT__entry(
- __array( char, comm, TASK_COMM_LEN )
- __field( pid_t, pid )
- __field( int, prio )
- ),
-
- TP_fast_assign(
- memcpy(__entry->comm, current->comm, TASK_COMM_LEN);
- __entry->pid = pid_nr(pid);
- __entry->prio = current->prio;
- ),
-
- TP_printk("task %s:%d [%d]",
- __entry->comm, __entry->pid, __entry->prio)
-);
-
-/*
- * Tracepoint for do_fork:
- */
-TRACE_EVENT(sched_process_fork,
-
- TP_PROTO(struct task_struct *parent, struct task_struct *child),
-
- TP_ARGS(parent, child),
-
- TP_STRUCT__entry(
- __array( char, parent_comm, TASK_COMM_LEN )
- __field( pid_t, parent_pid )
- __array( char, child_comm, TASK_COMM_LEN )
- __field( pid_t, child_pid )
- ),
-
- TP_fast_assign(
- memcpy(__entry->parent_comm, parent->comm, TASK_COMM_LEN);
- __entry->parent_pid = parent->pid;
- memcpy(__entry->child_comm, child->comm, TASK_COMM_LEN);
- __entry->child_pid = child->pid;
- ),
-
- TP_printk("parent %s:%d child %s:%d",
- __entry->parent_comm, __entry->parent_pid,
- __entry->child_comm, __entry->child_pid)
-);
-
-/*
- * Tracepoint for sending a signal:
- */
-TRACE_EVENT(sched_signal_send,
-
- TP_PROTO(int sig, struct task_struct *p),
-
- TP_ARGS(sig, p),
-
- TP_STRUCT__entry(
- __field( int, sig )
- __array( char, comm, TASK_COMM_LEN )
- __field( pid_t, pid )
- ),
-
- TP_fast_assign(
- memcpy(__entry->comm, p->comm, TASK_COMM_LEN);
- __entry->pid = p->pid;
- __entry->sig = sig;
- ),
-
- TP_printk("sig: %d task %s:%d",
- __entry->sig, __entry->comm, __entry->pid)
-);
-
-#undef TRACE_SYSTEM
diff --git a/include/trace/skb.h b/include/trace/skb.h
index d2de717..e6fd281 100644
--- a/include/trace/skb.h
+++ b/include/trace/skb.h
@@ -1,9 +1,37 @@
-#ifndef _TRACE_SKB_H_
-#define _TRACE_SKB_H_
+#if !defined(_TRACE_SKB_H) || defined(TRACE_HEADER_MULTI_READ)
+#define _TRACE_SKB_H
#include <linux/skbuff.h>
#include <linux/tracepoint.h>
-#include <trace/skb_event_types.h>
+#undef TRACE_SYSTEM
+#define TRACE_SYSTEM skb
-#endif
+/*
+ * Tracepoint for free an sk_buff:
+ */
+TRACE_EVENT(kfree_skb,
+
+ TP_PROTO(struct sk_buff *skb, void *location),
+
+ TP_ARGS(skb, location),
+
+ TP_STRUCT__entry(
+ __field( void *, skbaddr )
+ __field( unsigned short, protocol )
+ __field( void *, location )
+ ),
+
+ TP_fast_assign(
+ __entry->skbaddr = skb;
+ if (skb) {
+ __entry->protocol = ntohs(skb->protocol);
+ }
+ __entry->location = location;
+ ),
+
+ TP_printk("skbaddr=%p protocol=%u location=%p",
+ __entry->skbaddr, __entry->protocol, __entry->location)
+);
+
+#endif /* _TRACE_SKB_H */
diff --git a/include/trace/skb_event_types.h b/include/trace/skb_event_types.h
deleted file mode 100644
index 4a1c504..0000000
--- a/include/trace/skb_event_types.h
+++ /dev/null
@@ -1,38 +0,0 @@
-
-/* use <trace/skb.h> instead */
-#ifndef TRACE_EVENT
-# error Do not include this file directly.
-# error Unless you know what you are doing.
-#endif
-
-#undef TRACE_SYSTEM
-#define TRACE_SYSTEM skb
-
-/*
- * Tracepoint for free an sk_buff:
- */
-TRACE_EVENT(kfree_skb,
-
- TP_PROTO(struct sk_buff *skb, void *location),
-
- TP_ARGS(skb, location),
-
- TP_STRUCT__entry(
- __field( void *, skbaddr )
- __field( unsigned short, protocol )
- __field( void *, location )
- ),
-
- TP_fast_assign(
- __entry->skbaddr = skb;
- if (skb) {
- __entry->protocol = ntohs(skb->protocol);
- }
- __entry->location = location;
- ),
-
- TP_printk("skbaddr=%p protocol=%u location=%p",
- __entry->skbaddr, __entry->protocol, __entry->location)
-);
-
-#undef TRACE_SYSTEM
diff --git a/include/trace/trace_event_types.h b/include/trace/trace_event_types.h
deleted file mode 100644
index 552a50e..0000000
--- a/include/trace/trace_event_types.h
+++ /dev/null
@@ -1,7 +0,0 @@
-/* trace/<type>_event_types.h here */
-
-#include <trace/sched_event_types.h>
-#include <trace/irq_event_types.h>
-#include <trace/lockdep_event_types.h>
-#include <trace/skb_event_types.h>
-#include <trace/kmem_event_types.h>
diff --git a/kernel/trace/events.c b/kernel/trace/events.c
index 246f2aa..5a35a91 100644
--- a/kernel/trace/events.c
+++ b/kernel/trace/events.c
@@ -8,6 +8,7 @@
#include "trace_output.h"
+#define TRACE_HEADER_MULTI_READ
#include "trace_events_stage_1.h"
#include "trace_events_stage_2.h"
#include "trace_events_stage_3.h"
diff --git a/kernel/trace/trace_events_stage_1.h b/kernel/trace/trace_events_stage_1.h
index 38985f9..475f46a 100644
--- a/kernel/trace/trace_events_stage_1.h
+++ b/kernel/trace/trace_events_stage_1.h
@@ -1,7 +1,7 @@
/*
* Stage 1 of the trace events.
*
- * Override the macros in <trace/trace_event_types.h> to include the following:
+ * Override the macros in <trace/trace_events.h> to include the following:
*
* struct ftrace_raw_<call> {
* struct trace_entry ent;
@@ -36,4 +36,4 @@
}; \
static struct ftrace_event_call event_##name
-#include <trace/trace_event_types.h>
+#include <trace/trace_events.h>
diff --git a/kernel/trace/trace_events_stage_2.h b/kernel/trace/trace_events_stage_2.h
index 59cfd7d..aa4a67a 100644
--- a/kernel/trace/trace_events_stage_2.h
+++ b/kernel/trace/trace_events_stage_2.h
@@ -1,7 +1,7 @@
/*
* Stage 2 of the trace events.
*
- * Override the macros in <trace/trace_event_types.h> to include the following:
+ * Override the macros in <trace/trace_events.h> to include the following:
*
* enum print_line_t
* ftrace_raw_output_<call>(struct trace_iterator *iter, int flags)
@@ -64,7 +64,7 @@ ftrace_raw_output_##call(struct trace_iterator *iter, int flags) \
return TRACE_TYPE_HANDLED; \
}
-#include <trace/trace_event_types.h>
+#include <trace/trace_events.h>
/*
* Setup the showing format of trace point.
@@ -128,7 +128,7 @@ ftrace_format_##call(struct trace_seq *s) \
return ret; \
}
-#include <trace/trace_event_types.h>
+#include <trace/trace_events.h>
#undef __field
#define __field(type, item) \
@@ -167,4 +167,4 @@ ftrace_define_fields_##call(void) \
return ret; \
}
-#include <trace/trace_event_types.h>
+#include <trace/trace_events.h>
diff --git a/kernel/trace/trace_events_stage_3.h b/kernel/trace/trace_events_stage_3.h
index 5bb1b7f..45c04e1 100644
--- a/kernel/trace/trace_events_stage_3.h
+++ b/kernel/trace/trace_events_stage_3.h
@@ -1,7 +1,7 @@
/*
* Stage 3 of the trace events.
*
- * Override the macros in <trace/trace_event_types.h> to include the following:
+ * Override the macros in <trace/trace_events.h> to include the following:
*
* static void ftrace_event_<call>(proto)
* {
@@ -272,7 +272,7 @@ __attribute__((section("_ftrace_events"))) event_##call = { \
_TRACE_PROFILE_INIT(call) \
}
-#include <trace/trace_event_types.h>
+#include <trace/trace_events.h>
#undef _TRACE_PROFILE
#undef _TRACE_PROFILE_INIT
--
1.6.2.1
--
^ permalink raw reply related [flat|nested] 60+ messages in thread
* [PATCH 2/8] tracing: create automated trace defines
2009-04-14 17:23 [PATCH 0/8] [GIT PULL] TRACE_EVENT for modules Steven Rostedt
2009-04-14 17:23 ` [PATCH 1/8] tracing: consolidate trace and trace_event headers Steven Rostedt
@ 2009-04-14 17:23 ` Steven Rostedt
2009-04-14 23:44 ` Jeremy Fitzhardinge
2009-04-15 7:04 ` Zhaolei
2009-04-14 17:23 ` [PATCH 3/8] tracing: make trace_seq operations available for core kernel Steven Rostedt
` (8 subsequent siblings)
10 siblings, 2 replies; 60+ messages in thread
From: Steven Rostedt @ 2009-04-14 17:23 UTC (permalink / raw)
To: linux-kernel
Cc: Ingo Molnar, Andrew Morton, Thomas Gleixner, Peter Zijlstra,
Frederic Weisbecker, Theodore Tso, Arjan van de Ven,
Christoph Hellwig, Mathieu Desnoyers, Jeremy Fitzhardinge,
Lai Jiangshan, Zhaolei, Li Zefan, KOSAKI Motohiro,
Masami Hiramatsu, Frank Ch. Eigler, Tom Zanussi, Jiaying Zhang,
Michael Rubin, Martin Bligh, Peter Zijlstra, Neil Horman,
Eduard - Gabriel Munteanu, Pekka Enberg
[-- Attachment #1: 0002-tracing-create-automated-trace-defines.patch --]
[-- Type: text/plain, Size: 12376 bytes --]
From: Steven Rostedt <srostedt@redhat.com>
This patch lowers the number of places a developer must modify to add
new tracepoints. The current method to add a new tracepoint
into an existing system is to write the trace point macro in the
trace header with one of the macros TRACE_EVENT, TRACE_FORMAT or
DECLARE_TRACE, then they must add the same named item into the C file
with the macro DEFINE_TRACE(name) and then add the trace point.
This change cuts out the needing to add the DEFINE_TRACE(name).
Every file that uses the tracepoint must still include the trace/<type>.h
file, but the one C file must also add a define before the including
of that file.
#define CREATE_TRACE_POINTS
#include <trace/mytrace.h>
This will cause the trace/mytrace.h file to also produce the C code
necessary to implement the trace point.
Note, if more than one trace/<type>.h is used to create the C code
it is best to list them all together.
#define CREATE_TRACE_POINTS
#include <trace/foo.h>
#include <trace/bar.h>
#include <trace/fido.h>
Thanks to Mathieu Desnoyers and Christoph Hellwig for coming up with
the cleaner solution of the define above the includes over my first
design to have the C code include a "special" header.
This patch converts sched, irq and lockdep and skb to use this new
method.
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Neil Horman <nhorman@tuxdriver.com>
Cc: Zhao Lei <zhaolei@cn.fujitsu.com>
Cc: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
Cc: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
include/trace/define_trace.h | 75 ++++++++++++++++++++++++++++++++++++++++++
include/trace/irq.h | 5 ++-
include/trace/kmem.h | 4 ++-
include/trace/lockdep.h | 3 ++
include/trace/sched.h | 3 ++
include/trace/skb.h | 3 ++
kernel/exit.c | 4 --
kernel/fork.c | 2 -
kernel/irq/handle.c | 7 ++--
kernel/kthread.c | 3 --
kernel/lockdep.c | 12 ++-----
kernel/sched.c | 10 ++----
kernel/signal.c | 2 -
kernel/softirq.c | 3 --
mm/util.c | 11 ++----
net/core/net-traces.c | 4 +-
16 files changed, 105 insertions(+), 46 deletions(-)
create mode 100644 include/trace/define_trace.h
diff --git a/include/trace/define_trace.h b/include/trace/define_trace.h
new file mode 100644
index 0000000..de9dc7d
--- /dev/null
+++ b/include/trace/define_trace.h
@@ -0,0 +1,75 @@
+/*
+ * Trace files that want to automate creationg of all tracepoints defined
+ * in their file should include this file. The following are macros that the
+ * trace file may define:
+ *
+ * TRACE_SYSTEM defines the system the tracepoint is for
+ *
+ * TRACE_INCLUDE_FILE if the file name is something other than TRACE_SYSTEM.h
+ * This macro may be defined to tell define_trace.h what file to include.
+ * Note, leave off the ".h".
+ *
+ * TRACE_INCLUDE_PATH if the path is something other than core kernel include/trace
+ * then this macro can define the path to use. Note, the path is relative to
+ * define_trace.h, not the file including it. Full path names for out of tree
+ * modules must be used.
+ */
+
+#ifdef CREATE_TRACE_POINTS
+
+/* Prevent recursion */
+#undef CREATE_TRACE_POINTS
+
+#include <linux/stringify.h>
+
+#undef TRACE_EVENT
+#define TRACE_EVENT(name, proto, args, tstruct, assign, print) \
+ DEFINE_TRACE(name)
+
+#undef TRACE_FORMAT
+#define TRACE_FORMAT(name, proto, args, print) \
+ DEFINE_TRACE(name)
+
+#undef DECLARE_TRACE
+#define DECLARE_TRACE(name, proto, args) \
+ DEFINE_TRACE(name)
+
+#undef TRACE_INCLUDE
+#undef __TRACE_INCLUDE
+
+#ifndef TRACE_INCLUDE_FILE
+# define TRACE_INCLUDE_FILE TRACE_SYSTEM
+# define UNDEF_TRACE_INCLUDE_FILE
+#endif
+
+#ifndef TRACE_INCLUDE_PATH
+# define __TRACE_INCLUDE(system) <trace/system.h>
+# define UNDEF_TRACE_INCLUDE_FILE
+#else
+# define __TRACE_INCLUDE(system) __stringify(TRACE_INCLUDE_PATH/system.h)
+#endif
+
+# define TRACE_INCLUDE(system) __TRACE_INCLUDE(system)
+
+/* Let the trace headers be reread */
+#define TRACE_HEADER_MULTI_READ
+
+#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
+
+#undef TRACE_HEADER_MULTI_READ
+
+/* Only undef what we defined in this file */
+#ifdef UNDEF_TRACE_INCLUDE_FILE
+# undef TRACE_INCLUDE_PATH
+# undef UNDEF_TRACE_INCLUDE_FILE
+#endif
+
+#ifdef UNDEF_TRACE_INCLUDE_FILE
+# undef TRACE_INCLUDE_PATH
+# undef UNDEF_TRACE_INCLUDE_FILE
+#endif
+
+/* We may be processing more files */
+#define CREATE_TRACE_POINTS
+
+#endif /* CREATE_TRACE_POINTS */
diff --git a/include/trace/irq.h b/include/trace/irq.h
index 04ab4c6..75e3468 100644
--- a/include/trace/irq.h
+++ b/include/trace/irq.h
@@ -51,4 +51,7 @@ TRACE_FORMAT(softirq_exit,
TP_FMT("softirq=%d action=%s", (int)(h - vec), softirq_to_name[h-vec])
);
-#endif
+#endif /* _TRACE_IRQ_H */
+
+/* This part must be outside protection */
+#include <trace/define_trace.h>
diff --git a/include/trace/kmem.h b/include/trace/kmem.h
index d7d1218..c22c42f 100644
--- a/include/trace/kmem.h
+++ b/include/trace/kmem.h
@@ -188,5 +188,7 @@ TRACE_EVENT(kmem_cache_free,
TP_printk("call_site=%lx ptr=%p", __entry->call_site, __entry->ptr)
);
+#endif /* _TRACE_KMEM_H */
-#endif
+/* This part must be outside protection */
+#include <trace/define_trace.h>
diff --git a/include/trace/lockdep.h b/include/trace/lockdep.h
index 8ee7900..4d301e7 100644
--- a/include/trace/lockdep.h
+++ b/include/trace/lockdep.h
@@ -55,3 +55,6 @@ TRACE_EVENT(lock_acquired,
#endif
#endif /* _TRACE_LOCKDEP_H */
+
+/* This part must be outside protection */
+#include <trace/define_trace.h>
diff --git a/include/trace/sched.h b/include/trace/sched.h
index 5b1cf4a..ffa1cab 100644
--- a/include/trace/sched.h
+++ b/include/trace/sched.h
@@ -334,3 +334,6 @@ TRACE_EVENT(sched_signal_send,
);
#endif /* _TRACE_SCHED_H */
+
+/* This part must be outside protection */
+#include <trace/define_trace.h>
diff --git a/include/trace/skb.h b/include/trace/skb.h
index e6fd281..1e8fabb 100644
--- a/include/trace/skb.h
+++ b/include/trace/skb.h
@@ -35,3 +35,6 @@ TRACE_EVENT(kfree_skb,
);
#endif /* _TRACE_SKB_H */
+
+/* This part must be outside protection */
+#include <trace/define_trace.h>
diff --git a/kernel/exit.c b/kernel/exit.c
index abf9cf3..2fe9d2c 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -56,10 +56,6 @@
#include <asm/mmu_context.h>
#include "cred-internals.h"
-DEFINE_TRACE(sched_process_free);
-DEFINE_TRACE(sched_process_exit);
-DEFINE_TRACE(sched_process_wait);
-
static void exit_mm(struct task_struct * tsk);
static void __unhash_process(struct task_struct *p)
diff --git a/kernel/fork.c b/kernel/fork.c
index b9e2edd..4bebf26 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -83,8 +83,6 @@ DEFINE_PER_CPU(unsigned long, process_counts) = 0;
__cacheline_aligned DEFINE_RWLOCK(tasklist_lock); /* outer */
-DEFINE_TRACE(sched_process_fork);
-
int nr_processes(void)
{
int cpu;
diff --git a/kernel/irq/handle.c b/kernel/irq/handle.c
index d82142b..983d8be 100644
--- a/kernel/irq/handle.c
+++ b/kernel/irq/handle.c
@@ -17,9 +17,11 @@
#include <linux/kernel_stat.h>
#include <linux/rculist.h>
#include <linux/hash.h>
-#include <trace/irq.h>
#include <linux/bootmem.h>
+#define CREATE_TRACE_POINTS
+#include <trace/irq.h>
+
#include "internals.h"
/*
@@ -348,9 +350,6 @@ static void warn_no_thread(unsigned int irq, struct irqaction *action)
"but no thread function available.", irq, action->name);
}
-DEFINE_TRACE(irq_handler_entry);
-DEFINE_TRACE(irq_handler_exit);
-
/**
* handle_IRQ_event - irq action chain handler
* @irq: the interrupt number
diff --git a/kernel/kthread.c b/kernel/kthread.c
index 4ebaf85..e1c7692 100644
--- a/kernel/kthread.c
+++ b/kernel/kthread.c
@@ -21,9 +21,6 @@ static DEFINE_SPINLOCK(kthread_create_lock);
static LIST_HEAD(kthread_create_list);
struct task_struct *kthreadd_task;
-DEFINE_TRACE(sched_kthread_stop);
-DEFINE_TRACE(sched_kthread_stop_ret);
-
struct kthread_create_info
{
/* Information passed to kthread() from kthreadd. */
diff --git a/kernel/lockdep.c b/kernel/lockdep.c
index c4582a6..257f21a 100644
--- a/kernel/lockdep.c
+++ b/kernel/lockdep.c
@@ -42,12 +42,14 @@
#include <linux/hash.h>
#include <linux/ftrace.h>
#include <linux/stringify.h>
-#include <trace/lockdep.h>
#include <asm/sections.h>
#include "lockdep_internals.h"
+#define CREATE_TRACE_POINTS
+#include <trace/lockdep.h>
+
#ifdef CONFIG_PROVE_LOCKING
int prove_locking = 1;
module_param(prove_locking, int, 0644);
@@ -2929,8 +2931,6 @@ void lock_set_class(struct lockdep_map *lock, const char *name,
}
EXPORT_SYMBOL_GPL(lock_set_class);
-DEFINE_TRACE(lock_acquire);
-
/*
* We are not always called with irqs disabled - do that here,
* and also avoid lockdep recursion:
@@ -2957,8 +2957,6 @@ void lock_acquire(struct lockdep_map *lock, unsigned int subclass,
}
EXPORT_SYMBOL_GPL(lock_acquire);
-DEFINE_TRACE(lock_release);
-
void lock_release(struct lockdep_map *lock, int nested,
unsigned long ip)
{
@@ -3061,8 +3059,6 @@ found_it:
put_lock_stats(stats);
}
-DEFINE_TRACE(lock_acquired);
-
static void
__lock_acquired(struct lockdep_map *lock, unsigned long ip)
{
@@ -3118,8 +3114,6 @@ found_it:
lock->ip = ip;
}
-DEFINE_TRACE(lock_contended);
-
void lock_contended(struct lockdep_map *lock, unsigned long ip)
{
unsigned long flags;
diff --git a/kernel/sched.c b/kernel/sched.c
index 5724508..e6d4518 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -72,13 +72,15 @@
#include <linux/debugfs.h>
#include <linux/ctype.h>
#include <linux/ftrace.h>
-#include <trace/sched.h>
#include <asm/tlb.h>
#include <asm/irq_regs.h>
#include "sched_cpupri.h"
+#define CREATE_TRACE_POINTS
+#include <trace/sched.h>
+
/*
* Convert user-nice values [ -20 ... 0 ... 19 ]
* to static priority [ MAX_RT_PRIO..MAX_PRIO-1 ],
@@ -118,12 +120,6 @@
*/
#define RUNTIME_INF ((u64)~0ULL)
-DEFINE_TRACE(sched_wait_task);
-DEFINE_TRACE(sched_wakeup);
-DEFINE_TRACE(sched_wakeup_new);
-DEFINE_TRACE(sched_switch);
-DEFINE_TRACE(sched_migrate_task);
-
#ifdef CONFIG_SMP
static void double_rq_lock(struct rq *rq1, struct rq *rq2);
diff --git a/kernel/signal.c b/kernel/signal.c
index d803473..1d5703f 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -41,8 +41,6 @@
static struct kmem_cache *sigqueue_cachep;
-DEFINE_TRACE(sched_signal_send);
-
static void __user *sig_handler(struct task_struct *t, int sig)
{
return t->sighand->action[sig - 1].sa.sa_handler;
diff --git a/kernel/softirq.c b/kernel/softirq.c
index 2fecefa..a2d9b45 100644
--- a/kernel/softirq.c
+++ b/kernel/softirq.c
@@ -186,9 +186,6 @@ EXPORT_SYMBOL(local_bh_enable_ip);
*/
#define MAX_SOFTIRQ_RESTART 10
-DEFINE_TRACE(softirq_entry);
-DEFINE_TRACE(softirq_exit);
-
asmlinkage void __do_softirq(void)
{
struct softirq_action *h;
diff --git a/mm/util.c b/mm/util.c
index 2599e83..0e74a22 100644
--- a/mm/util.c
+++ b/mm/util.c
@@ -4,9 +4,11 @@
#include <linux/module.h>
#include <linux/err.h>
#include <linux/sched.h>
-#include <linux/tracepoint.h>
#include <asm/uaccess.h>
+#define CREATE_TRACE_POINTS
+#include <trace/kmem.h>
+
/**
* kstrdup - allocate space for and copy an existing string
* @s: the string to duplicate
@@ -239,13 +241,6 @@ int __attribute__((weak)) get_user_pages_fast(unsigned long start,
EXPORT_SYMBOL_GPL(get_user_pages_fast);
/* Tracepoints definitions. */
-DEFINE_TRACE(kmalloc);
-DEFINE_TRACE(kmem_cache_alloc);
-DEFINE_TRACE(kmalloc_node);
-DEFINE_TRACE(kmem_cache_alloc_node);
-DEFINE_TRACE(kfree);
-DEFINE_TRACE(kmem_cache_free);
-
EXPORT_TRACEPOINT_SYMBOL(kmalloc);
EXPORT_TRACEPOINT_SYMBOL(kmem_cache_alloc);
EXPORT_TRACEPOINT_SYMBOL(kmalloc_node);
diff --git a/net/core/net-traces.c b/net/core/net-traces.c
index c8fb456..8017720 100644
--- a/net/core/net-traces.c
+++ b/net/core/net-traces.c
@@ -19,11 +19,11 @@
#include <linux/workqueue.h>
#include <linux/netlink.h>
#include <linux/net_dropmon.h>
-#include <trace/skb.h>
#include <asm/unaligned.h>
#include <asm/bitops.h>
+#define CREATE_TRACE_POINTS
+#include <trace/skb.h>
-DEFINE_TRACE(kfree_skb);
EXPORT_TRACEPOINT_SYMBOL_GPL(kfree_skb);
--
1.6.2.1
--
^ permalink raw reply related [flat|nested] 60+ messages in thread
* [PATCH 3/8] tracing: make trace_seq operations available for core kernel
2009-04-14 17:23 [PATCH 0/8] [GIT PULL] TRACE_EVENT for modules Steven Rostedt
2009-04-14 17:23 ` [PATCH 1/8] tracing: consolidate trace and trace_event headers Steven Rostedt
2009-04-14 17:23 ` [PATCH 2/8] tracing: create automated trace defines Steven Rostedt
@ 2009-04-14 17:23 ` Steven Rostedt
2009-04-14 19:12 ` Peter Zijlstra
2009-04-14 17:23 ` [PATCH 4/8] tracing/events: move declarations from trace directory to core include Steven Rostedt
` (7 subsequent siblings)
10 siblings, 1 reply; 60+ messages in thread
From: Steven Rostedt @ 2009-04-14 17:23 UTC (permalink / raw)
To: linux-kernel
Cc: Ingo Molnar, Andrew Morton, Thomas Gleixner, Peter Zijlstra,
Frederic Weisbecker, Theodore Tso, Arjan van de Ven,
Christoph Hellwig, Mathieu Desnoyers, Jeremy Fitzhardinge,
Lai Jiangshan, Zhaolei, Li Zefan, KOSAKI Motohiro,
Masami Hiramatsu, Frank Ch. Eigler, Tom Zanussi, Jiaying Zhang,
Michael Rubin, Martin Bligh
[-- Attachment #1: 0003-tracing-make-trace_seq-operations-available-for-cor.patch --]
[-- Type: text/plain, Size: 6057 bytes --]
From: Steven Rostedt <srostedt@redhat.com>
In the process to make TRACE_EVENT macro work for modules, the trace_seq
operations must be available for core kernel code.
These operations are quite useful and can be used for other implementations.
The main idea is that we create a trace_seq handle that acts very much
like the seq_file handle.
struct trace_seq *s = kmalloc(sizeof(*s, GFP_KERNEL);
trace_seq_init(s);
trace_seq_printf(s, "some data %d\n", variable);
printk("%s", s->buffer);
The main use is to allow a top level function call several other functions
that may store printf like data into the buffer. Then at the end, the top
level function can process all the data with any method it would like to.
It could be passed to userspace, output via printk or even use seq_file:
trace_seq_to_user(s, ubuf, cnt);
seq_puts(m, s->buffer);
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
include/linux/trace_seq.h | 89 +++++++++++++++++++++++++++++++++++++++++++
kernel/trace/trace.h | 15 +------
kernel/trace/trace_output.h | 16 +-------
3 files changed, 92 insertions(+), 28 deletions(-)
create mode 100644 include/linux/trace_seq.h
diff --git a/include/linux/trace_seq.h b/include/linux/trace_seq.h
new file mode 100644
index 0000000..28051da
--- /dev/null
+++ b/include/linux/trace_seq.h
@@ -0,0 +1,89 @@
+#ifndef _LINUX_TRACE_SEQ_H
+#define _LINUX_TRACE_SEQ_H
+
+/*
+ * Trace sequences are used to allow a function to call several other functions
+ * to create a string of data to use (up to a max of PAGE_SIZE.
+ */
+
+struct trace_seq {
+ unsigned char buffer[PAGE_SIZE];
+ unsigned int len;
+ unsigned int readpos;
+};
+
+static inline void
+trace_seq_init(struct trace_seq *s)
+{
+ s->len = 0;
+ s->readpos = 0;
+}
+
+/*
+ * Currently only defined when tracing is enabled.
+ */
+#ifdef CONFIG_TRACING
+extern int trace_seq_printf(struct trace_seq *s, const char *fmt, ...)
+ __attribute__ ((format (printf, 2, 3)));
+extern int
+trace_seq_bprintf(struct trace_seq *s, const char *fmt, const u32 *binary);
+extern void trace_print_seq(struct seq_file *m, struct trace_seq *s);
+extern ssize_t trace_seq_to_user(struct trace_seq *s, char __user *ubuf,
+ size_t cnt);
+extern int trace_seq_puts(struct trace_seq *s, const char *str);
+extern int trace_seq_putc(struct trace_seq *s, unsigned char c);
+extern int trace_seq_putmem(struct trace_seq *s, const void *mem, size_t len);
+extern int trace_seq_putmem_hex(struct trace_seq *s, const void *mem,
+ size_t len);
+extern void *trace_seq_reserve(struct trace_seq *s, size_t len);
+extern int trace_seq_path(struct trace_seq *s, struct path *path);
+
+#else /* CONFIG_TRACING */
+static inline int trace_seq_printf(struct trace_seq *s, const char *fmt, ...)
+ __attribute__ ((format (printf, 2, 3)))
+{
+ return 0;
+}
+static inline int
+trace_seq_bprintf(struct trace_seq *s, const char *fmt, const u32 *binary)
+{
+ return 0;
+}
+
+static inline void trace_print_seq(struct seq_file *m, struct trace_seq *s)
+{
+}
+static inline ssize_t trace_seq_to_user(struct trace_seq *s, char __user *ubuf,
+ size_t cnt)
+{
+ return 0;
+}
+static inline int trace_seq_puts(struct trace_seq *s, const char *str)
+{
+ return 0;
+}
+static inline int trace_seq_putc(struct trace_seq *s, unsigned char c);
+{
+ return 0;
+}
+static inline int
+trace_seq_putmem(struct trace_seq *s, const void *mem, size_t len)
+{
+ return 0;
+}
+static inline int trace_seq_putmem_hex(struct trace_seq *s, const void *mem,
+ size_t len)
+{
+ return 0;
+}
+static inline void *trace_seq_reserve(struct trace_seq *s, size_t len)
+{
+ return NULL;
+}
+static inline int trace_seq_path(struct trace_seq *s, struct path *path)
+{
+ return 0;
+}
+#endif /* CONFIG_TRACING */
+
+#endif /* _LINUX_TRACE_SEQ_H */
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index b05b6ac..1882846 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -12,6 +12,8 @@
#include <linux/kmemtrace.h>
#include <trace/power.h>
+#include <linux/trace_seq.h>
+
enum trace_type {
__TRACE_FIRST_TYPE = 0,
@@ -423,19 +425,6 @@ struct tracer {
struct tracer_stat *stats;
};
-struct trace_seq {
- unsigned char buffer[PAGE_SIZE];
- unsigned int len;
- unsigned int readpos;
-};
-
-static inline void
-trace_seq_init(struct trace_seq *s)
-{
- s->len = 0;
- s->readpos = 0;
-}
-
#define TRACE_PIPE_ALL_CPU -1
diff --git a/kernel/trace/trace_output.h b/kernel/trace/trace_output.h
index 9163021..5c7cbfb 100644
--- a/kernel/trace/trace_output.h
+++ b/kernel/trace/trace_output.h
@@ -1,6 +1,7 @@
#ifndef __TRACE_EVENTS_H
#define __TRACE_EVENTS_H
+#include <linux/trace_seq.h>
#include "trace.h"
typedef enum print_line_t (*trace_print_func)(struct trace_iterator *iter,
@@ -20,24 +21,9 @@ trace_print_bprintk_msg_only(struct trace_iterator *iter);
extern enum print_line_t
trace_print_printk_msg_only(struct trace_iterator *iter);
-extern void trace_print_seq(struct seq_file *m, struct trace_seq *s);
-
-extern int trace_seq_printf(struct trace_seq *s, const char *fmt, ...)
- __attribute__ ((format (printf, 2, 3)));
-extern int
-trace_seq_bprintf(struct trace_seq *s, const char *fmt, const u32 *binary);
extern int
seq_print_ip_sym(struct trace_seq *s, unsigned long ip,
unsigned long sym_flags);
-extern ssize_t trace_seq_to_user(struct trace_seq *s, char __user *ubuf,
- size_t cnt);
-extern int trace_seq_puts(struct trace_seq *s, const char *str);
-extern int trace_seq_putc(struct trace_seq *s, unsigned char c);
-extern int trace_seq_putmem(struct trace_seq *s, const void *mem, size_t len);
-extern int trace_seq_putmem_hex(struct trace_seq *s, const void *mem,
- size_t len);
-extern void *trace_seq_reserve(struct trace_seq *s, size_t len);
-extern int trace_seq_path(struct trace_seq *s, struct path *path);
extern int seq_print_userip_objs(const struct userstack_entry *entry,
struct trace_seq *s, unsigned long sym_flags);
extern int seq_print_user_ip(struct trace_seq *s, struct mm_struct *mm,
--
1.6.2.1
--
^ permalink raw reply related [flat|nested] 60+ messages in thread
* [PATCH 4/8] tracing/events: move declarations from trace directory to core include
2009-04-14 17:23 [PATCH 0/8] [GIT PULL] TRACE_EVENT for modules Steven Rostedt
` (2 preceding siblings ...)
2009-04-14 17:23 ` [PATCH 3/8] tracing: make trace_seq operations available for core kernel Steven Rostedt
@ 2009-04-14 17:23 ` Steven Rostedt
2009-04-14 17:23 ` [PATCH 5/8] tracing/events: move the ftrace event tracing code to core Steven Rostedt
` (6 subsequent siblings)
10 siblings, 0 replies; 60+ messages in thread
From: Steven Rostedt @ 2009-04-14 17:23 UTC (permalink / raw)
To: linux-kernel
Cc: Ingo Molnar, Andrew Morton, Thomas Gleixner, Peter Zijlstra,
Frederic Weisbecker, Theodore Tso, Arjan van de Ven,
Christoph Hellwig, Mathieu Desnoyers, Jeremy Fitzhardinge,
Lai Jiangshan, Zhaolei, Li Zefan, KOSAKI Motohiro,
Masami Hiramatsu, Frank Ch. Eigler, Tom Zanussi, Jiaying Zhang,
Michael Rubin, Martin Bligh
[-- Attachment #1: 0004-tracing-events-move-declarations-from-trace-directo.patch --]
[-- Type: text/plain, Size: 12936 bytes --]
From: Steven Rostedt <srostedt@redhat.com>
In preparation to allowing trace events to happen in modules, we need
to move some of the local declarations in the kernel/trace directory
into include/linux.
This patch simply moves the declarations and performs no context changes.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
include/linux/ftrace_event.h | 146 ++++++++++++++++++++++++++++++++++++++++++
kernel/trace/trace.h | 120 +----------------------------------
kernel/trace/trace_output.h | 14 ----
3 files changed, 147 insertions(+), 133 deletions(-)
create mode 100644 include/linux/ftrace_event.h
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h
new file mode 100644
index 0000000..496b76d
--- /dev/null
+++ b/include/linux/ftrace_event.h
@@ -0,0 +1,146 @@
+#ifndef _LINUX_FTRACE_EVENT_H
+#define _LINUX_FTRACE_EVENT_H
+
+#include <linux/trace_seq.h>
+#include <linux/ring_buffer.h>
+
+
+struct trace_array;
+struct tracer;
+
+/*
+ * The trace entry - the most basic unit of tracing. This is what
+ * is printed in the end as a single line in the trace output, such as:
+ *
+ * bash-15816 [01] 235.197585: idle_cpu <- irq_enter
+ */
+struct trace_entry {
+ unsigned char type;
+ unsigned char flags;
+ unsigned char preempt_count;
+ int pid;
+ int tgid;
+};
+
+/*
+ * Trace iterator - used by printout routines who present trace
+ * results to users and which routines might sleep, etc:
+ */
+struct trace_iterator {
+ struct trace_array *tr;
+ struct tracer *trace;
+ void *private;
+ int cpu_file;
+ struct mutex mutex;
+ struct ring_buffer_iter *buffer_iter[NR_CPUS];
+
+ /* The below is zeroed out in pipe_read */
+ struct trace_seq seq;
+ struct trace_entry *ent;
+ int cpu;
+ u64 ts;
+
+ unsigned long iter_flags;
+ loff_t pos;
+ long idx;
+
+ cpumask_var_t started;
+};
+
+
+typedef enum print_line_t (*trace_print_func)(struct trace_iterator *iter,
+ int flags);
+struct trace_event {
+ struct hlist_node node;
+ int type;
+ trace_print_func trace;
+ trace_print_func raw;
+ trace_print_func hex;
+ trace_print_func binary;
+};
+
+extern int register_ftrace_event(struct trace_event *event);
+extern int unregister_ftrace_event(struct trace_event *event);
+
+/* Return values for print_line callback */
+enum print_line_t {
+ TRACE_TYPE_PARTIAL_LINE = 0, /* Retry after flushing the seq */
+ TRACE_TYPE_HANDLED = 1,
+ TRACE_TYPE_UNHANDLED = 2, /* Relay to other output functions */
+ TRACE_TYPE_NO_CONSUME = 3 /* Handled but ask to not consume */
+};
+
+
+struct ring_buffer_event *
+trace_current_buffer_lock_reserve(unsigned char type, unsigned long len,
+ unsigned long flags, int pc);
+void trace_current_buffer_unlock_commit(struct ring_buffer_event *event,
+ unsigned long flags, int pc);
+void trace_nowake_buffer_unlock_commit(struct ring_buffer_event *event,
+ unsigned long flags, int pc);
+void trace_current_buffer_discard_commit(struct ring_buffer_event *event);
+
+void tracing_record_cmdline(struct task_struct *tsk);
+
+struct ftrace_event_call {
+ char *name;
+ char *system;
+ struct dentry *dir;
+ int enabled;
+ int (*regfunc)(void);
+ void (*unregfunc)(void);
+ int id;
+ int (*raw_init)(void);
+ int (*show_format)(struct trace_seq *s);
+ int (*define_fields)(void);
+ struct list_head fields;
+ int n_preds;
+ struct filter_pred **preds;
+
+#ifdef CONFIG_EVENT_PROFILE
+ atomic_t profile_count;
+ int (*profile_enable)(struct ftrace_event_call *);
+ void (*profile_disable)(struct ftrace_event_call *);
+#endif
+};
+
+#define MAX_FILTER_PRED 8
+#define MAX_FILTER_STR_VAL 128
+
+extern int init_preds(struct ftrace_event_call *call);
+extern int filter_match_preds(struct ftrace_event_call *call, void *rec);
+extern int filter_current_check_discard(struct ftrace_event_call *call,
+ void *rec,
+ struct ring_buffer_event *event);
+
+extern int trace_define_field(struct ftrace_event_call *call, char *type,
+ char *name, int offset, int size);
+
+
+/*
+ * The double __builtin_constant_p is because gcc will give us an error
+ * if we try to allocate the static variable to fmt if it is not a
+ * constant. Even with the outer if statement optimizing out.
+ */
+#define event_trace_printk(ip, fmt, args...) \
+do { \
+ __trace_printk_check_format(fmt, ##args); \
+ tracing_record_cmdline(current); \
+ if (__builtin_constant_p(fmt)) { \
+ static const char *trace_printk_fmt \
+ __attribute__((section("__trace_printk_fmt"))) = \
+ __builtin_constant_p(fmt) ? fmt : NULL; \
+ \
+ __trace_bprintk(ip, trace_printk_fmt, ##args); \
+ } else \
+ __trace_printk(ip, fmt, ##args); \
+} while (0)
+
+#define __common_field(type, item) \
+ ret = trace_define_field(event_call, #type, "common_" #item, \
+ offsetof(typeof(field.ent), item), \
+ sizeof(field.ent.item)); \
+ if (ret) \
+ return ret;
+
+#endif /* _LINUX_FTRACE_EVENT_H */
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index 1882846..6bcdf4a 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -13,6 +13,7 @@
#include <trace/power.h>
#include <linux/trace_seq.h>
+#include <linux/ftrace_event.h>
enum trace_type {
__TRACE_FIRST_TYPE = 0,
@@ -44,20 +45,6 @@ enum trace_type {
};
/*
- * The trace entry - the most basic unit of tracing. This is what
- * is printed in the end as a single line in the trace output, such as:
- *
- * bash-15816 [01] 235.197585: idle_cpu <- irq_enter
- */
-struct trace_entry {
- unsigned char type;
- unsigned char flags;
- unsigned char preempt_count;
- int pid;
- int tgid;
-};
-
-/*
* Function trace entry - function address and parent function addres:
*/
struct ftrace_entry {
@@ -265,8 +252,6 @@ struct trace_array_cpu {
char comm[TASK_COMM_LEN];
};
-struct trace_iterator;
-
/*
* The trace array - an array of per-CPU trace arrays. This is the
* highest level data structure that individual tracers deal with.
@@ -341,15 +326,6 @@ extern void __ftrace_bad_type(void);
__ftrace_bad_type(); \
} while (0)
-/* Return values for print_line callback */
-enum print_line_t {
- TRACE_TYPE_PARTIAL_LINE = 0, /* Retry after flushing the seq */
- TRACE_TYPE_HANDLED = 1,
- TRACE_TYPE_UNHANDLED = 2, /* Relay to other output functions */
- TRACE_TYPE_NO_CONSUME = 3 /* Handled but ask to not consume */
-};
-
-
/*
* An option specific to a tracer. This is a boolean value.
* The bit is the bit index that sets its value on the
@@ -428,31 +404,6 @@ struct tracer {
#define TRACE_PIPE_ALL_CPU -1
-/*
- * Trace iterator - used by printout routines who present trace
- * results to users and which routines might sleep, etc:
- */
-struct trace_iterator {
- struct trace_array *tr;
- struct tracer *trace;
- void *private;
- int cpu_file;
- struct mutex mutex;
- struct ring_buffer_iter *buffer_iter[NR_CPUS];
-
- /* The below is zeroed out in pipe_read */
- struct trace_seq seq;
- struct trace_entry *ent;
- int cpu;
- u64 ts;
-
- unsigned long iter_flags;
- loff_t pos;
- long idx;
-
- cpumask_var_t started;
-};
-
int tracer_init(struct tracer *t, struct trace_array *tr);
int tracing_is_enabled(void);
void trace_wake_up(void);
@@ -479,15 +430,6 @@ void trace_buffer_unlock_commit(struct trace_array *tr,
struct ring_buffer_event *event,
unsigned long flags, int pc);
-struct ring_buffer_event *
-trace_current_buffer_lock_reserve(unsigned char type, unsigned long len,
- unsigned long flags, int pc);
-void trace_current_buffer_unlock_commit(struct ring_buffer_event *event,
- unsigned long flags, int pc);
-void trace_nowake_buffer_unlock_commit(struct ring_buffer_event *event,
- unsigned long flags, int pc);
-void trace_current_buffer_discard_commit(struct ring_buffer_event *event);
-
struct trace_entry *tracing_get_trace_entry(struct trace_array *tr,
struct trace_array_cpu *data);
@@ -510,7 +452,6 @@ void tracing_sched_switch_trace(struct trace_array *tr,
struct task_struct *prev,
struct task_struct *next,
unsigned long flags, int pc);
-void tracing_record_cmdline(struct task_struct *tsk);
void tracing_sched_wakeup_trace(struct trace_array *tr,
struct task_struct *wakee,
@@ -790,28 +731,6 @@ struct ftrace_event_field {
int size;
};
-struct ftrace_event_call {
- char *name;
- char *system;
- struct dentry *dir;
- int enabled;
- int (*regfunc)(void);
- void (*unregfunc)(void);
- int id;
- int (*raw_init)(void);
- int (*show_format)(struct trace_seq *s);
- int (*define_fields)(void);
- struct list_head fields;
- int n_preds;
- struct filter_pred **preds;
-
-#ifdef CONFIG_EVENT_PROFILE
- atomic_t profile_count;
- int (*profile_enable)(struct ftrace_event_call *);
- void (*profile_disable)(struct ftrace_event_call *);
-#endif
-};
-
struct event_subsystem {
struct list_head list;
const char *name;
@@ -825,9 +744,6 @@ struct event_subsystem {
(unsigned long)event < (unsigned long)__stop_ftrace_events; \
event++)
-#define MAX_FILTER_PRED 8
-#define MAX_FILTER_STR_VAL 128
-
struct filter_pred;
typedef int (*filter_pred_fn_t) (struct filter_pred *pred, void *event);
@@ -845,9 +761,6 @@ struct filter_pred {
int clear;
};
-int trace_define_field(struct ftrace_event_call *call, char *type,
- char *name, int offset, int size);
-extern int init_preds(struct ftrace_event_call *call);
extern void filter_free_pred(struct filter_pred *pred);
extern void filter_print_preds(struct filter_pred **preds, int n_preds,
struct trace_seq *s);
@@ -855,13 +768,9 @@ extern int filter_parse(char **pbuf, struct filter_pred *pred);
extern int filter_add_pred(struct ftrace_event_call *call,
struct filter_pred *pred);
extern void filter_disable_preds(struct ftrace_event_call *call);
-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 int
filter_check_discard(struct ftrace_event_call *call, void *rec,
@@ -876,14 +785,6 @@ filter_check_discard(struct ftrace_event_call *call, void *rec,
return 0;
}
-#define __common_field(type, item) \
- ret = trace_define_field(event_call, #type, "common_" #item, \
- offsetof(typeof(field.ent), item), \
- sizeof(field.ent.item)); \
- if (ret) \
- return ret;
-
-void event_trace_printk(unsigned long ip, const char *fmt, ...);
extern struct ftrace_event_call __start_ftrace_events[];
extern struct ftrace_event_call __stop_ftrace_events[];
@@ -895,25 +796,6 @@ extern struct ftrace_event_call __stop_ftrace_events[];
extern const char *__start___trace_bprintk_fmt[];
extern const char *__stop___trace_bprintk_fmt[];
-/*
- * The double __builtin_constant_p is because gcc will give us an error
- * if we try to allocate the static variable to fmt if it is not a
- * constant. Even with the outer if statement optimizing out.
- */
-#define event_trace_printk(ip, fmt, args...) \
-do { \
- __trace_printk_check_format(fmt, ##args); \
- tracing_record_cmdline(current); \
- if (__builtin_constant_p(fmt)) { \
- static const char *trace_printk_fmt \
- __attribute__((section("__trace_printk_fmt"))) = \
- __builtin_constant_p(fmt) ? fmt : NULL; \
- \
- __trace_bprintk(ip, trace_printk_fmt, ##args); \
- } else \
- __trace_printk(ip, fmt, ##args); \
-} while (0)
-
#undef TRACE_EVENT_FORMAT
#define TRACE_EVENT_FORMAT(call, proto, args, fmt, tstruct, tpfmt) \
extern struct ftrace_event_call event_##call;
diff --git a/kernel/trace/trace_output.h b/kernel/trace/trace_output.h
index 5c7cbfb..6e220a8 100644
--- a/kernel/trace/trace_output.h
+++ b/kernel/trace/trace_output.h
@@ -4,18 +4,6 @@
#include <linux/trace_seq.h>
#include "trace.h"
-typedef enum print_line_t (*trace_print_func)(struct trace_iterator *iter,
- int flags);
-
-struct trace_event {
- struct hlist_node node;
- int type;
- trace_print_func trace;
- trace_print_func raw;
- trace_print_func hex;
- trace_print_func binary;
-};
-
extern enum print_line_t
trace_print_bprintk_msg_only(struct trace_iterator *iter);
extern enum print_line_t
@@ -33,8 +21,6 @@ extern int trace_print_context(struct trace_iterator *iter);
extern int trace_print_lat_context(struct trace_iterator *iter);
extern struct trace_event *ftrace_find_event(int type);
-extern int register_ftrace_event(struct trace_event *event);
-extern int unregister_ftrace_event(struct trace_event *event);
extern enum print_line_t trace_nop_print(struct trace_iterator *iter,
int flags);
--
1.6.2.1
--
^ permalink raw reply related [flat|nested] 60+ messages in thread
* [PATCH 5/8] tracing/events: move the ftrace event tracing code to core
2009-04-14 17:23 [PATCH 0/8] [GIT PULL] TRACE_EVENT for modules Steven Rostedt
` (3 preceding siblings ...)
2009-04-14 17:23 ` [PATCH 4/8] tracing/events: move declarations from trace directory to core include Steven Rostedt
@ 2009-04-14 17:23 ` Steven Rostedt
2009-04-14 19:23 ` Peter Zijlstra
2009-04-14 17:23 ` [PATCH 6/8] tracing/events: convert event call sites to use a link list Steven Rostedt
` (5 subsequent siblings)
10 siblings, 1 reply; 60+ messages in thread
From: Steven Rostedt @ 2009-04-14 17:23 UTC (permalink / raw)
To: linux-kernel
Cc: Ingo Molnar, Andrew Morton, Thomas Gleixner, Peter Zijlstra,
Frederic Weisbecker, Theodore Tso, Arjan van de Ven,
Christoph Hellwig, Mathieu Desnoyers, Jeremy Fitzhardinge,
Lai Jiangshan, Zhaolei, Li Zefan, KOSAKI Motohiro,
Masami Hiramatsu, Frank Ch. Eigler, Tom Zanussi, Jiaying Zhang,
Michael Rubin, Martin Bligh
[-- Attachment #1: 0005-tracing-events-move-the-ftrace-event-tracing-code-t.patch --]
[-- Type: text/plain, Size: 30467 bytes --]
From: Steven Rostedt <srostedt@redhat.com>
This patch moves the ftrace creation into include/trace/ftrace.h and
simplifies the work of developers in adding new tracepoints.
Just the act of creating the trace points in include/trace and including
define_trace.h will create the events in the debugfs/tracing/events
directory.
This patch removes the need of include/trace/trace_events.h
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
include/trace/define_trace.h | 4 +
include/trace/ftrace.h | 492 +++++++++++++++++++++++++++++++++++
include/trace/trace_events.h | 7 -
kernel/trace/Makefile | 1 -
kernel/trace/events.c | 15 -
kernel/trace/trace_events_stage_1.h | 39 ---
kernel/trace/trace_events_stage_2.h | 170 ------------
kernel/trace/trace_events_stage_3.h | 279 --------------------
8 files changed, 496 insertions(+), 511 deletions(-)
create mode 100644 include/trace/ftrace.h
delete mode 100644 include/trace/trace_events.h
delete mode 100644 kernel/trace/events.c
delete mode 100644 kernel/trace/trace_events_stage_1.h
delete mode 100644 kernel/trace/trace_events_stage_2.h
delete mode 100644 kernel/trace/trace_events_stage_3.h
diff --git a/include/trace/define_trace.h b/include/trace/define_trace.h
index de9dc7d..980eb66 100644
--- a/include/trace/define_trace.h
+++ b/include/trace/define_trace.h
@@ -56,6 +56,10 @@
#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
+#ifdef CONFIG_EVENT_TRACER
+#include <trace/ftrace.h>
+#endif
+
#undef TRACE_HEADER_MULTI_READ
/* Only undef what we defined in this file */
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h
new file mode 100644
index 0000000..955b967
--- /dev/null
+++ b/include/trace/ftrace.h
@@ -0,0 +1,492 @@
+/*
+ * Stage 1 of the trace events.
+ *
+ * Override the macros in <trace/trace_events.h> to include the following:
+ *
+ * struct ftrace_raw_<call> {
+ * struct trace_entry ent;
+ * <type> <item>;
+ * <type2> <item2>[<len>];
+ * [...]
+ * };
+ *
+ * The <type> <item> is created by the __field(type, item) macro or
+ * the __array(type2, item2, len) macro.
+ * We simply do "type item;", and that will create the fields
+ * in the structure.
+ */
+
+#include <linux/ftrace_event.h>
+
+#undef TRACE_FORMAT
+#define TRACE_FORMAT(call, proto, args, fmt)
+
+#undef __array
+#define __array(type, item, len) type item[len];
+
+#undef __field
+#define __field(type, item) type item;
+
+#undef TP_STRUCT__entry
+#define TP_STRUCT__entry(args...) args
+
+#undef TRACE_EVENT
+#define TRACE_EVENT(name, proto, args, tstruct, assign, print) \
+ struct ftrace_raw_##name { \
+ struct trace_entry ent; \
+ tstruct \
+ }; \
+ static struct ftrace_event_call event_##name
+
+#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
+
+/*
+ * Stage 2 of the trace events.
+ *
+ * Override the macros in <trace/trace_events.h> to include the following:
+ *
+ * enum print_line_t
+ * ftrace_raw_output_<call>(struct trace_iterator *iter, int flags)
+ * {
+ * struct trace_seq *s = &iter->seq;
+ * struct ftrace_raw_<call> *field; <-- defined in stage 1
+ * struct trace_entry *entry;
+ * int ret;
+ *
+ * entry = iter->ent;
+ *
+ * if (entry->type != event_<call>.id) {
+ * WARN_ON_ONCE(1);
+ * return TRACE_TYPE_UNHANDLED;
+ * }
+ *
+ * field = (typeof(field))entry;
+ *
+ * ret = trace_seq_printf(s, <TP_printk> "\n");
+ * if (!ret)
+ * return TRACE_TYPE_PARTIAL_LINE;
+ *
+ * return TRACE_TYPE_HANDLED;
+ * }
+ *
+ * This is the method used to print the raw event to the trace
+ * output format. Note, this is not needed if the data is read
+ * in binary.
+ */
+
+#undef __entry
+#define __entry field
+
+#undef TP_printk
+#define TP_printk(fmt, args...) fmt "\n", args
+
+#undef TRACE_EVENT
+#define TRACE_EVENT(call, proto, args, tstruct, assign, print) \
+enum print_line_t \
+ftrace_raw_output_##call(struct trace_iterator *iter, int flags) \
+{ \
+ struct trace_seq *s = &iter->seq; \
+ struct ftrace_raw_##call *field; \
+ struct trace_entry *entry; \
+ int ret; \
+ \
+ entry = iter->ent; \
+ \
+ if (entry->type != event_##call.id) { \
+ WARN_ON_ONCE(1); \
+ return TRACE_TYPE_UNHANDLED; \
+ } \
+ \
+ field = (typeof(field))entry; \
+ \
+ ret = trace_seq_printf(s, #call ": " print); \
+ if (!ret) \
+ return TRACE_TYPE_PARTIAL_LINE; \
+ \
+ return TRACE_TYPE_HANDLED; \
+}
+
+#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
+
+/*
+ * Setup the showing format of trace point.
+ *
+ * int
+ * ftrace_format_##call(struct trace_seq *s)
+ * {
+ * struct ftrace_raw_##call field;
+ * int ret;
+ *
+ * ret = trace_seq_printf(s, #type " " #item ";"
+ * " offset:%u; size:%u;\n",
+ * offsetof(struct ftrace_raw_##call, item),
+ * sizeof(field.type));
+ *
+ * }
+ */
+
+#undef TP_STRUCT__entry
+#define TP_STRUCT__entry(args...) args
+
+#undef __field
+#define __field(type, item) \
+ ret = trace_seq_printf(s, "\tfield:" #type " " #item ";\t" \
+ "offset:%u;\tsize:%u;\n", \
+ (unsigned int)offsetof(typeof(field), item), \
+ (unsigned int)sizeof(field.item)); \
+ if (!ret) \
+ return 0;
+
+#undef __array
+#define __array(type, item, len) \
+ ret = trace_seq_printf(s, "\tfield:" #type " " #item "[" #len "];\t" \
+ "offset:%u;\tsize:%u;\n", \
+ (unsigned int)offsetof(typeof(field), item), \
+ (unsigned int)sizeof(field.item)); \
+ if (!ret) \
+ return 0;
+
+#undef __entry
+#define __entry REC
+
+#undef TP_printk
+#define TP_printk(fmt, args...) "%s, %s\n", #fmt, __stringify(args)
+
+#undef TP_fast_assign
+#define TP_fast_assign(args...) args
+
+#undef TRACE_EVENT
+#define TRACE_EVENT(call, proto, args, tstruct, func, print) \
+static int \
+ftrace_format_##call(struct trace_seq *s) \
+{ \
+ struct ftrace_raw_##call field; \
+ int ret; \
+ \
+ tstruct; \
+ \
+ trace_seq_printf(s, "\nprint fmt: " print); \
+ \
+ return ret; \
+}
+
+#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
+
+#undef __field
+#define __field(type, item) \
+ ret = trace_define_field(event_call, #type, #item, \
+ offsetof(typeof(field), item), \
+ sizeof(field.item)); \
+ if (ret) \
+ return ret;
+
+#undef __array
+#define __array(type, item, len) \
+ BUILD_BUG_ON(len > MAX_FILTER_STR_VAL); \
+ ret = trace_define_field(event_call, #type "[" #len "]", #item, \
+ offsetof(typeof(field), item), \
+ sizeof(field.item)); \
+ if (ret) \
+ return ret;
+
+#undef TRACE_EVENT
+#define TRACE_EVENT(call, proto, args, tstruct, func, print) \
+int \
+ftrace_define_fields_##call(void) \
+{ \
+ struct ftrace_raw_##call field; \
+ struct ftrace_event_call *event_call = &event_##call; \
+ int ret; \
+ \
+ __common_field(unsigned char, type); \
+ __common_field(unsigned char, flags); \
+ __common_field(unsigned char, preempt_count); \
+ __common_field(int, pid); \
+ __common_field(int, tgid); \
+ \
+ tstruct; \
+ \
+ return ret; \
+}
+
+#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
+
+/*
+ * Stage 3 of the trace events.
+ *
+ * Override the macros in <trace/trace_events.h> to include the following:
+ *
+ * static void ftrace_event_<call>(proto)
+ * {
+ * event_trace_printk(_RET_IP_, "<call>: " <fmt>);
+ * }
+ *
+ * static int ftrace_reg_event_<call>(void)
+ * {
+ * int ret;
+ *
+ * ret = register_trace_<call>(ftrace_event_<call>);
+ * if (!ret)
+ * pr_info("event trace: Could not activate trace point "
+ * "probe to <call>");
+ * return ret;
+ * }
+ *
+ * static void ftrace_unreg_event_<call>(void)
+ * {
+ * unregister_trace_<call>(ftrace_event_<call>);
+ * }
+ *
+ * For those macros defined with TRACE_FORMAT:
+ *
+ * static struct ftrace_event_call __used
+ * __attribute__((__aligned__(4)))
+ * __attribute__((section("_ftrace_events"))) event_<call> = {
+ * .name = "<call>",
+ * .regfunc = ftrace_reg_event_<call>,
+ * .unregfunc = ftrace_unreg_event_<call>,
+ * }
+ *
+ *
+ * For those macros defined with TRACE_EVENT:
+ *
+ * static struct ftrace_event_call event_<call>;
+ *
+ * static void ftrace_raw_event_<call>(proto)
+ * {
+ * struct ring_buffer_event *event;
+ * struct ftrace_raw_<call> *entry; <-- defined in stage 1
+ * unsigned long irq_flags;
+ * int pc;
+ *
+ * local_save_flags(irq_flags);
+ * pc = preempt_count();
+ *
+ * event = trace_current_buffer_lock_reserve(event_<call>.id,
+ * sizeof(struct ftrace_raw_<call>),
+ * irq_flags, pc);
+ * if (!event)
+ * return;
+ * entry = ring_buffer_event_data(event);
+ *
+ * <assign>; <-- Here we assign the entries by the __field and
+ * __array macros.
+ *
+ * trace_current_buffer_unlock_commit(event, irq_flags, pc);
+ * }
+ *
+ * static int ftrace_raw_reg_event_<call>(void)
+ * {
+ * int ret;
+ *
+ * ret = register_trace_<call>(ftrace_raw_event_<call>);
+ * if (!ret)
+ * pr_info("event trace: Could not activate trace point "
+ * "probe to <call>");
+ * return ret;
+ * }
+ *
+ * static void ftrace_unreg_event_<call>(void)
+ * {
+ * unregister_trace_<call>(ftrace_raw_event_<call>);
+ * }
+ *
+ * static struct trace_event ftrace_event_type_<call> = {
+ * .trace = ftrace_raw_output_<call>, <-- stage 2
+ * };
+ *
+ * static int ftrace_raw_init_event_<call>(void)
+ * {
+ * int id;
+ *
+ * id = register_ftrace_event(&ftrace_event_type_<call>);
+ * if (!id)
+ * return -ENODEV;
+ * event_<call>.id = id;
+ * return 0;
+ * }
+ *
+ * static struct ftrace_event_call __used
+ * __attribute__((__aligned__(4)))
+ * __attribute__((section("_ftrace_events"))) event_<call> = {
+ * .name = "<call>",
+ * .system = "<system>",
+ * .raw_init = ftrace_raw_init_event_<call>,
+ * .regfunc = ftrace_reg_event_<call>,
+ * .unregfunc = ftrace_unreg_event_<call>,
+ * .show_format = ftrace_format_<call>,
+ * }
+ *
+ */
+
+#undef TP_FMT
+#define TP_FMT(fmt, args...) fmt "\n", ##args
+
+#ifdef CONFIG_EVENT_PROFILE
+#define _TRACE_PROFILE(call, proto, args) \
+static void ftrace_profile_##call(proto) \
+{ \
+ extern void perf_tpcounter_event(int); \
+ perf_tpcounter_event(event_##call.id); \
+} \
+ \
+static int ftrace_profile_enable_##call(struct ftrace_event_call *call) \
+{ \
+ int ret = 0; \
+ \
+ if (!atomic_inc_return(&call->profile_count)) \
+ ret = register_trace_##call(ftrace_profile_##call); \
+ \
+ return ret; \
+} \
+ \
+static void ftrace_profile_disable_##call(struct ftrace_event_call *call) \
+{ \
+ if (atomic_add_negative(-1, &call->profile_count)) \
+ unregister_trace_##call(ftrace_profile_##call); \
+}
+
+#define _TRACE_PROFILE_INIT(call) \
+ .profile_count = ATOMIC_INIT(-1), \
+ .profile_enable = ftrace_profile_enable_##call, \
+ .profile_disable = ftrace_profile_disable_##call,
+
+#else
+#define _TRACE_PROFILE(call, proto, args)
+#define _TRACE_PROFILE_INIT(call)
+#endif
+
+#define _TRACE_FORMAT(call, proto, args, fmt) \
+static void ftrace_event_##call(proto) \
+{ \
+ event_trace_printk(_RET_IP_, #call ": " fmt); \
+} \
+ \
+static int ftrace_reg_event_##call(void) \
+{ \
+ int ret; \
+ \
+ ret = register_trace_##call(ftrace_event_##call); \
+ if (ret) \
+ pr_info("event trace: Could not activate trace point " \
+ "probe to " #call "\n"); \
+ return ret; \
+} \
+ \
+static void ftrace_unreg_event_##call(void) \
+{ \
+ unregister_trace_##call(ftrace_event_##call); \
+} \
+ \
+static struct ftrace_event_call event_##call; \
+ \
+static int ftrace_init_event_##call(void) \
+{ \
+ int id; \
+ \
+ id = register_ftrace_event(NULL); \
+ if (!id) \
+ return -ENODEV; \
+ event_##call.id = id; \
+ return 0; \
+}
+
+#undef TRACE_FORMAT
+#define TRACE_FORMAT(call, proto, args, fmt) \
+_TRACE_FORMAT(call, PARAMS(proto), PARAMS(args), PARAMS(fmt)) \
+_TRACE_PROFILE(call, PARAMS(proto), PARAMS(args)) \
+static struct ftrace_event_call __used \
+__attribute__((__aligned__(4))) \
+__attribute__((section("_ftrace_events"))) event_##call = { \
+ .name = #call, \
+ .system = __stringify(TRACE_SYSTEM), \
+ .raw_init = ftrace_init_event_##call, \
+ .regfunc = ftrace_reg_event_##call, \
+ .unregfunc = ftrace_unreg_event_##call, \
+ _TRACE_PROFILE_INIT(call) \
+}
+
+#undef __entry
+#define __entry entry
+
+#undef TRACE_EVENT
+#define TRACE_EVENT(call, proto, args, tstruct, assign, print) \
+_TRACE_PROFILE(call, PARAMS(proto), PARAMS(args)) \
+ \
+static struct ftrace_event_call event_##call; \
+ \
+static void ftrace_raw_event_##call(proto) \
+{ \
+ struct ftrace_event_call *call = &event_##call; \
+ struct ring_buffer_event *event; \
+ struct ftrace_raw_##call *entry; \
+ unsigned long irq_flags; \
+ int pc; \
+ \
+ local_save_flags(irq_flags); \
+ pc = preempt_count(); \
+ \
+ event = trace_current_buffer_lock_reserve(event_##call.id, \
+ sizeof(struct ftrace_raw_##call), \
+ irq_flags, pc); \
+ if (!event) \
+ return; \
+ entry = ring_buffer_event_data(event); \
+ \
+ assign; \
+ \
+ 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) \
+{ \
+ int ret; \
+ \
+ ret = register_trace_##call(ftrace_raw_event_##call); \
+ if (ret) \
+ pr_info("event trace: Could not activate trace point " \
+ "probe to " #call "\n"); \
+ return ret; \
+} \
+ \
+static void ftrace_raw_unreg_event_##call(void) \
+{ \
+ unregister_trace_##call(ftrace_raw_event_##call); \
+} \
+ \
+static struct trace_event ftrace_event_type_##call = { \
+ .trace = ftrace_raw_output_##call, \
+}; \
+ \
+static int ftrace_raw_init_event_##call(void) \
+{ \
+ int id; \
+ \
+ id = register_ftrace_event(&ftrace_event_type_##call); \
+ if (!id) \
+ return -ENODEV; \
+ event_##call.id = id; \
+ INIT_LIST_HEAD(&event_##call.fields); \
+ init_preds(&event_##call); \
+ return 0; \
+} \
+ \
+static struct ftrace_event_call __used \
+__attribute__((__aligned__(4))) \
+__attribute__((section("_ftrace_events"))) event_##call = { \
+ .name = #call, \
+ .system = __stringify(TRACE_SYSTEM), \
+ .raw_init = ftrace_raw_init_event_##call, \
+ .regfunc = ftrace_raw_reg_event_##call, \
+ .unregfunc = ftrace_raw_unreg_event_##call, \
+ .show_format = ftrace_format_##call, \
+ .define_fields = ftrace_define_fields_##call, \
+ _TRACE_PROFILE_INIT(call) \
+}
+
+#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
+
+#undef _TRACE_PROFILE
+#undef _TRACE_PROFILE_INIT
+
diff --git a/include/trace/trace_events.h b/include/trace/trace_events.h
deleted file mode 100644
index 13d6b85..0000000
--- a/include/trace/trace_events.h
+++ /dev/null
@@ -1,7 +0,0 @@
-/* trace/<type>.h here */
-
-#include <trace/sched.h>
-#include <trace/irq.h>
-#include <trace/lockdep.h>
-#include <trace/skb.h>
-#include <trace/kmem.h>
diff --git a/kernel/trace/Makefile b/kernel/trace/Makefile
index 3ad367e..fb9d7f9 100644
--- a/kernel/trace/Makefile
+++ b/kernel/trace/Makefile
@@ -41,7 +41,6 @@ obj-$(CONFIG_KMEMTRACE) += kmemtrace.o
obj-$(CONFIG_WORKQUEUE_TRACER) += trace_workqueue.o
obj-$(CONFIG_BLK_DEV_IO_TRACE) += blktrace.o
obj-$(CONFIG_EVENT_TRACING) += trace_events.o
-obj-$(CONFIG_EVENT_TRACER) += events.o
obj-$(CONFIG_EVENT_TRACING) += trace_export.o
obj-$(CONFIG_FTRACE_SYSCALLS) += trace_syscalls.o
obj-$(CONFIG_EVENT_PROFILE) += trace_event_profile.o
diff --git a/kernel/trace/events.c b/kernel/trace/events.c
deleted file mode 100644
index 5a35a91..0000000
--- a/kernel/trace/events.c
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- * This is the place to register all trace points as events.
- */
-
-#include <linux/stringify.h>
-
-#include <trace/trace_events.h>
-
-#include "trace_output.h"
-
-#define TRACE_HEADER_MULTI_READ
-#include "trace_events_stage_1.h"
-#include "trace_events_stage_2.h"
-#include "trace_events_stage_3.h"
-
diff --git a/kernel/trace/trace_events_stage_1.h b/kernel/trace/trace_events_stage_1.h
deleted file mode 100644
index 475f46a..0000000
--- a/kernel/trace/trace_events_stage_1.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Stage 1 of the trace events.
- *
- * Override the macros in <trace/trace_events.h> to include the following:
- *
- * struct ftrace_raw_<call> {
- * struct trace_entry ent;
- * <type> <item>;
- * <type2> <item2>[<len>];
- * [...]
- * };
- *
- * The <type> <item> is created by the __field(type, item) macro or
- * the __array(type2, item2, len) macro.
- * We simply do "type item;", and that will create the fields
- * in the structure.
- */
-
-#undef TRACE_FORMAT
-#define TRACE_FORMAT(call, proto, args, fmt)
-
-#undef __array
-#define __array(type, item, len) type item[len];
-
-#undef __field
-#define __field(type, item) type item;
-
-#undef TP_STRUCT__entry
-#define TP_STRUCT__entry(args...) args
-
-#undef TRACE_EVENT
-#define TRACE_EVENT(name, proto, args, tstruct, assign, print) \
- struct ftrace_raw_##name { \
- struct trace_entry ent; \
- tstruct \
- }; \
- static struct ftrace_event_call event_##name
-
-#include <trace/trace_events.h>
diff --git a/kernel/trace/trace_events_stage_2.h b/kernel/trace/trace_events_stage_2.h
deleted file mode 100644
index aa4a67a..0000000
--- a/kernel/trace/trace_events_stage_2.h
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * Stage 2 of the trace events.
- *
- * Override the macros in <trace/trace_events.h> to include the following:
- *
- * enum print_line_t
- * ftrace_raw_output_<call>(struct trace_iterator *iter, int flags)
- * {
- * struct trace_seq *s = &iter->seq;
- * struct ftrace_raw_<call> *field; <-- defined in stage 1
- * struct trace_entry *entry;
- * int ret;
- *
- * entry = iter->ent;
- *
- * if (entry->type != event_<call>.id) {
- * WARN_ON_ONCE(1);
- * return TRACE_TYPE_UNHANDLED;
- * }
- *
- * field = (typeof(field))entry;
- *
- * ret = trace_seq_printf(s, <TP_printk> "\n");
- * if (!ret)
- * return TRACE_TYPE_PARTIAL_LINE;
- *
- * return TRACE_TYPE_HANDLED;
- * }
- *
- * This is the method used to print the raw event to the trace
- * output format. Note, this is not needed if the data is read
- * in binary.
- */
-
-#undef __entry
-#define __entry field
-
-#undef TP_printk
-#define TP_printk(fmt, args...) fmt "\n", args
-
-#undef TRACE_EVENT
-#define TRACE_EVENT(call, proto, args, tstruct, assign, print) \
-enum print_line_t \
-ftrace_raw_output_##call(struct trace_iterator *iter, int flags) \
-{ \
- struct trace_seq *s = &iter->seq; \
- struct ftrace_raw_##call *field; \
- struct trace_entry *entry; \
- int ret; \
- \
- entry = iter->ent; \
- \
- if (entry->type != event_##call.id) { \
- WARN_ON_ONCE(1); \
- return TRACE_TYPE_UNHANDLED; \
- } \
- \
- field = (typeof(field))entry; \
- \
- ret = trace_seq_printf(s, #call ": " print); \
- if (!ret) \
- return TRACE_TYPE_PARTIAL_LINE; \
- \
- return TRACE_TYPE_HANDLED; \
-}
-
-#include <trace/trace_events.h>
-
-/*
- * Setup the showing format of trace point.
- *
- * int
- * ftrace_format_##call(struct trace_seq *s)
- * {
- * struct ftrace_raw_##call field;
- * int ret;
- *
- * ret = trace_seq_printf(s, #type " " #item ";"
- * " offset:%u; size:%u;\n",
- * offsetof(struct ftrace_raw_##call, item),
- * sizeof(field.type));
- *
- * }
- */
-
-#undef TP_STRUCT__entry
-#define TP_STRUCT__entry(args...) args
-
-#undef __field
-#define __field(type, item) \
- ret = trace_seq_printf(s, "\tfield:" #type " " #item ";\t" \
- "offset:%u;\tsize:%u;\n", \
- (unsigned int)offsetof(typeof(field), item), \
- (unsigned int)sizeof(field.item)); \
- if (!ret) \
- return 0;
-
-#undef __array
-#define __array(type, item, len) \
- ret = trace_seq_printf(s, "\tfield:" #type " " #item "[" #len "];\t" \
- "offset:%u;\tsize:%u;\n", \
- (unsigned int)offsetof(typeof(field), item), \
- (unsigned int)sizeof(field.item)); \
- if (!ret) \
- return 0;
-
-#undef __entry
-#define __entry REC
-
-#undef TP_printk
-#define TP_printk(fmt, args...) "%s, %s\n", #fmt, __stringify(args)
-
-#undef TP_fast_assign
-#define TP_fast_assign(args...) args
-
-#undef TRACE_EVENT
-#define TRACE_EVENT(call, proto, args, tstruct, func, print) \
-static int \
-ftrace_format_##call(struct trace_seq *s) \
-{ \
- struct ftrace_raw_##call field; \
- int ret; \
- \
- tstruct; \
- \
- trace_seq_printf(s, "\nprint fmt: " print); \
- \
- return ret; \
-}
-
-#include <trace/trace_events.h>
-
-#undef __field
-#define __field(type, item) \
- ret = trace_define_field(event_call, #type, #item, \
- offsetof(typeof(field), item), \
- sizeof(field.item)); \
- if (ret) \
- return ret;
-
-#undef __array
-#define __array(type, item, len) \
- BUILD_BUG_ON(len > MAX_FILTER_STR_VAL); \
- ret = trace_define_field(event_call, #type "[" #len "]", #item, \
- offsetof(typeof(field), item), \
- sizeof(field.item)); \
- if (ret) \
- return ret;
-
-#undef TRACE_EVENT
-#define TRACE_EVENT(call, proto, args, tstruct, func, print) \
-int \
-ftrace_define_fields_##call(void) \
-{ \
- struct ftrace_raw_##call field; \
- struct ftrace_event_call *event_call = &event_##call; \
- int ret; \
- \
- __common_field(unsigned char, type); \
- __common_field(unsigned char, flags); \
- __common_field(unsigned char, preempt_count); \
- __common_field(int, pid); \
- __common_field(int, tgid); \
- \
- tstruct; \
- \
- return ret; \
-}
-
-#include <trace/trace_events.h>
diff --git a/kernel/trace/trace_events_stage_3.h b/kernel/trace/trace_events_stage_3.h
deleted file mode 100644
index 45c04e1..0000000
--- a/kernel/trace/trace_events_stage_3.h
+++ /dev/null
@@ -1,279 +0,0 @@
-/*
- * Stage 3 of the trace events.
- *
- * Override the macros in <trace/trace_events.h> to include the following:
- *
- * static void ftrace_event_<call>(proto)
- * {
- * event_trace_printk(_RET_IP_, "<call>: " <fmt>);
- * }
- *
- * static int ftrace_reg_event_<call>(void)
- * {
- * int ret;
- *
- * ret = register_trace_<call>(ftrace_event_<call>);
- * if (!ret)
- * pr_info("event trace: Could not activate trace point "
- * "probe to <call>");
- * return ret;
- * }
- *
- * static void ftrace_unreg_event_<call>(void)
- * {
- * unregister_trace_<call>(ftrace_event_<call>);
- * }
- *
- * For those macros defined with TRACE_FORMAT:
- *
- * static struct ftrace_event_call __used
- * __attribute__((__aligned__(4)))
- * __attribute__((section("_ftrace_events"))) event_<call> = {
- * .name = "<call>",
- * .regfunc = ftrace_reg_event_<call>,
- * .unregfunc = ftrace_unreg_event_<call>,
- * }
- *
- *
- * For those macros defined with TRACE_EVENT:
- *
- * static struct ftrace_event_call event_<call>;
- *
- * static void ftrace_raw_event_<call>(proto)
- * {
- * struct ring_buffer_event *event;
- * struct ftrace_raw_<call> *entry; <-- defined in stage 1
- * unsigned long irq_flags;
- * int pc;
- *
- * local_save_flags(irq_flags);
- * pc = preempt_count();
- *
- * event = trace_current_buffer_lock_reserve(event_<call>.id,
- * sizeof(struct ftrace_raw_<call>),
- * irq_flags, pc);
- * if (!event)
- * return;
- * entry = ring_buffer_event_data(event);
- *
- * <assign>; <-- Here we assign the entries by the __field and
- * __array macros.
- *
- * trace_current_buffer_unlock_commit(event, irq_flags, pc);
- * }
- *
- * static int ftrace_raw_reg_event_<call>(void)
- * {
- * int ret;
- *
- * ret = register_trace_<call>(ftrace_raw_event_<call>);
- * if (!ret)
- * pr_info("event trace: Could not activate trace point "
- * "probe to <call>");
- * return ret;
- * }
- *
- * static void ftrace_unreg_event_<call>(void)
- * {
- * unregister_trace_<call>(ftrace_raw_event_<call>);
- * }
- *
- * static struct trace_event ftrace_event_type_<call> = {
- * .trace = ftrace_raw_output_<call>, <-- stage 2
- * };
- *
- * static int ftrace_raw_init_event_<call>(void)
- * {
- * int id;
- *
- * id = register_ftrace_event(&ftrace_event_type_<call>);
- * if (!id)
- * return -ENODEV;
- * event_<call>.id = id;
- * return 0;
- * }
- *
- * static struct ftrace_event_call __used
- * __attribute__((__aligned__(4)))
- * __attribute__((section("_ftrace_events"))) event_<call> = {
- * .name = "<call>",
- * .system = "<system>",
- * .raw_init = ftrace_raw_init_event_<call>,
- * .regfunc = ftrace_reg_event_<call>,
- * .unregfunc = ftrace_unreg_event_<call>,
- * .show_format = ftrace_format_<call>,
- * }
- *
- */
-
-#undef TP_FMT
-#define TP_FMT(fmt, args...) fmt "\n", ##args
-
-#ifdef CONFIG_EVENT_PROFILE
-#define _TRACE_PROFILE(call, proto, args) \
-static void ftrace_profile_##call(proto) \
-{ \
- extern void perf_tpcounter_event(int); \
- perf_tpcounter_event(event_##call.id); \
-} \
- \
-static int ftrace_profile_enable_##call(struct ftrace_event_call *call) \
-{ \
- int ret = 0; \
- \
- if (!atomic_inc_return(&call->profile_count)) \
- ret = register_trace_##call(ftrace_profile_##call); \
- \
- return ret; \
-} \
- \
-static void ftrace_profile_disable_##call(struct ftrace_event_call *call) \
-{ \
- if (atomic_add_negative(-1, &call->profile_count)) \
- unregister_trace_##call(ftrace_profile_##call); \
-}
-
-#define _TRACE_PROFILE_INIT(call) \
- .profile_count = ATOMIC_INIT(-1), \
- .profile_enable = ftrace_profile_enable_##call, \
- .profile_disable = ftrace_profile_disable_##call,
-
-#else
-#define _TRACE_PROFILE(call, proto, args)
-#define _TRACE_PROFILE_INIT(call)
-#endif
-
-#define _TRACE_FORMAT(call, proto, args, fmt) \
-static void ftrace_event_##call(proto) \
-{ \
- event_trace_printk(_RET_IP_, #call ": " fmt); \
-} \
- \
-static int ftrace_reg_event_##call(void) \
-{ \
- int ret; \
- \
- ret = register_trace_##call(ftrace_event_##call); \
- if (ret) \
- pr_info("event trace: Could not activate trace point " \
- "probe to " #call "\n"); \
- return ret; \
-} \
- \
-static void ftrace_unreg_event_##call(void) \
-{ \
- unregister_trace_##call(ftrace_event_##call); \
-} \
- \
-static struct ftrace_event_call event_##call; \
- \
-static int ftrace_init_event_##call(void) \
-{ \
- int id; \
- \
- id = register_ftrace_event(NULL); \
- if (!id) \
- return -ENODEV; \
- event_##call.id = id; \
- return 0; \
-}
-
-#undef TRACE_FORMAT
-#define TRACE_FORMAT(call, proto, args, fmt) \
-_TRACE_FORMAT(call, PARAMS(proto), PARAMS(args), PARAMS(fmt)) \
-_TRACE_PROFILE(call, PARAMS(proto), PARAMS(args)) \
-static struct ftrace_event_call __used \
-__attribute__((__aligned__(4))) \
-__attribute__((section("_ftrace_events"))) event_##call = { \
- .name = #call, \
- .system = __stringify(TRACE_SYSTEM), \
- .raw_init = ftrace_init_event_##call, \
- .regfunc = ftrace_reg_event_##call, \
- .unregfunc = ftrace_unreg_event_##call, \
- _TRACE_PROFILE_INIT(call) \
-}
-
-#undef __entry
-#define __entry entry
-
-#undef TRACE_EVENT
-#define TRACE_EVENT(call, proto, args, tstruct, assign, print) \
-_TRACE_PROFILE(call, PARAMS(proto), PARAMS(args)) \
- \
-static struct ftrace_event_call event_##call; \
- \
-static void ftrace_raw_event_##call(proto) \
-{ \
- struct ftrace_event_call *call = &event_##call; \
- struct ring_buffer_event *event; \
- struct ftrace_raw_##call *entry; \
- unsigned long irq_flags; \
- int pc; \
- \
- local_save_flags(irq_flags); \
- pc = preempt_count(); \
- \
- event = trace_current_buffer_lock_reserve(event_##call.id, \
- sizeof(struct ftrace_raw_##call), \
- irq_flags, pc); \
- if (!event) \
- return; \
- entry = ring_buffer_event_data(event); \
- \
- assign; \
- \
- 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) \
-{ \
- int ret; \
- \
- ret = register_trace_##call(ftrace_raw_event_##call); \
- if (ret) \
- pr_info("event trace: Could not activate trace point " \
- "probe to " #call "\n"); \
- return ret; \
-} \
- \
-static void ftrace_raw_unreg_event_##call(void) \
-{ \
- unregister_trace_##call(ftrace_raw_event_##call); \
-} \
- \
-static struct trace_event ftrace_event_type_##call = { \
- .trace = ftrace_raw_output_##call, \
-}; \
- \
-static int ftrace_raw_init_event_##call(void) \
-{ \
- int id; \
- \
- id = register_ftrace_event(&ftrace_event_type_##call); \
- if (!id) \
- return -ENODEV; \
- event_##call.id = id; \
- INIT_LIST_HEAD(&event_##call.fields); \
- init_preds(&event_##call); \
- return 0; \
-} \
- \
-static struct ftrace_event_call __used \
-__attribute__((__aligned__(4))) \
-__attribute__((section("_ftrace_events"))) event_##call = { \
- .name = #call, \
- .system = __stringify(TRACE_SYSTEM), \
- .raw_init = ftrace_raw_init_event_##call, \
- .regfunc = ftrace_raw_reg_event_##call, \
- .unregfunc = ftrace_raw_unreg_event_##call, \
- .show_format = ftrace_format_##call, \
- .define_fields = ftrace_define_fields_##call, \
- _TRACE_PROFILE_INIT(call) \
-}
-
-#include <trace/trace_events.h>
-
-#undef _TRACE_PROFILE
-#undef _TRACE_PROFILE_INIT
-
--
1.6.2.1
--
^ permalink raw reply related [flat|nested] 60+ messages in thread
* [PATCH 6/8] tracing/events: convert event call sites to use a link list
2009-04-14 17:23 [PATCH 0/8] [GIT PULL] TRACE_EVENT for modules Steven Rostedt
` (4 preceding siblings ...)
2009-04-14 17:23 ` [PATCH 5/8] tracing/events: move the ftrace event tracing code to core Steven Rostedt
@ 2009-04-14 17:23 ` Steven Rostedt
2009-04-14 17:23 ` [PATCH 7/8] tracing/events: add export symbols for trace events in modules Steven Rostedt
` (4 subsequent siblings)
10 siblings, 0 replies; 60+ messages in thread
From: Steven Rostedt @ 2009-04-14 17:23 UTC (permalink / raw)
To: linux-kernel
Cc: Ingo Molnar, Andrew Morton, Thomas Gleixner, Peter Zijlstra,
Frederic Weisbecker, Theodore Tso, Arjan van de Ven,
Christoph Hellwig, Mathieu Desnoyers, Jeremy Fitzhardinge,
Lai Jiangshan, Zhaolei, Li Zefan, KOSAKI Motohiro,
Masami Hiramatsu, Frank Ch. Eigler, Tom Zanussi, Jiaying Zhang,
Michael Rubin, Martin Bligh
[-- Attachment #1: 0006-tracing-events-convert-event-call-sites-to-use-a-li.patch --]
[-- Type: text/plain, Size: 8317 bytes --]
From: Steven Rostedt <srostedt@redhat.com>
Impact: makes it possible to define events in modules
The events are created by reading down the section that they are linked
in by the macros. But this is not scalable to modules. This patch converts
the manipulations to use a global link list, and on boot up it adds
the items in the section to the list.
This change will allow modules to add their tracing events to the list as
well.
Note, this change alone does not permit modules to use the TRACE_EVENT macros,
but the change is needed for them to eventually do so.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
include/linux/ftrace_event.h | 1 +
kernel/trace/trace.h | 13 +--------
kernel/trace/trace_event_profile.c | 4 +-
kernel/trace/trace_events.c | 51 ++++++++++++++++++++++--------------
kernel/trace/trace_events_filter.c | 8 +++---
5 files changed, 39 insertions(+), 38 deletions(-)
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h
index 496b76d..1781085 100644
--- a/include/linux/ftrace_event.h
+++ b/include/linux/ftrace_event.h
@@ -83,6 +83,7 @@ void trace_current_buffer_discard_commit(struct ring_buffer_event *event);
void tracing_record_cmdline(struct task_struct *tsk);
struct ftrace_event_call {
+ struct list_head list;
char *name;
char *system;
struct dentry *dir;
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index 6bcdf4a..8817c18 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -739,11 +739,6 @@ struct event_subsystem {
struct filter_pred **preds;
};
-#define events_for_each(event) \
- for (event = __start_ftrace_events; \
- (unsigned long)event < (unsigned long)__stop_ftrace_events; \
- event++)
-
struct filter_pred;
typedef int (*filter_pred_fn_t) (struct filter_pred *pred, void *event);
@@ -785,13 +780,7 @@ filter_check_discard(struct ftrace_event_call *call, void *rec,
return 0;
}
-extern struct ftrace_event_call __start_ftrace_events[];
-extern struct ftrace_event_call __stop_ftrace_events[];
-
-#define for_each_event(event) \
- for (event = __start_ftrace_events; \
- (unsigned long)event < (unsigned long)__stop_ftrace_events; \
- event++)
+extern struct list_head ftrace_events;
extern const char *__start___trace_bprintk_fmt[];
extern const char *__stop___trace_bprintk_fmt[];
diff --git a/kernel/trace/trace_event_profile.c b/kernel/trace/trace_event_profile.c
index 199de9c..7bf2ad6 100644
--- a/kernel/trace/trace_event_profile.c
+++ b/kernel/trace/trace_event_profile.c
@@ -11,7 +11,7 @@ int ftrace_profile_enable(int event_id)
{
struct ftrace_event_call *event;
- for_each_event(event) {
+ list_for_each_entry(event, &ftrace_events, list) {
if (event->id == event_id)
return event->profile_enable(event);
}
@@ -23,7 +23,7 @@ void ftrace_profile_disable(int event_id)
{
struct ftrace_event_call *event;
- for_each_event(event) {
+ list_for_each_entry(event, &ftrace_events, list) {
if (event->id == event_id)
return event->profile_disable(event);
}
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
index ead68ac..5c66aaf 100644
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -19,6 +19,8 @@
static DEFINE_MUTEX(event_mutex);
+LIST_HEAD(ftrace_events);
+
int trace_define_field(struct ftrace_event_call *call, char *type,
char *name, int offset, int size)
{
@@ -54,16 +56,14 @@ err:
static void ftrace_clear_events(void)
{
- struct ftrace_event_call *call = (void *)__start_ftrace_events;
-
+ struct ftrace_event_call *call;
- while ((unsigned long)call < (unsigned long)__stop_ftrace_events) {
+ list_for_each_entry(call, &ftrace_events, list) {
if (call->enabled) {
call->enabled = 0;
call->unregfunc();
}
- call++;
}
}
@@ -89,7 +89,7 @@ static void ftrace_event_enable_disable(struct ftrace_event_call *call,
static int ftrace_set_clr_event(char *buf, int set)
{
- struct ftrace_event_call *call = __start_ftrace_events;
+ struct ftrace_event_call *call;
char *event = NULL, *sub = NULL, *match;
int ret = -EINVAL;
@@ -118,7 +118,7 @@ static int ftrace_set_clr_event(char *buf, int set)
}
mutex_lock(&event_mutex);
- for_each_event(call) {
+ list_for_each_entry(call, &ftrace_events, list) {
if (!call->name || !call->regfunc)
continue;
@@ -224,15 +224,17 @@ ftrace_event_write(struct file *file, const char __user *ubuf,
static void *
t_next(struct seq_file *m, void *v, loff_t *pos)
{
- struct ftrace_event_call *call = m->private;
- struct ftrace_event_call *next = call;
+ struct list_head *list = m->private;
+ struct ftrace_event_call *call;
(*pos)++;
for (;;) {
- if ((unsigned long)call >= (unsigned long)__stop_ftrace_events)
+ if (list == &ftrace_events)
return NULL;
+ call = list_entry(list, struct ftrace_event_call, list);
+
/*
* The ftrace subsystem is for showing formats only.
* They can not be enabled or disabled via the event files.
@@ -240,11 +242,10 @@ t_next(struct seq_file *m, void *v, loff_t *pos)
if (call->regfunc)
break;
- call++;
- next = call;
+ list = list->next;
}
- m->private = ++next;
+ m->private = list->next;
return call;
}
@@ -257,22 +258,23 @@ static void *t_start(struct seq_file *m, loff_t *pos)
static void *
s_next(struct seq_file *m, void *v, loff_t *pos)
{
- struct ftrace_event_call *call = m->private;
- struct ftrace_event_call *next;
+ struct list_head *list = m->private;
+ struct ftrace_event_call *call;
(*pos)++;
retry:
- if ((unsigned long)call >= (unsigned long)__stop_ftrace_events)
+ if (list == &ftrace_events)
return NULL;
+ call = list_entry(list, struct ftrace_event_call, list);
+
if (!call->enabled) {
- call++;
+ list = list->next;
goto retry;
}
- next = call;
- m->private = ++next;
+ m->private = list->next;
return call;
}
@@ -312,7 +314,7 @@ ftrace_event_seq_open(struct inode *inode, struct file *file)
if (!ret) {
struct seq_file *m = file->private_data;
- m->private = __start_ftrace_events;
+ m->private = ftrace_events.next;
}
return ret;
}
@@ -797,9 +799,17 @@ event_create_dir(struct ftrace_event_call *call, struct dentry *d_events)
return 0;
}
+extern struct ftrace_event_call __start_ftrace_events[];
+extern struct ftrace_event_call __stop_ftrace_events[];
+
+#define for_each_event(event) \
+ for (event = __start_ftrace_events; \
+ (unsigned long)event < (unsigned long)__stop_ftrace_events; \
+ event++)
+
static __init int event_trace_init(void)
{
- struct ftrace_event_call *call = __start_ftrace_events;
+ struct ftrace_event_call *call;
struct dentry *d_tracer;
struct dentry *entry;
struct dentry *d_events;
@@ -830,6 +840,7 @@ static __init int event_trace_init(void)
/* The linker may leave blanks */
if (!call->name)
continue;
+ list_add(&call->list, &ftrace_events);
event_create_dir(call, d_events);
}
diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c
index de42dad..d30b06b 100644
--- a/kernel/trace/trace_events_filter.c
+++ b/kernel/trace/trace_events_filter.c
@@ -223,7 +223,7 @@ oom:
void filter_free_subsystem_preds(struct event_subsystem *system)
{
- struct ftrace_event_call *call = __start_ftrace_events;
+ struct ftrace_event_call *call;
int i;
if (system->n_preds) {
@@ -234,7 +234,7 @@ void filter_free_subsystem_preds(struct event_subsystem *system)
system->n_preds = 0;
}
- events_for_each(call) {
+ list_for_each_entry(call, &ftrace_events, list) {
if (!call->define_fields)
continue;
@@ -320,7 +320,7 @@ int filter_add_pred(struct ftrace_event_call *call, struct filter_pred *pred)
int filter_add_subsystem_pred(struct event_subsystem *system,
struct filter_pred *pred)
{
- struct ftrace_event_call *call = __start_ftrace_events;
+ struct ftrace_event_call *call;
if (system->n_preds && !pred->compound)
filter_free_subsystem_preds(system);
@@ -337,7 +337,7 @@ int filter_add_subsystem_pred(struct event_subsystem *system,
system->preds[system->n_preds] = pred;
- events_for_each(call) {
+ list_for_each_entry(call, &ftrace_events, list) {
int err;
if (!call->define_fields)
--
1.6.2.1
--
^ permalink raw reply related [flat|nested] 60+ messages in thread
* [PATCH 7/8] tracing/events: add export symbols for trace events in modules
2009-04-14 17:23 [PATCH 0/8] [GIT PULL] TRACE_EVENT for modules Steven Rostedt
` (5 preceding siblings ...)
2009-04-14 17:23 ` [PATCH 6/8] tracing/events: convert event call sites to use a link list Steven Rostedt
@ 2009-04-14 17:23 ` Steven Rostedt
2009-04-14 17:23 ` [PATCH 8/8] tracing/events: add support for modules to TRACE_EVENT Steven Rostedt
` (3 subsequent siblings)
10 siblings, 0 replies; 60+ messages in thread
From: Steven Rostedt @ 2009-04-14 17:23 UTC (permalink / raw)
To: linux-kernel
Cc: Ingo Molnar, Andrew Morton, Thomas Gleixner, Peter Zijlstra,
Frederic Weisbecker, Theodore Tso, Arjan van de Ven,
Christoph Hellwig, Mathieu Desnoyers, Jeremy Fitzhardinge,
Lai Jiangshan, Zhaolei, Li Zefan, KOSAKI Motohiro,
Masami Hiramatsu, Frank Ch. Eigler, Tom Zanussi, Jiaying Zhang,
Michael Rubin, Martin Bligh
[-- Attachment #1: 0007-tracing-events-add-export-symbols-for-trace-events.patch --]
[-- Type: text/plain, Size: 3184 bytes --]
From: Steven Rostedt <srostedt@redhat.com>
Impact: let modules add trace events
The trace event code requires some functions to be exported to allow
modules to use TRACE_EVENT. This patch adds EXPORT_SYMBOL_GPL to the
necessary functions.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
kernel/trace/trace.c | 3 +++
kernel/trace/trace_events.c | 1 +
kernel/trace/trace_events_filter.c | 2 ++
kernel/trace/trace_output.c | 3 +++
4 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index c0047fc..2d69b26 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -176,6 +176,7 @@ int filter_current_check_discard(struct ftrace_event_call *call, void *rec,
{
return filter_check_discard(call, rec, global_trace.buffer, event);
}
+EXPORT_SYMBOL_GPL(filter_current_check_discard);
cycle_t ftrace_now(int cpu)
{
@@ -886,6 +887,7 @@ trace_current_buffer_lock_reserve(unsigned char type, unsigned long len,
return trace_buffer_lock_reserve(&global_trace,
type, len, flags, pc);
}
+EXPORT_SYMBOL(trace_current_buffer_lock_reserve);
void trace_current_buffer_unlock_commit(struct ring_buffer_event *event,
unsigned long flags, int pc)
@@ -903,6 +905,7 @@ void trace_current_buffer_discard_commit(struct ring_buffer_event *event)
{
ring_buffer_discard_commit(global_trace.buffer, event);
}
+EXPORT_SYMBOL_GPL(trace_nowake_buffer_unlock_commit);
void
trace_function(struct trace_array *tr,
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
index 5c66aaf..8b9e621 100644
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -53,6 +53,7 @@ err:
return -ENOMEM;
}
+EXPORT_SYMBOL_GPL(trace_define_field);
static void ftrace_clear_events(void)
{
diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c
index d30b06b..f8e5eab 100644
--- a/kernel/trace/trace_events_filter.c
+++ b/kernel/trace/trace_events_filter.c
@@ -110,6 +110,7 @@ int filter_match_preds(struct ftrace_event_call *call, void *rec)
return 1;
}
+EXPORT_SYMBOL_GPL(filter_match_preds);
void filter_print_preds(struct filter_pred **preds, int n_preds,
struct trace_seq *s)
@@ -220,6 +221,7 @@ oom:
return -ENOMEM;
}
+EXPORT_SYMBOL_GPL(init_preds);
void filter_free_subsystem_preds(struct event_subsystem *system)
{
diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c
index 0e70fb0..83a8abb 100644
--- a/kernel/trace/trace_output.c
+++ b/kernel/trace/trace_output.c
@@ -94,6 +94,7 @@ trace_seq_printf(struct trace_seq *s, const char *fmt, ...)
return len;
}
+EXPORT_SYMBOL_GPL(trace_seq_printf);
int trace_seq_bprintf(struct trace_seq *s, const char *fmt, const u32 *binary)
{
@@ -538,6 +539,7 @@ int register_ftrace_event(struct trace_event *event)
return ret;
}
+EXPORT_SYMBOL_GPL(register_ftrace_event);
/**
* unregister_ftrace_event - remove a no longer used event
@@ -551,6 +553,7 @@ int unregister_ftrace_event(struct trace_event *event)
return 0;
}
+EXPORT_SYMBOL_GPL(unregister_ftrace_event);
/*
* Standard events
--
1.6.2.1
--
^ permalink raw reply related [flat|nested] 60+ messages in thread
* [PATCH 8/8] tracing/events: add support for modules to TRACE_EVENT
2009-04-14 17:23 [PATCH 0/8] [GIT PULL] TRACE_EVENT for modules Steven Rostedt
` (6 preceding siblings ...)
2009-04-14 17:23 ` [PATCH 7/8] tracing/events: add export symbols for trace events in modules Steven Rostedt
@ 2009-04-14 17:23 ` Steven Rostedt
2009-04-15 3:22 ` Rusty Russell
2009-04-14 18:15 ` [PATCH 0/8] [GIT PULL] TRACE_EVENT for modules Ingo Molnar
` (2 subsequent siblings)
10 siblings, 1 reply; 60+ messages in thread
From: Steven Rostedt @ 2009-04-14 17:23 UTC (permalink / raw)
To: linux-kernel
Cc: Ingo Molnar, Andrew Morton, Thomas Gleixner, Peter Zijlstra,
Frederic Weisbecker, Theodore Tso, Arjan van de Ven,
Christoph Hellwig, Mathieu Desnoyers, Jeremy Fitzhardinge,
Lai Jiangshan, Zhaolei, Li Zefan, KOSAKI Motohiro,
Masami Hiramatsu, Frank Ch. Eigler, Tom Zanussi, Jiaying Zhang,
Michael Rubin, Martin Bligh, Rusty Russell
[-- Attachment #1: 0008-tracing-events-add-support-for-modules-to-TRACE_EVE.patch --]
[-- Type: text/plain, Size: 8906 bytes --]
From: Steven Rostedt <srostedt@redhat.com>
Impact: allow modules to add TRACE_EVENTS on load
This patch adds the final hooks to allow modules to use the TRACE_EVENT
macro. A notifier and a data structure are used to link the TRACE_EVENTs
defined in the module to connect them with the ftrace event tracing system.
It also adds the necessary automated clean ups to the trace events when a
module is removed.
Cc: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
include/linux/ftrace_event.h | 3 +
include/linux/module.h | 4 +
include/linux/trace_seq.h | 2 +
include/trace/ftrace.h | 1 +
kernel/module.c | 7 ++
kernel/trace/trace_events.c | 128 +++++++++++++++++++++++++++++++-----------
6 files changed, 113 insertions(+), 32 deletions(-)
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h
index 1781085..75f3ac0 100644
--- a/include/linux/ftrace_event.h
+++ b/include/linux/ftrace_event.h
@@ -7,6 +7,7 @@
struct trace_array;
struct tracer;
+struct dentry;
/*
* The trace entry - the most basic unit of tracing. This is what
@@ -87,6 +88,7 @@ struct ftrace_event_call {
char *name;
char *system;
struct dentry *dir;
+ struct trace_event *event;
int enabled;
int (*regfunc)(void);
void (*unregfunc)(void);
@@ -97,6 +99,7 @@ struct ftrace_event_call {
struct list_head fields;
int n_preds;
struct filter_pred **preds;
+ void *mod;
#ifdef CONFIG_EVENT_PROFILE
atomic_t profile_count;
diff --git a/include/linux/module.h b/include/linux/module.h
index 627ac08..6155fa4 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -337,6 +337,10 @@ struct module
const char **trace_bprintk_fmt_start;
unsigned int num_trace_bprintk_fmt;
#endif
+#ifdef CONFIG_EVENT_TRACING
+ struct ftrace_event_call *trace_events;
+ unsigned int num_trace_events;
+#endif
#ifdef CONFIG_MODULE_UNLOAD
/* What modules depend on me? */
diff --git a/include/linux/trace_seq.h b/include/linux/trace_seq.h
index 28051da..15ca2c7 100644
--- a/include/linux/trace_seq.h
+++ b/include/linux/trace_seq.h
@@ -1,6 +1,8 @@
#ifndef _LINUX_TRACE_SEQ_H
#define _LINUX_TRACE_SEQ_H
+#include <linux/fs.h>
+
/*
* Trace sequences are used to allow a function to call several other functions
* to create a string of data to use (up to a max of PAGE_SIZE.
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h
index 955b967..60c5323 100644
--- a/include/trace/ftrace.h
+++ b/include/trace/ftrace.h
@@ -477,6 +477,7 @@ __attribute__((__aligned__(4))) \
__attribute__((section("_ftrace_events"))) event_##call = { \
.name = #call, \
.system = __stringify(TRACE_SYSTEM), \
+ .event = &ftrace_event_type_##call, \
.raw_init = ftrace_raw_init_event_##call, \
.regfunc = ftrace_raw_reg_event_##call, \
.unregfunc = ftrace_raw_unreg_event_##call, \
diff --git a/kernel/module.c b/kernel/module.c
index e797812..a039470 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -18,6 +18,7 @@
*/
#include <linux/module.h>
#include <linux/moduleloader.h>
+#include <linux/ftrace_event.h>
#include <linux/init.h>
#include <linux/kallsyms.h>
#include <linux/fs.h>
@@ -2172,6 +2173,12 @@ static noinline struct module *load_module(void __user *umod,
sizeof(*mod->tracepoints),
&mod->num_tracepoints);
#endif
+#ifdef CONFIG_EVENT_TRACING
+ mod->trace_events = section_objs(hdr, sechdrs, secstrings,
+ "_ftrace_events",
+ sizeof(*mod->trace_events),
+ &mod->num_trace_events);
+#endif
#ifdef CONFIG_MODVERSIONS
if ((mod->num_syms && !mod->crcs)
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
index 8b9e621..a4b1777 100644
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -713,7 +713,13 @@ event_subsystem_dir(const char *name, struct dentry *d_events)
return d_events;
}
- system->name = name;
+ system->name = kstrdup(name, GFP_KERNEL);
+ if (!system->name) {
+ debugfs_remove(system->entry);
+ kfree(system);
+ return d_events;
+ }
+
list_add(&system->list, &event_subsystems);
system->preds = NULL;
@@ -738,7 +744,7 @@ event_create_dir(struct ftrace_event_call *call, struct dentry *d_events)
* If the trace point header did not define TRACE_SYSTEM
* then the system would be called "TRACE_SYSTEM".
*/
- if (strcmp(call->system, "TRACE_SYSTEM") != 0)
+ if (strcmp(call->system, TRACE_SYSTEM) != 0)
d_events = event_subsystem_dir(call->system, d_events);
if (call->raw_init) {
@@ -757,21 +763,13 @@ event_create_dir(struct ftrace_event_call *call, struct dentry *d_events)
return -1;
}
- if (call->regfunc) {
- entry = debugfs_create_file("enable", 0644, call->dir, call,
- &ftrace_enable_fops);
- if (!entry)
- pr_warning("Could not create debugfs "
- "'%s/enable' entry\n", call->name);
- }
+ if (call->regfunc)
+ entry = trace_create_file("enable", 0644, call->dir, call,
+ &ftrace_enable_fops);
- if (call->id) {
- entry = debugfs_create_file("id", 0444, call->dir, call,
- &ftrace_event_id_fops);
- if (!entry)
- pr_warning("Could not create debugfs '%s/id' entry\n",
- call->name);
- }
+ if (call->id)
+ entry = trace_create_file("id", 0444, call->dir, call,
+ &ftrace_event_id_fops);
if (call->define_fields) {
ret = call->define_fields();
@@ -780,40 +778,102 @@ event_create_dir(struct ftrace_event_call *call, struct dentry *d_events)
" events/%s\n", call->name);
return ret;
}
- entry = debugfs_create_file("filter", 0644, call->dir, call,
- &ftrace_event_filter_fops);
- if (!entry)
- pr_warning("Could not create debugfs "
- "'%s/filter' entry\n", call->name);
+ entry = trace_create_file("filter", 0644, call->dir, call,
+ &ftrace_event_filter_fops);
}
/* A trace may not want to export its format */
if (!call->show_format)
return 0;
- entry = debugfs_create_file("format", 0444, call->dir, call,
- &ftrace_event_format_fops);
- if (!entry)
- pr_warning("Could not create debugfs "
- "'%s/format' entry\n", call->name);
+ entry = trace_create_file("format", 0444, call->dir, call,
+ &ftrace_event_format_fops);
+
+ return 0;
+}
+
+#define for_each_event(event, start, end) \
+ for (event = start; \
+ (unsigned long)event < (unsigned long)end; \
+ event++)
+
+static void trace_module_add_events(struct module *mod)
+{
+ struct ftrace_event_call *call, *start, *end;
+ struct dentry *d_events;
+
+ start = mod->trace_events;
+ end = mod->trace_events + mod->num_trace_events;
+
+ if (start == end)
+ return;
+
+ d_events = event_trace_events_dir();
+ if (!d_events)
+ return;
+
+ for_each_event(call, start, end) {
+ /* The linker may leave blanks */
+ if (!call->name)
+ continue;
+ call->mod = mod;
+ list_add(&call->list, &ftrace_events);
+ event_create_dir(call, d_events);
+ }
+}
+
+static void trace_module_remove_events(struct module *mod)
+{
+ struct ftrace_event_call *call, *p;
+
+ list_for_each_entry_safe(call, p, &ftrace_events, list) {
+ if (call->mod == mod) {
+ if (call->enabled) {
+ call->enabled = 0;
+ call->unregfunc();
+ }
+ if (call->event)
+ unregister_ftrace_event(call->event);
+ debugfs_remove_recursive(call->dir);
+ list_del(&call->list);
+ }
+ }
+}
+
+int trace_module_notify(struct notifier_block *self,
+ unsigned long val, void *data)
+{
+ struct module *mod = data;
+
+ mutex_lock(&event_mutex);
+ switch (val) {
+ case MODULE_STATE_COMING:
+ trace_module_add_events(mod);
+ break;
+ case MODULE_STATE_GOING:
+ trace_module_remove_events(mod);
+ break;
+ }
+ mutex_unlock(&event_mutex);
return 0;
}
+struct notifier_block trace_module_nb = {
+ .notifier_call = trace_module_notify,
+ .priority = 0,
+};
+
extern struct ftrace_event_call __start_ftrace_events[];
extern struct ftrace_event_call __stop_ftrace_events[];
-#define for_each_event(event) \
- for (event = __start_ftrace_events; \
- (unsigned long)event < (unsigned long)__stop_ftrace_events; \
- event++)
-
static __init int event_trace_init(void)
{
struct ftrace_event_call *call;
struct dentry *d_tracer;
struct dentry *entry;
struct dentry *d_events;
+ int ret;
d_tracer = tracing_init_dentry();
if (!d_tracer)
@@ -837,7 +897,7 @@ static __init int event_trace_init(void)
if (!d_events)
return 0;
- for_each_event(call) {
+ for_each_event(call, __start_ftrace_events, __stop_ftrace_events) {
/* The linker may leave blanks */
if (!call->name)
continue;
@@ -845,6 +905,10 @@ static __init int event_trace_init(void)
event_create_dir(call, d_events);
}
+ ret = register_module_notifier(&trace_module_nb);
+ if (!ret)
+ pr_warning("Failed to register trace events module notifier\n");
+
return 0;
}
fs_initcall(event_trace_init);
--
1.6.2.1
--
^ permalink raw reply related [flat|nested] 60+ messages in thread
* Re: [PATCH 0/8] [GIT PULL] TRACE_EVENT for modules
2009-04-14 17:23 [PATCH 0/8] [GIT PULL] TRACE_EVENT for modules Steven Rostedt
` (7 preceding siblings ...)
2009-04-14 17:23 ` [PATCH 8/8] tracing/events: add support for modules to TRACE_EVENT Steven Rostedt
@ 2009-04-14 18:15 ` Ingo Molnar
2009-04-14 18:25 ` Ingo Molnar
2009-04-14 18:21 ` Ingo Molnar
2009-04-14 21:04 ` Theodore Tso
10 siblings, 1 reply; 60+ messages in thread
From: Ingo Molnar @ 2009-04-14 18:15 UTC (permalink / raw)
To: Steven Rostedt
Cc: linux-kernel, Andrew Morton, Thomas Gleixner, Peter Zijlstra,
Frederic Weisbecker, Theodore Tso, Arjan van de Ven,
Christoph Hellwig, Mathieu Desnoyers, Jeremy Fitzhardinge,
Lai Jiangshan, Zhaolei, Li Zefan, KOSAKI Motohiro,
Masami Hiramatsu, Frank Ch. Eigler, Tom Zanussi, Jiaying Zhang,
Michael Rubin, Martin Bligh
* Steven Rostedt <rostedt@goodmis.org> wrote:
> Ingo,
>
> This is the long awaited TRACE_EVENT for modules patch series.
>
> Not only does it allow for modules to use the TRACE_EVENT
> infrastructure, but it also cleans up the way TRACE_EVENTS are
> used in core kernel code.
Really impressive!
I've got a small testing hickup with it:
In file included from include/trace/lockdep.h:60,
from kernel/lockdep.c:51:
include/trace/define_trace.h:57:43: error: trace/lock.h: No such file or directory
The patch below fixes it.
Ingo
Index: linux/include/trace/lockdep.h
===================================================================
--- linux.orig/include/trace/lockdep.h
+++ linux/include/trace/lockdep.h
@@ -5,7 +5,7 @@
#include <linux/tracepoint.h>
#undef TRACE_SYSTEM
-#define TRACE_SYSTEM lock
+#define TRACE_SYSTEM lockdep
#ifdef CONFIG_LOCKDEP
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [PATCH 0/8] [GIT PULL] TRACE_EVENT for modules
2009-04-14 17:23 [PATCH 0/8] [GIT PULL] TRACE_EVENT for modules Steven Rostedt
` (8 preceding siblings ...)
2009-04-14 18:15 ` [PATCH 0/8] [GIT PULL] TRACE_EVENT for modules Ingo Molnar
@ 2009-04-14 18:21 ` Ingo Molnar
2009-04-14 18:33 ` Steven Rostedt
2009-04-14 21:04 ` Theodore Tso
10 siblings, 1 reply; 60+ messages in thread
From: Ingo Molnar @ 2009-04-14 18:21 UTC (permalink / raw)
To: Steven Rostedt
Cc: linux-kernel, Andrew Morton, Thomas Gleixner, Peter Zijlstra,
Frederic Weisbecker, Theodore Tso, Arjan van de Ven,
Christoph Hellwig, Mathieu Desnoyers, Jeremy Fitzhardinge,
Lai Jiangshan, Zhaolei, Li Zefan, KOSAKI Motohiro,
Masami Hiramatsu, Frank Ch. Eigler, Tom Zanussi, Jiaying Zhang,
Michael Rubin, Martin Bligh
* Steven Rostedt <rostedt@goodmis.org> wrote:
> include/trace/define_trace.h | 79 ++++++
> include/trace/ftrace.h | 493 +++++++++++++++++++++++++++++++++++
> include/trace/irq.h | 56 ++++-
> include/trace/irq_event_types.h | 55 ----
> include/trace/kmem.h | 189 +++++++++++++-
> include/trace/lockdep.h | 55 ++++-
> include/trace/lockdep_event_types.h | 57 ----
> include/trace/sched.h | 336 +++++++++++++++++++++++-
> include/trace/sched_event_types.h | 337 ------------------------
> include/trace/skb.h | 39 +++-
> include/trace/skb_event_types.h | 38 ---
> include/trace/trace_event_types.h | 7 -
> include/trace/trace_events.h | 7 -
Detail: we still have include/trace/kmem_event_types.h around - is
that intentional? It isnt actually used by anything so we can git-rm
it.
Also, we mix tracepoint definition headers with other misc headers
such as syscall.h or boot.h.
I think it would be cleaner and better sructured to have these
centrally enumerated tracepoint definitions separated in
include/trace/events/.
That sub-directory would _only_ include the TRACE_EVENT()
definitions - nothing else. Hence it would also be a nice in-situ
template collection for anyone adding new tracepoints. The existence
of other headers really distracts from that.
What do you think?
Ingo
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [PATCH 0/8] [GIT PULL] TRACE_EVENT for modules
2009-04-14 18:15 ` [PATCH 0/8] [GIT PULL] TRACE_EVENT for modules Ingo Molnar
@ 2009-04-14 18:25 ` Ingo Molnar
0 siblings, 0 replies; 60+ messages in thread
From: Ingo Molnar @ 2009-04-14 18:25 UTC (permalink / raw)
To: Steven Rostedt
Cc: linux-kernel, Andrew Morton, Thomas Gleixner, Peter Zijlstra,
Frederic Weisbecker, Theodore Tso, Arjan van de Ven,
Christoph Hellwig, Mathieu Desnoyers, Jeremy Fitzhardinge,
Lai Jiangshan, Zhaolei, Li Zefan, KOSAKI Motohiro,
Masami Hiramatsu, Frank Ch. Eigler, Tom Zanussi, Jiaying Zhang,
Michael Rubin, Martin Bligh
[-- Attachment #1: Type: text/plain, Size: 997 bytes --]
there's another build failure as well:
kernel/trace/trace_events.c: In function ‘trace_module_add_events’:
kernel/trace/trace_events.c:805: error: dereferencing pointer to incomplete type
kernel/trace/trace_events.c:806: error: dereferencing pointer to incomplete type
kernel/trace/trace_events.c:806: error: dereferencing pointer to incomplete type
kernel/trace/trace_events.c: In function ‘trace_module_notify’:
kernel/trace/trace_events.c:850: error: ‘MODULE_STATE_COMING’ undeclared (first use in this function)
kernel/trace/trace_events.c:850: error: (Each undeclared identifier is reported only once
kernel/trace/trace_events.c:850: error: for each function it appears in.)
kernel/trace/trace_events.c:853: error: ‘MODULE_STATE_GOING’ undeclared (first use in this function)
config attached. The key bit is:
# CONFIG_MODULES is not set
I suspect you mainly concentrated on getting modular kernels right.
Fixing it for non-modular kernels should be no big deal.
Ingo
[-- Attachment #2: config --]
[-- Type: text/plain, Size: 37563 bytes --]
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.30-rc1
# Tue Apr 14 21:21:21 2009
#
CONFIG_64BIT=y
# CONFIG_X86_32 is not set
CONFIG_X86_64=y
CONFIG_X86=y
CONFIG_ARCH_DEFCONFIG="arch/x86/configs/x86_64_defconfig"
CONFIG_GENERIC_TIME=y
CONFIG_GENERIC_CMOS_UPDATE=y
CONFIG_CLOCKSOURCE_WATCHDOG=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
CONFIG_LOCKDEP_SUPPORT=y
CONFIG_STACKTRACE_SUPPORT=y
CONFIG_HAVE_LATENCYTOP_SUPPORT=y
CONFIG_FAST_CMPXCHG_LOCAL=y
CONFIG_MMU=y
CONFIG_ZONE_DMA=y
CONFIG_GENERIC_ISA_DMA=y
CONFIG_GENERIC_IOMAP=y
CONFIG_GENERIC_BUG=y
CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y
CONFIG_GENERIC_HWEIGHT=y
CONFIG_ARCH_MAY_HAVE_PC_FDC=y
CONFIG_RWSEM_GENERIC_SPINLOCK=y
# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
CONFIG_ARCH_HAS_CPU_IDLE_WAIT=y
CONFIG_GENERIC_CALIBRATE_DELAY=y
CONFIG_GENERIC_TIME_VSYSCALL=y
CONFIG_ARCH_HAS_CPU_RELAX=y
CONFIG_ARCH_HAS_DEFAULT_IDLE=y
CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y
CONFIG_HAVE_SETUP_PER_CPU_AREA=y
CONFIG_HAVE_DYNAMIC_PER_CPU_AREA=y
CONFIG_HAVE_CPUMASK_OF_CPU_MAP=y
CONFIG_ARCH_HIBERNATION_POSSIBLE=y
CONFIG_ARCH_SUSPEND_POSSIBLE=y
CONFIG_ZONE_DMA32=y
CONFIG_ARCH_POPULATES_NODE_MAP=y
CONFIG_AUDIT_ARCH=y
CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING=y
CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
CONFIG_GENERIC_HARDIRQS=y
CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
CONFIG_GENERIC_IRQ_PROBE=y
CONFIG_GENERIC_PENDING_IRQ=y
CONFIG_USE_GENERIC_SMP_HELPERS=y
CONFIG_X86_64_SMP=y
CONFIG_X86_HT=y
CONFIG_X86_TRAMPOLINE=y
# CONFIG_KTIME_SCALAR is not set
# CONFIG_BOOTPARAM_SUPPORT_NOT_WANTED is not set
# CONFIG_BOOTPARAM_SUPPORT is not set
CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
#
# General setup
#
# CONFIG_EXPERIMENTAL is not set
CONFIG_BROKEN_BOOT_ALLOWED4=y
CONFIG_BROKEN_BOOT_ALLOWED3=y
CONFIG_BROKEN_BOOT_ALLOWED2=y
CONFIG_BROKEN_BOOT_ALLOWED=y
CONFIG_BROKEN_BOOT=y
CONFIG_BROKEN_BOOT_EUROPE=y
CONFIG_BROKEN_BOOT_TITAN=y
CONFIG_LOCK_KERNEL=y
CONFIG_INIT_ENV_ARG_LIMIT=32
CONFIG_LOCALVERSION=""
CONFIG_LOCALVERSION_AUTO=y
CONFIG_HAVE_KERNEL_GZIP=y
CONFIG_HAVE_KERNEL_BZIP2=y
CONFIG_HAVE_KERNEL_LZMA=y
CONFIG_KERNEL_GZIP=y
# CONFIG_KERNEL_BZIP2 is not set
# CONFIG_KERNEL_LZMA is not set
# CONFIG_SWAP is not set
# CONFIG_SYSVIPC is not set
# CONFIG_BSD_PROCESS_ACCT is not set
CONFIG_TASKSTATS=y
CONFIG_TASK_DELAY_ACCT=y
CONFIG_TASK_XACCT=y
CONFIG_TASK_IO_ACCOUNTING=y
CONFIG_AUDIT=y
CONFIG_AUDITSYSCALL=y
CONFIG_AUDIT_TREE=y
#
# RCU Subsystem
#
# CONFIG_CLASSIC_RCU is not set
CONFIG_TREE_RCU=y
# CONFIG_PREEMPT_RCU is not set
CONFIG_RCU_TRACE=y
CONFIG_RCU_FANOUT=64
CONFIG_RCU_FANOUT_EXACT=y
CONFIG_TREE_RCU_TRACE=y
# CONFIG_PREEMPT_RCU_TRACE is not set
CONFIG_IKCONFIG=y
CONFIG_LOG_BUF_SHIFT=20
CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y
CONFIG_CGROUPS=y
CONFIG_CGROUP_DEBUG=y
CONFIG_CGROUP_NS=y
CONFIG_CGROUP_FREEZER=y
# CONFIG_CPUSETS is not set
# CONFIG_CGROUP_CPUACCT is not set
# CONFIG_RESOURCE_COUNTERS is not set
CONFIG_SYSFS_DEPRECATED=y
CONFIG_SYSFS_DEPRECATED_V2=y
CONFIG_RELAY=y
# CONFIG_NAMESPACES is not set
CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE=""
# CONFIG_RD_GZIP is not set
CONFIG_RD_BZIP2=y
# CONFIG_RD_LZMA is not set
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
CONFIG_ANON_INODES=y
CONFIG_EMBEDDED=y
# CONFIG_SYSCTL_SYSCALL is not set
CONFIG_KALLSYMS=y
CONFIG_KALLSYMS_ALL=y
CONFIG_KALLSYMS_EXTRA_PASS=y
# CONFIG_STRIP_ASM_SYMS is not set
# CONFIG_HOTPLUG is not set
# CONFIG_PRINTK is not set
CONFIG_BUG=y
# CONFIG_ELF_CORE is not set
CONFIG_PCSPKR_PLATFORM=y
CONFIG_BASE_FULL=y
CONFIG_FUTEX=y
CONFIG_EPOLL=y
CONFIG_SIGNALFD=y
CONFIG_TIMERFD=y
# CONFIG_EVENTFD is not set
CONFIG_SHMEM=y
# CONFIG_AIO is not set
CONFIG_HAVE_PERF_COUNTERS=y
#
# Performance Counters
#
CONFIG_PERF_COUNTERS=y
CONFIG_EVENT_PROFILE=y
# CONFIG_VM_EVENT_COUNTERS is not set
# CONFIG_PCI_QUIRKS is not set
CONFIG_SLUB_DEBUG=y
# CONFIG_COMPAT_BRK is not set
# CONFIG_SLAB is not set
CONFIG_SLUB=y
# CONFIG_SLOB is not set
# CONFIG_PROFILING is not set
CONFIG_TRACEPOINTS=y
CONFIG_MARKERS=y
CONFIG_HAVE_OPROFILE=y
CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
CONFIG_HAVE_IOREMAP_PROT=y
CONFIG_HAVE_KPROBES=y
CONFIG_HAVE_KRETPROBES=y
CONFIG_HAVE_ARCH_TRACEHOOK=y
CONFIG_HAVE_DMA_API_DEBUG=y
# CONFIG_SLOW_WORK is not set
# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
CONFIG_RT_MUTEXES=y
CONFIG_BASE_SMALL=0
# CONFIG_MODULES is not set
CONFIG_BLOCK=y
# CONFIG_BLK_DEV_INTEGRITY is not set
#
# IO Schedulers
#
CONFIG_IOSCHED_NOOP=y
CONFIG_IOSCHED_AS=y
# CONFIG_IOSCHED_DEADLINE is not set
CONFIG_IOSCHED_CFQ=y
CONFIG_DEFAULT_AS=y
# CONFIG_DEFAULT_DEADLINE is not set
# CONFIG_DEFAULT_CFQ is not set
# CONFIG_DEFAULT_NOOP is not set
CONFIG_DEFAULT_IOSCHED="anticipatory"
CONFIG_PREEMPT_NOTIFIERS=y
CONFIG_FREEZER=y
#
# Processor type and features
#
CONFIG_TICK_ONESHOT=y
CONFIG_NO_HZ=y
CONFIG_HIGH_RES_TIMERS=y
CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
CONFIG_SMP_SUPPORT=y
CONFIG_SPARSE_IRQ=y
CONFIG_X86_MPPARSE=y
CONFIG_X86_EXTENDED_PLATFORM=y
CONFIG_X86_VSMP=y
CONFIG_SCHED_OMIT_FRAME_POINTER=y
CONFIG_PARAVIRT_GUEST=y
CONFIG_XEN=y
CONFIG_XEN_MAX_DOMAIN_MEMORY=32
CONFIG_XEN_DEBUG_FS=y
CONFIG_KVM_CLOCK=y
CONFIG_KVM_GUEST=y
CONFIG_PARAVIRT=y
CONFIG_PARAVIRT_CLOCK=y
CONFIG_PARAVIRT_DEBUG=y
CONFIG_MEMTEST=y
# CONFIG_M386 is not set
# CONFIG_M486 is not set
# CONFIG_M586 is not set
# CONFIG_M586TSC is not set
# CONFIG_M586MMX is not set
# CONFIG_M686 is not set
# CONFIG_MPENTIUMII is not set
# CONFIG_MPENTIUMIII is not set
# CONFIG_MPENTIUMM is not set
# CONFIG_MPENTIUM4 is not set
# CONFIG_MK6 is not set
# CONFIG_MK7 is not set
# CONFIG_MK8 is not set
# CONFIG_MCRUSOE is not set
# CONFIG_MEFFICEON is not set
# CONFIG_MWINCHIPC6 is not set
# CONFIG_MWINCHIP3D is not set
# CONFIG_MGEODEGX1 is not set
# CONFIG_MGEODE_LX is not set
# CONFIG_MCYRIXIII is not set
# CONFIG_MVIAC3_2 is not set
# CONFIG_MVIAC7 is not set
# CONFIG_MPSC is not set
# CONFIG_MCORE2 is not set
CONFIG_GENERIC_CPU=y
CONFIG_X86_CPU=y
CONFIG_X86_L1_CACHE_BYTES=64
CONFIG_X86_INTERNODE_CACHE_BYTES=4096
CONFIG_X86_CMPXCHG=y
CONFIG_X86_L1_CACHE_SHIFT=6
CONFIG_X86_WP_WORKS_OK=y
CONFIG_X86_TSC=y
CONFIG_X86_CMPXCHG64=y
CONFIG_X86_CMOV=y
CONFIG_X86_MINIMUM_CPU_FAMILY=64
CONFIG_X86_DEBUGCTLMSR=y
# CONFIG_PROCESSOR_SELECT is not set
CONFIG_CPU_SUP_INTEL=y
CONFIG_CPU_SUP_AMD=y
CONFIG_CPU_SUP_CENTAUR=y
CONFIG_X86_DS=y
CONFIG_X86_PTRACE_BTS=y
CONFIG_HPET_TIMER=y
CONFIG_HPET_EMULATE_RTC=y
# CONFIG_DMI is not set
CONFIG_GART_IOMMU=y
CONFIG_SWIOTLB=y
CONFIG_IOMMU_HELPER=y
# CONFIG_IOMMU_API is not set
CONFIG_NR_CPUS=8
CONFIG_SCHED_SMT=y
# CONFIG_SCHED_MC is not set
# CONFIG_PREEMPT_NONE is not set
CONFIG_PREEMPT_VOLUNTARY=y
# CONFIG_PREEMPT is not set
CONFIG_X86_LOCAL_APIC=y
CONFIG_X86_IO_APIC=y
CONFIG_X86_REROUTE_FOR_BROKEN_BOOT_IRQS=y
CONFIG_X86_MCE=y
CONFIG_X86_MCE_INTEL=y
CONFIG_X86_MCE_AMD=y
CONFIG_X86_MCE_THRESHOLD=y
CONFIG_I8K=y
# CONFIG_MICROCODE is not set
CONFIG_X86_MSR=y
CONFIG_X86_CPUID=y
CONFIG_X86_CPU_DEBUG=y
CONFIG_UP_WANTED_1=y
# CONFIG_UP_WANTED_2 is not set
CONFIG_SMP=y
CONFIG_ARCH_PHYS_ADDR_T_64BIT=y
CONFIG_DIRECT_GBPAGES=y
# CONFIG_NUMA is not set
CONFIG_ARCH_SPARSEMEM_DEFAULT=y
CONFIG_ARCH_SPARSEMEM_ENABLE=y
CONFIG_ARCH_SELECT_MEMORY_MODEL=y
CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000
CONFIG_SELECT_MEMORY_MODEL=y
# CONFIG_FLATMEM_MANUAL is not set
# CONFIG_DISCONTIGMEM_MANUAL is not set
CONFIG_SPARSEMEM_MANUAL=y
CONFIG_SPARSEMEM=y
CONFIG_HAVE_MEMORY_PRESENT=y
CONFIG_SPARSEMEM_EXTREME=y
CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
# CONFIG_SPARSEMEM_VMEMMAP is not set
CONFIG_PAGEFLAGS_EXTENDED=y
CONFIG_SPLIT_PTLOCK_CPUS=4
CONFIG_PHYS_ADDR_T_64BIT=y
CONFIG_ZONE_DMA_FLAG=1
CONFIG_BOUNCE=y
CONFIG_VIRT_TO_BUS=y
CONFIG_UNEVICTABLE_LRU=y
CONFIG_HAVE_MLOCK=y
CONFIG_HAVE_MLOCKED_PAGE_BIT=y
CONFIG_MMU_NOTIFIER=y
CONFIG_X86_CHECK_BIOS_CORRUPTION=y
CONFIG_X86_BOOTPARAM_MEMORY_CORRUPTION_CHECK=y
CONFIG_X86_RESERVE_LOW_64K=y
# CONFIG_MTRR is not set
CONFIG_SECCOMP=y
# CONFIG_CC_STACKPROTECTOR is not set
# CONFIG_HZ_100 is not set
# CONFIG_HZ_250 is not set
# CONFIG_HZ_300 is not set
CONFIG_HZ_1000=y
CONFIG_HZ=1000
CONFIG_SCHED_HRTICK=y
CONFIG_KEXEC=y
# CONFIG_CRASH_DUMP is not set
CONFIG_PHYSICAL_START=0x200000
CONFIG_PHYSICAL_ALIGN=0x200000
# CONFIG_CMDLINE_BOOL is not set
CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
#
# Power management and ACPI options
#
# CONFIG_PM is not set
#
# CPU Frequency scaling
#
CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_TABLE=y
CONFIG_CPU_FREQ_DEBUG=y
# CONFIG_CPU_FREQ_STAT is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE=y
# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
CONFIG_CPU_FREQ_GOV_POWERSAVE=y
# CONFIG_CPU_FREQ_GOV_USERSPACE is not set
# CONFIG_CPU_FREQ_GOV_ONDEMAND is not set
CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
#
# CPUFreq processor drivers
#
CONFIG_X86_P4_CLOCKMOD=y
#
# shared options
#
CONFIG_X86_SPEEDSTEP_LIB=y
CONFIG_CPU_IDLE=y
CONFIG_CPU_IDLE_GOV_LADDER=y
CONFIG_CPU_IDLE_GOV_MENU=y
#
# Memory power savings
#
#
# Bus options (PCI etc.)
#
CONFIG_PCI=y
CONFIG_PCI_DIRECT=y
CONFIG_PCI_DOMAINS=y
CONFIG_PCIEPORTBUS=y
CONFIG_PCIEAER=y
CONFIG_ARCH_SUPPORTS_MSI=y
CONFIG_PCI_MSI=y
# CONFIG_PCI_LEGACY is not set
CONFIG_PCI_DEBUG=y
CONFIG_PCI_STUB=y
CONFIG_HT_IRQ=y
CONFIG_PCI_IOV=y
CONFIG_ISA_DMA_API=y
CONFIG_K8_NB=y
#
# Executable file formats / Emulations
#
CONFIG_BINFMT_ELF=y
# CONFIG_HAVE_AOUT is not set
CONFIG_BINFMT_MISC=y
# CONFIG_IA32_EMULATION is not set
# CONFIG_COMPAT_FOR_U64_ALIGNMENT is not set
CONFIG_NET=y
#
# Networking options
#
CONFIG_PACKET=y
# CONFIG_PACKET_MMAP is not set
CONFIG_UNIX=y
CONFIG_XFRM=y
CONFIG_XFRM_USER=y
CONFIG_XFRM_IPCOMP=y
CONFIG_NET_KEY=y
CONFIG_INET=y
# CONFIG_IP_MULTICAST is not set
CONFIG_IP_ADVANCED_ROUTER=y
# CONFIG_ASK_IP_FIB_HASH is not set
CONFIG_IP_FIB_TRIE=y
# CONFIG_IP_FIB_HASH is not set
# CONFIG_IP_FIB_TRIE_STATS is not set
CONFIG_IP_MULTIPLE_TABLES=y
# CONFIG_IP_ROUTE_MULTIPATH is not set
CONFIG_IP_ROUTE_VERBOSE=y
# CONFIG_IP_PNP is not set
CONFIG_NET_IPIP=y
CONFIG_NET_IPGRE=y
CONFIG_SYN_COOKIES=y
CONFIG_INET_AH=y
CONFIG_INET_ESP=y
CONFIG_INET_IPCOMP=y
CONFIG_INET_XFRM_TUNNEL=y
CONFIG_INET_TUNNEL=y
CONFIG_INET_XFRM_MODE_TRANSPORT=y
CONFIG_INET_XFRM_MODE_TUNNEL=y
CONFIG_INET_XFRM_MODE_BEET=y
# CONFIG_INET_LRO is not set
CONFIG_INET_DIAG=y
CONFIG_INET_TCP_DIAG=y
CONFIG_TCP_CONG_ADVANCED=y
CONFIG_TCP_CONG_BIC=y
CONFIG_TCP_CONG_CUBIC=y
CONFIG_TCP_CONG_WESTWOOD=y
# CONFIG_TCP_CONG_HTCP is not set
CONFIG_DEFAULT_BIC=y
# CONFIG_DEFAULT_CUBIC is not set
# CONFIG_DEFAULT_HTCP is not set
# CONFIG_DEFAULT_VEGAS is not set
# CONFIG_DEFAULT_WESTWOOD is not set
# CONFIG_DEFAULT_RENO is not set
CONFIG_DEFAULT_TCP_CONG="bic"
CONFIG_IPV6=y
# CONFIG_IPV6_PRIVACY is not set
CONFIG_IPV6_ROUTER_PREF=y
CONFIG_INET6_AH=y
CONFIG_INET6_ESP=y
# CONFIG_INET6_IPCOMP is not set
# CONFIG_INET6_XFRM_TUNNEL is not set
# CONFIG_INET6_TUNNEL is not set
CONFIG_INET6_XFRM_MODE_TRANSPORT=y
CONFIG_INET6_XFRM_MODE_TUNNEL=y
CONFIG_INET6_XFRM_MODE_BEET=y
# CONFIG_IPV6_SIT is not set
# CONFIG_IPV6_TUNNEL is not set
CONFIG_NETLABEL=y
CONFIG_NETWORK_SECMARK=y
# CONFIG_NETFILTER is not set
# CONFIG_ATM is not set
CONFIG_STP=y
CONFIG_BRIDGE=y
CONFIG_VLAN_8021Q=y
# CONFIG_VLAN_8021Q_GVRP is not set
# CONFIG_DECNET is not set
CONFIG_LLC=y
CONFIG_LLC2=y
# CONFIG_IPX is not set
CONFIG_ATALK=y
CONFIG_DEV_APPLETALK=y
# CONFIG_IPDDP is not set
CONFIG_PHONET=y
CONFIG_NET_SCHED=y
#
# Queueing/Scheduling
#
CONFIG_NET_SCH_CBQ=y
CONFIG_NET_SCH_HTB=y
CONFIG_NET_SCH_HFSC=y
# CONFIG_NET_SCH_PRIO is not set
CONFIG_NET_SCH_MULTIQ=y
# CONFIG_NET_SCH_RED is not set
CONFIG_NET_SCH_SFQ=y
# CONFIG_NET_SCH_TEQL is not set
CONFIG_NET_SCH_TBF=y
CONFIG_NET_SCH_GRED=y
CONFIG_NET_SCH_DSMARK=y
CONFIG_NET_SCH_NETEM=y
CONFIG_NET_SCH_DRR=y
#
# Classification
#
CONFIG_NET_CLS=y
# CONFIG_NET_CLS_BASIC is not set
# CONFIG_NET_CLS_TCINDEX is not set
CONFIG_NET_CLS_ROUTE4=y
CONFIG_NET_CLS_ROUTE=y
# CONFIG_NET_CLS_FW is not set
# CONFIG_NET_CLS_U32 is not set
# CONFIG_NET_CLS_RSVP is not set
CONFIG_NET_CLS_RSVP6=y
CONFIG_NET_CLS_FLOW=y
CONFIG_NET_CLS_CGROUP=y
CONFIG_NET_EMATCH=y
CONFIG_NET_EMATCH_STACK=32
CONFIG_NET_EMATCH_CMP=y
# CONFIG_NET_EMATCH_NBYTE is not set
CONFIG_NET_EMATCH_U32=y
CONFIG_NET_EMATCH_META=y
# CONFIG_NET_EMATCH_TEXT is not set
# CONFIG_NET_CLS_ACT is not set
CONFIG_NET_SCH_FIFO=y
CONFIG_DCB=y
#
# Network testing
#
# CONFIG_HAMRADIO is not set
CONFIG_CAN=y
CONFIG_CAN_RAW=y
CONFIG_CAN_BCM=y
#
# CAN Device Drivers
#
# CONFIG_CAN_VCAN is not set
# CONFIG_CAN_DEBUG_DEVICES is not set
# CONFIG_IRDA is not set
CONFIG_BT=y
CONFIG_BT_L2CAP=y
# CONFIG_BT_SCO is not set
# CONFIG_BT_RFCOMM is not set
CONFIG_BT_BNEP=y
# CONFIG_BT_BNEP_MC_FILTER is not set
# CONFIG_BT_BNEP_PROTO_FILTER is not set
#
# Bluetooth device drivers
#
# CONFIG_BT_HCIBTSDIO is not set
CONFIG_BT_HCIUART=y
CONFIG_BT_HCIUART_H4=y
# CONFIG_BT_HCIUART_BCSP is not set
CONFIG_BT_HCIUART_LL=y
CONFIG_BT_HCIVHCI=y
CONFIG_FIB_RULES=y
CONFIG_WIRELESS=y
CONFIG_CFG80211=y
CONFIG_CFG80211_REG_DEBUG=y
CONFIG_WIRELESS_OLD_REGULATORY=y
CONFIG_WIRELESS_EXT=y
# CONFIG_WIRELESS_EXT_SYSFS is not set
# CONFIG_LIB80211 is not set
CONFIG_MAC80211=y
#
# Rate control algorithm selection
#
CONFIG_MAC80211_RC_PID=y
CONFIG_MAC80211_RC_MINSTREL=y
CONFIG_MAC80211_RC_DEFAULT_PID=y
# CONFIG_MAC80211_RC_DEFAULT_MINSTREL is not set
CONFIG_MAC80211_RC_DEFAULT="pid"
CONFIG_MAC80211_LEDS=y
# CONFIG_MAC80211_DEBUGFS is not set
CONFIG_MAC80211_DEBUG_MENU=y
# CONFIG_MAC80211_DEBUG_PACKET_ALIGNMENT is not set
CONFIG_MAC80211_NOINLINE=y
CONFIG_MAC80211_VERBOSE_DEBUG=y
CONFIG_MAC80211_HT_DEBUG=y
CONFIG_MAC80211_TKIP_DEBUG=y
CONFIG_MAC80211_IBSS_DEBUG=y
CONFIG_MAC80211_VERBOSE_PS_DEBUG=y
CONFIG_MAC80211_VERBOSE_SPECT_MGMT_DEBUG=y
CONFIG_WIMAX=y
CONFIG_WIMAX_DEBUG_LEVEL=8
# CONFIG_RFKILL is not set
#
# Device Drivers
#
#
# Generic Driver Options
#
CONFIG_STANDALONE=y
CONFIG_PREVENT_FIRMWARE_BUILD=y
CONFIG_FW_LOADER=y
CONFIG_FIRMWARE_IN_KERNEL=y
CONFIG_EXTRA_FIRMWARE=""
CONFIG_DEBUG_DRIVER=y
CONFIG_DEBUG_DEVRES=y
CONFIG_SYS_HYPERVISOR=y
CONFIG_CONNECTOR=y
# CONFIG_PROC_EVENTS is not set
# CONFIG_MTD is not set
# CONFIG_PARPORT is not set
# CONFIG_BLK_DEV is not set
CONFIG_MISC_DEVICES=y
CONFIG_PHANTOM=y
CONFIG_SGI_IOC4=y
CONFIG_ENCLOSURE_SERVICES=y
CONFIG_HP_ILO=y
CONFIG_ISL29003=y
#
# EEPROM support
#
# CONFIG_EEPROM_AT24 is not set
CONFIG_EEPROM_LEGACY=y
# CONFIG_EEPROM_93CX6 is not set
CONFIG_HAVE_IDE=y
# CONFIG_IDE is not set
#
# SCSI device support
#
CONFIG_RAID_ATTRS=y
CONFIG_SCSI=y
CONFIG_SCSI_DMA=y
CONFIG_SCSI_NETLINK=y
#
# SCSI support type (disk, tape, CD-ROM)
#
# CONFIG_BLK_DEV_SD is not set
# CONFIG_CHR_DEV_ST is not set
CONFIG_CHR_DEV_OSST=y
CONFIG_BLK_DEV_SR=y
CONFIG_BLK_DEV_SR_VENDOR=y
CONFIG_CHR_DEV_SG=y
# CONFIG_CHR_DEV_SCH is not set
CONFIG_SCSI_ENCLOSURE=y
#
# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
#
CONFIG_SCSI_MULTI_LUN=y
# CONFIG_SCSI_CONSTANTS is not set
CONFIG_SCSI_LOGGING=y
CONFIG_SCSI_SCAN_ASYNC=y
#
# SCSI Transports
#
CONFIG_SCSI_SPI_ATTRS=y
CONFIG_SCSI_FC_ATTRS=y
CONFIG_SCSI_ISCSI_ATTRS=y
CONFIG_SCSI_SRP_ATTRS=y
# CONFIG_SCSI_LOWLEVEL is not set
# CONFIG_SCSI_DH is not set
CONFIG_SCSI_OSD_INITIATOR=y
CONFIG_SCSI_OSD_ULD=y
CONFIG_SCSI_OSD_DPRINT_SENSE=1
CONFIG_SCSI_OSD_DEBUG=y
CONFIG_ATA=y
# CONFIG_ATA_NONSTANDARD is not set
CONFIG_SATA_PMP=y
CONFIG_SATA_AHCI=y
CONFIG_SATA_SIL24=y
# CONFIG_ATA_SFF is not set
CONFIG_MD=y
CONFIG_BLK_DEV_MD=y
# CONFIG_MD_AUTODETECT is not set
# CONFIG_MD_LINEAR is not set
# CONFIG_MD_RAID0 is not set
# CONFIG_MD_RAID1 is not set
CONFIG_MD_RAID456=y
CONFIG_MD_RAID6_PQ=y
CONFIG_MD_MULTIPATH=y
CONFIG_MD_FAULTY=y
CONFIG_BLK_DEV_DM=y
CONFIG_DM_DEBUG=y
CONFIG_DM_CRYPT=y
# CONFIG_DM_SNAPSHOT is not set
# CONFIG_DM_MIRROR is not set
# CONFIG_DM_ZERO is not set
# CONFIG_DM_MULTIPATH is not set
CONFIG_FUSION=y
# CONFIG_FUSION_SPI is not set
CONFIG_FUSION_FC=y
# CONFIG_FUSION_SAS is not set
CONFIG_FUSION_MAX_SGE=128
# CONFIG_FUSION_CTL is not set
CONFIG_FUSION_LOGGING=y
#
# IEEE 1394 (FireWire) support
#
#
# A new alternative FireWire stack is available with EXPERIMENTAL=y
#
CONFIG_IEEE1394=y
CONFIG_IEEE1394_OHCI1394=y
# CONFIG_IEEE1394_PCILYNX is not set
CONFIG_IEEE1394_SBP2=y
# CONFIG_IEEE1394_ETH1394_ROM_ENTRY is not set
# CONFIG_IEEE1394_RAWIO is not set
CONFIG_IEEE1394_VIDEO1394=y
CONFIG_IEEE1394_DV1394=y
CONFIG_IEEE1394_VERBOSEDEBUG=y
CONFIG_I2O=y
# CONFIG_I2O_LCT_NOTIFY_ON_CHANGES is not set
# CONFIG_I2O_EXT_ADAPTEC is not set
CONFIG_I2O_BUS=y
# CONFIG_I2O_BLOCK is not set
CONFIG_I2O_SCSI=y
CONFIG_I2O_PROC=y
# CONFIG_MACINTOSH_DRIVERS is not set
# CONFIG_NETDEVICES is not set
CONFIG_ISDN=y
# CONFIG_ISDN_I4L is not set
# CONFIG_ISDN_CAPI is not set
CONFIG_PHONE=y
#
# Input device support
#
# CONFIG_INPUT is not set
#
# Hardware I/O ports
#
# CONFIG_SERIO is not set
CONFIG_GAMEPORT=y
CONFIG_GAMEPORT_NS558=y
# CONFIG_GAMEPORT_L4 is not set
CONFIG_GAMEPORT_EMU10K1=y
CONFIG_GAMEPORT_FM801=y
#
# Character devices
#
# CONFIG_VT is not set
CONFIG_DEVKMEM=y
# CONFIG_SERIAL_NONSTANDARD is not set
#
# Serial drivers
#
CONFIG_SERIAL_8250=y
# CONFIG_SERIAL_8250_CONSOLE is not set
CONFIG_FIX_EARLYCON_MEM=y
CONFIG_SERIAL_8250_PCI=y
CONFIG_SERIAL_8250_NR_UARTS=4
CONFIG_SERIAL_8250_RUNTIME_UARTS=4
# CONFIG_SERIAL_8250_EXTENDED is not set
#
# Non-8250 serial port support
#
CONFIG_SERIAL_CORE=y
CONFIG_SERIAL_JSM=y
# CONFIG_UNIX98_PTYS is not set
CONFIG_LEGACY_PTYS=y
CONFIG_LEGACY_PTY_COUNT=256
CONFIG_HVC_DRIVER=y
CONFIG_HVC_IRQ=y
CONFIG_HVC_XEN=y
CONFIG_VIRTIO_CONSOLE=y
# CONFIG_IPMI_HANDLER is not set
CONFIG_HW_RANDOM=y
CONFIG_HW_RANDOM_TIMERIOMEM=y
# CONFIG_HW_RANDOM_INTEL is not set
CONFIG_HW_RANDOM_AMD=y
CONFIG_HW_RANDOM_VIRTIO=y
# CONFIG_NVRAM is not set
# CONFIG_R3964 is not set
CONFIG_APPLICOM=y
CONFIG_MWAVE=y
CONFIG_PC8736x_GPIO=y
CONFIG_NSC_GPIO=y
# CONFIG_RAW_DRIVER is not set
CONFIG_HANGCHECK_TIMER=y
CONFIG_DEVPORT=y
CONFIG_I2C=y
CONFIG_I2C_BOARDINFO=y
CONFIG_I2C_CHARDEV=y
# CONFIG_I2C_HELPER_AUTO is not set
#
# I2C Algorithms
#
CONFIG_I2C_ALGOBIT=y
CONFIG_I2C_ALGOPCF=y
CONFIG_I2C_ALGOPCA=y
#
# I2C Hardware Bus support
#
#
# PC SMBus host controller drivers
#
CONFIG_I2C_ALI1535=y
CONFIG_I2C_ALI15X3=y
# CONFIG_I2C_AMD756 is not set
# CONFIG_I2C_AMD8111 is not set
# CONFIG_I2C_I801 is not set
CONFIG_I2C_ISCH=y
CONFIG_I2C_PIIX4=y
CONFIG_I2C_NFORCE2=y
CONFIG_I2C_SIS5595=y
# CONFIG_I2C_SIS630 is not set
CONFIG_I2C_SIS96X=y
# CONFIG_I2C_VIAPRO is not set
#
# I2C system bus drivers (mostly embedded / system-on-chip)
#
CONFIG_I2C_SIMTEC=y
#
# External I2C/SMBus adapter drivers
#
CONFIG_I2C_PARPORT_LIGHT=y
#
# Graphics adapter I2C/DDC channel drivers
#
CONFIG_I2C_VOODOO3=y
#
# Other I2C/SMBus bus drivers
#
CONFIG_I2C_PCA_PLATFORM=y
#
# Miscellaneous I2C Chip support
#
CONFIG_PCF8575=y
CONFIG_I2C_DEBUG_CORE=y
CONFIG_I2C_DEBUG_ALGO=y
CONFIG_I2C_DEBUG_BUS=y
# CONFIG_I2C_DEBUG_CHIP is not set
# CONFIG_SPI is not set
CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
# CONFIG_GPIOLIB is not set
CONFIG_W1=y
# CONFIG_W1_CON is not set
#
# 1-wire Bus Masters
#
CONFIG_W1_MASTER_MATROX=y
#
# 1-wire Slaves
#
CONFIG_W1_SLAVE_THERM=y
CONFIG_W1_SLAVE_SMEM=y
CONFIG_W1_SLAVE_DS2431=y
CONFIG_W1_SLAVE_DS2433=y
# CONFIG_W1_SLAVE_DS2433_CRC is not set
CONFIG_W1_SLAVE_DS2760=y
CONFIG_W1_SLAVE_BQ27000=y
# CONFIG_POWER_SUPPLY is not set
CONFIG_HWMON=y
CONFIG_HWMON_VID=y
CONFIG_SENSORS_ADM1021=y
CONFIG_SENSORS_ADM1025=y
CONFIG_SENSORS_ADM9240=y
CONFIG_SENSORS_DS1621=y
# CONFIG_SENSORS_FSCHER is not set
CONFIG_SENSORS_FSCPOS=y
# CONFIG_SENSORS_FSCHMD is not set
CONFIG_SENSORS_G760A=y
CONFIG_SENSORS_GL518SM=y
CONFIG_SENSORS_GL520SM=y
CONFIG_SENSORS_IT87=y
CONFIG_SENSORS_LM63=y
# CONFIG_SENSORS_LM75 is not set
CONFIG_SENSORS_LM77=y
# CONFIG_SENSORS_LM78 is not set
# CONFIG_SENSORS_LM83 is not set
CONFIG_SENSORS_LM87=y
CONFIG_SENSORS_LM90=y
# CONFIG_SENSORS_LM92 is not set
CONFIG_SENSORS_LM93=y
CONFIG_SENSORS_LM95241=y
CONFIG_SENSORS_MAX1619=y
# CONFIG_SENSORS_PC87360 is not set
CONFIG_SENSORS_PCF8591=y
# CONFIG_SENSORS_SIS5595 is not set
CONFIG_SENSORS_SMSC47M1=y
CONFIG_SENSORS_ADS7828=y
CONFIG_SENSORS_VIA686A=y
# CONFIG_SENSORS_VT8231 is not set
# CONFIG_SENSORS_W83781D is not set
CONFIG_SENSORS_W83627HF=y
# CONFIG_SENSORS_W83627EHF is not set
CONFIG_HWMON_DEBUG_CHIP=y
# CONFIG_THERMAL is not set
CONFIG_THERMAL_HWMON=y
CONFIG_WATCHDOG=y
# CONFIG_WATCHDOG_NOWAYOUT is not set
#
# Watchdog Device Drivers
#
# CONFIG_SOFT_WATCHDOG is not set
# CONFIG_ACQUIRE_WDT is not set
# CONFIG_ADVANTECH_WDT is not set
CONFIG_ALIM1535_WDT=y
# CONFIG_ALIM7101_WDT is not set
# CONFIG_SC520_WDT is not set
# CONFIG_EUROTECH_WDT is not set
CONFIG_IB700_WDT=y
# CONFIG_IBMASR is not set
# CONFIG_WAFER_WDT is not set
# CONFIG_I6300ESB_WDT is not set
CONFIG_ITCO_WDT=y
CONFIG_ITCO_VENDOR_SUPPORT=y
CONFIG_IT8712F_WDT=y
CONFIG_HP_WATCHDOG=y
# CONFIG_SC1200_WDT is not set
CONFIG_PC87413_WDT=y
CONFIG_60XX_WDT=y
CONFIG_SBC8360_WDT=y
CONFIG_CPU5_WDT=y
# CONFIG_SMSC_SCH311X_WDT is not set
CONFIG_SMSC37B787_WDT=y
CONFIG_W83627HF_WDT=y
CONFIG_W83697HF_WDT=y
# CONFIG_W83697UG_WDT is not set
CONFIG_W83877F_WDT=y
CONFIG_W83977F_WDT=y
CONFIG_MACHZ_WDT=y
CONFIG_SBC_EPX_C3_WATCHDOG=y
#
# PCI-based Watchdog Cards
#
# CONFIG_PCIPCWATCHDOG is not set
CONFIG_WDTPCI=y
CONFIG_WDT_501_PCI=y
CONFIG_SSB_POSSIBLE=y
#
# Sonics Silicon Backplane
#
CONFIG_SSB=y
CONFIG_SSB_PCIHOST_POSSIBLE=y
# CONFIG_SSB_PCIHOST is not set
CONFIG_SSB_SILENT=y
#
# Multifunction device drivers
#
CONFIG_MFD_CORE=y
CONFIG_MFD_SM501=y
CONFIG_HTC_PASIC3=y
CONFIG_TWL4030_CORE=y
# CONFIG_MFD_TMIO is not set
CONFIG_PMIC_DA903X=y
CONFIG_MFD_WM8400=y
CONFIG_MFD_PCF50633=y
CONFIG_PCF50633_ADC=y
CONFIG_PCF50633_GPIO=y
CONFIG_REGULATOR=y
CONFIG_REGULATOR_DEBUG=y
CONFIG_REGULATOR_FIXED_VOLTAGE=y
CONFIG_REGULATOR_VIRTUAL_CONSUMER=y
# CONFIG_REGULATOR_BQ24022 is not set
CONFIG_REGULATOR_TWL4030=y
# CONFIG_REGULATOR_WM8400 is not set
# CONFIG_REGULATOR_DA903X is not set
# CONFIG_REGULATOR_PCF50633 is not set
#
# Multimedia devices
#
#
# Multimedia core support
#
# CONFIG_VIDEO_DEV is not set
CONFIG_DVB_CORE=y
CONFIG_VIDEO_MEDIA=y
#
# Multimedia drivers
#
CONFIG_MEDIA_TUNER=y
# CONFIG_MEDIA_TUNER_CUSTOMISE is not set
CONFIG_MEDIA_TUNER_SIMPLE=y
CONFIG_MEDIA_TUNER_TDA8290=y
CONFIG_MEDIA_TUNER_TDA9887=y
CONFIG_MEDIA_TUNER_TEA5761=y
CONFIG_MEDIA_TUNER_TEA5767=y
CONFIG_MEDIA_TUNER_MT20XX=y
CONFIG_MEDIA_TUNER_XC2028=y
CONFIG_MEDIA_TUNER_XC5000=y
CONFIG_MEDIA_TUNER_MC44S803=y
CONFIG_DVB_DYNAMIC_MINORS=y
# CONFIG_DVB_CAPTURE_DRIVERS is not set
# CONFIG_DAB is not set
#
# Graphics support
#
CONFIG_AGP=y
CONFIG_AGP_AMD64=y
CONFIG_AGP_INTEL=y
CONFIG_AGP_SIS=y
CONFIG_AGP_VIA=y
# CONFIG_DRM is not set
# CONFIG_VGASTATE is not set
CONFIG_VIDEO_OUTPUT_CONTROL=y
# CONFIG_FB is not set
CONFIG_BACKLIGHT_LCD_SUPPORT=y
CONFIG_LCD_CLASS_DEVICE=y
# CONFIG_LCD_ILI9320 is not set
CONFIG_LCD_PLATFORM=y
CONFIG_BACKLIGHT_CLASS_DEVICE=y
CONFIG_BACKLIGHT_GENERIC=y
CONFIG_BACKLIGHT_PROGEAR=y
CONFIG_BACKLIGHT_DA903X=y
# CONFIG_BACKLIGHT_MBP_NVIDIA is not set
CONFIG_BACKLIGHT_SAHARA=y
#
# Display device support
#
CONFIG_DISPLAY_SUPPORT=y
#
# Display hardware drivers
#
CONFIG_SOUND=y
CONFIG_SOUND_OSS_CORE=y
CONFIG_SND=y
CONFIG_SND_TIMER=y
CONFIG_SND_PCM=y
CONFIG_SND_RAWMIDI=y
# CONFIG_SND_SEQUENCER is not set
CONFIG_SND_OSSEMUL=y
CONFIG_SND_MIXER_OSS=y
CONFIG_SND_PCM_OSS=y
CONFIG_SND_PCM_OSS_PLUGINS=y
CONFIG_SND_HRTIMER=y
# CONFIG_SND_DYNAMIC_MINORS is not set
CONFIG_SND_SUPPORT_OLD_API=y
# CONFIG_SND_VERBOSE_PRINTK is not set
CONFIG_SND_DEBUG=y
# CONFIG_SND_DEBUG_VERBOSE is not set
CONFIG_SND_MPU401_UART=y
CONFIG_SND_DRIVERS=y
# CONFIG_SND_DUMMY is not set
CONFIG_SND_SERIAL_U16550=y
CONFIG_SND_MPU401=y
# CONFIG_SND_PCI is not set
# CONFIG_SND_SOC is not set
CONFIG_SOUND_PRIME=y
CONFIG_SOUND_OSS=y
# CONFIG_SOUND_TRACEINIT is not set
CONFIG_SOUND_DMAP=y
# CONFIG_SOUND_SSCAPE is not set
# CONFIG_SOUND_VMIDI is not set
CONFIG_SOUND_TRIX=y
CONFIG_SOUND_MSS=y
CONFIG_SOUND_MPU401=y
CONFIG_SOUND_PAS=y
# CONFIG_PAS_JOYSTICK is not set
CONFIG_SOUND_PSS=y
CONFIG_PSS_MIXER=y
CONFIG_SOUND_SB=y
CONFIG_SOUND_YM3812=y
CONFIG_SOUND_UART6850=y
# CONFIG_SOUND_AEDSP16 is not set
# CONFIG_SOUND_KAHLUA is not set
# CONFIG_USB_SUPPORT is not set
CONFIG_MMC=y
CONFIG_MMC_DEBUG=y
CONFIG_MMC_UNSAFE_RESUME=y
#
# MMC/SD/SDIO Card Drivers
#
# CONFIG_MMC_BLOCK is not set
CONFIG_SDIO_UART=y
CONFIG_MMC_TEST=y
#
# MMC/SD/SDIO Host Controller Drivers
#
CONFIG_MMC_SDHCI=y
CONFIG_MMC_SDHCI_PCI=y
CONFIG_MMC_RICOH_MMC=y
# CONFIG_MMC_WBSD is not set
CONFIG_MEMSTICK=y
CONFIG_MEMSTICK_DEBUG=y
#
# MemoryStick drivers
#
CONFIG_MEMSTICK_UNSAFE_RESUME=y
CONFIG_MSPRO_BLOCK=y
#
# MemoryStick Host Controller Drivers
#
CONFIG_NEW_LEDS=y
# CONFIG_LEDS_CLASS is not set
#
# LED drivers
#
#
# LED Triggers
#
CONFIG_LEDS_TRIGGERS=y
CONFIG_LEDS_TRIGGER_TIMER=y
CONFIG_LEDS_TRIGGER_HEARTBEAT=y
# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set
CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
#
# iptables trigger is under Netfilter config (LED target)
#
CONFIG_ACCESSIBILITY=y
CONFIG_EDAC=y
#
# Reporting subsystems
#
# CONFIG_EDAC_DEBUG is not set
CONFIG_EDAC_MM_EDAC=y
CONFIG_EDAC_I82975X=y
CONFIG_EDAC_I3000=y
CONFIG_EDAC_X38=y
# CONFIG_EDAC_I5400 is not set
CONFIG_EDAC_I5000=y
CONFIG_EDAC_I5100=y
# CONFIG_EDAC_AMD8131 is not set
CONFIG_EDAC_AMD8111=y
CONFIG_RTC_LIB=y
CONFIG_RTC_CLASS=y
CONFIG_RTC_HCTOSYS=y
CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
CONFIG_RTC_DEBUG=y
#
# RTC interfaces
#
CONFIG_RTC_INTF_SYSFS=y
CONFIG_RTC_INTF_DEV=y
CONFIG_RTC_INTF_DEV_UIE_EMUL=y
CONFIG_RTC_DRV_TEST=y
#
# I2C RTC drivers
#
# CONFIG_RTC_DRV_DS1307 is not set
CONFIG_RTC_DRV_DS1374=y
CONFIG_RTC_DRV_DS1672=y
CONFIG_RTC_DRV_MAX6900=y
CONFIG_RTC_DRV_RS5C372=y
# CONFIG_RTC_DRV_ISL1208 is not set
CONFIG_RTC_DRV_X1205=y
CONFIG_RTC_DRV_PCF8563=y
CONFIG_RTC_DRV_PCF8583=y
CONFIG_RTC_DRV_M41T80=y
CONFIG_RTC_DRV_M41T80_WDT=y
CONFIG_RTC_DRV_TWL4030=y
CONFIG_RTC_DRV_S35390A=y
# CONFIG_RTC_DRV_FM3130 is not set
# CONFIG_RTC_DRV_RX8581 is not set
#
# SPI RTC drivers
#
#
# Platform RTC drivers
#
CONFIG_RTC_DRV_CMOS=y
CONFIG_RTC_DRV_DS1286=y
CONFIG_RTC_DRV_DS1511=y
CONFIG_RTC_DRV_DS1553=y
CONFIG_RTC_DRV_DS1742=y
CONFIG_RTC_DRV_STK17TA8=y
CONFIG_RTC_DRV_M48T86=y
CONFIG_RTC_DRV_M48T35=y
CONFIG_RTC_DRV_M48T59=y
CONFIG_RTC_DRV_BQ4802=y
CONFIG_RTC_DRV_V3020=y
CONFIG_RTC_DRV_PCF50633=y
#
# on-CPU RTC drivers
#
CONFIG_DMADEVICES=y
#
# DMA Devices
#
CONFIG_INTEL_IOATDMA=y
CONFIG_DMA_ENGINE=y
#
# DMA Clients
#
CONFIG_NET_DMA=y
CONFIG_ASYNC_TX_DMA=y
CONFIG_DMATEST=y
CONFIG_DCA=y
# CONFIG_AUXDISPLAY is not set
CONFIG_UIO=y
CONFIG_UIO_CIF=y
CONFIG_UIO_PDRV=y
CONFIG_UIO_PDRV_GENIRQ=y
# CONFIG_UIO_SMX is not set
CONFIG_UIO_AEC=y
CONFIG_UIO_SERCOS3=y
CONFIG_XEN_BALLOON=y
# CONFIG_XEN_SCRUB_PAGES is not set
CONFIG_XEN_DEV_EVTCHN=y
CONFIG_XENFS=y
CONFIG_XEN_COMPAT_XENFS=y
CONFIG_XEN_SYS_HYPERVISOR=y
CONFIG_X86_PLATFORM_DEVICES=y
#
# Firmware Drivers
#
CONFIG_EDD=y
# CONFIG_EDD_OFF is not set
# CONFIG_FIRMWARE_MEMMAP is not set
CONFIG_DELL_RBU=y
# CONFIG_DCDBAS is not set
CONFIG_ISCSI_IBFT_FIND=y
CONFIG_ISCSI_IBFT=y
#
# File systems
#
# CONFIG_EXT2_FS is not set
# CONFIG_EXT3_FS is not set
# CONFIG_EXT4_FS is not set
CONFIG_JBD2=y
CONFIG_JBD2_DEBUG=y
# CONFIG_REISERFS_FS is not set
# CONFIG_JFS_FS is not set
CONFIG_FS_POSIX_ACL=y
CONFIG_FILE_LOCKING=y
CONFIG_XFS_FS=y
CONFIG_XFS_QUOTA=y
# CONFIG_XFS_POSIX_ACL is not set
CONFIG_XFS_RT=y
CONFIG_OCFS2_FS=y
CONFIG_OCFS2_FS_O2CB=y
CONFIG_OCFS2_FS_STATS=y
CONFIG_OCFS2_DEBUG_MASKLOG=y
# CONFIG_OCFS2_DEBUG_FS is not set
CONFIG_OCFS2_FS_POSIX_ACL=y
# CONFIG_DNOTIFY is not set
CONFIG_INOTIFY=y
# CONFIG_INOTIFY_USER is not set
CONFIG_QUOTA=y
CONFIG_QUOTA_NETLINK_INTERFACE=y
# CONFIG_PRINT_QUOTA_WARNING is not set
CONFIG_QUOTA_TREE=y
CONFIG_QFMT_V1=y
# CONFIG_QFMT_V2 is not set
CONFIG_QUOTACTL=y
CONFIG_AUTOFS_FS=y
CONFIG_AUTOFS4_FS=y
# CONFIG_FUSE_FS is not set
#
# Caches
#
#
# CD-ROM/DVD Filesystems
#
CONFIG_ISO9660_FS=y
CONFIG_JOLIET=y
# CONFIG_ZISOFS is not set
# CONFIG_UDF_FS is not set
#
# DOS/FAT/NT Filesystems
#
# CONFIG_MSDOS_FS is not set
# CONFIG_VFAT_FS is not set
CONFIG_NTFS_FS=y
CONFIG_NTFS_DEBUG=y
CONFIG_NTFS_RW=y
#
# Pseudo filesystems
#
# CONFIG_PROC_FS is not set
CONFIG_SYSFS=y
CONFIG_TMPFS=y
# CONFIG_TMPFS_POSIX_ACL is not set
# CONFIG_HUGETLBFS is not set
# CONFIG_HUGETLB_PAGE is not set
CONFIG_CONFIGFS_FS=y
CONFIG_MISC_FILESYSTEMS=y
# CONFIG_HFSPLUS_FS is not set
# CONFIG_CRAMFS is not set
# CONFIG_SQUASHFS is not set
# CONFIG_VXFS_FS is not set
CONFIG_MINIX_FS=y
CONFIG_OMFS_FS=y
CONFIG_HPFS_FS=y
CONFIG_QNX4FS_FS=y
CONFIG_ROMFS_FS=y
CONFIG_ROMFS_BACKED_BY_BLOCK=y
# CONFIG_ROMFS_BACKED_BY_MTD is not set
# CONFIG_ROMFS_BACKED_BY_BOTH is not set
CONFIG_ROMFS_ON_BLOCK=y
CONFIG_SYSV_FS=y
CONFIG_UFS_FS=y
CONFIG_UFS_DEBUG=y
CONFIG_EXOFS_FS=y
# CONFIG_EXOFS_DEBUG is not set
CONFIG_NETWORK_FILESYSTEMS=y
CONFIG_NFS_FS=y
CONFIG_NFS_V3=y
CONFIG_NFS_V3_ACL=y
CONFIG_NFSD=y
CONFIG_NFSD_V2_ACL=y
CONFIG_NFSD_V3=y
CONFIG_NFSD_V3_ACL=y
CONFIG_LOCKD=y
CONFIG_LOCKD_V4=y
CONFIG_EXPORTFS=y
CONFIG_NFS_ACL_SUPPORT=y
CONFIG_NFS_COMMON=y
CONFIG_SUNRPC=y
CONFIG_SMB_FS=y
# CONFIG_SMB_NLS_DEFAULT is not set
CONFIG_CIFS=y
CONFIG_CIFS_STATS=y
CONFIG_CIFS_STATS2=y
CONFIG_CIFS_WEAK_PW_HASH=y
# CONFIG_CIFS_UPCALL is not set
CONFIG_CIFS_XATTR=y
# CONFIG_CIFS_POSIX is not set
# CONFIG_CIFS_DEBUG2 is not set
CONFIG_CIFS_DFS_UPCALL=y
# CONFIG_NCP_FS is not set
CONFIG_CODA_FS=y
#
# Partition Types
#
# CONFIG_PARTITION_ADVANCED is not set
CONFIG_MSDOS_PARTITION=y
CONFIG_NLS=y
CONFIG_NLS_DEFAULT="iso8859-1"
CONFIG_NLS_CODEPAGE_437=y
# CONFIG_NLS_CODEPAGE_737 is not set
CONFIG_NLS_CODEPAGE_775=y
CONFIG_NLS_CODEPAGE_850=y
CONFIG_NLS_CODEPAGE_852=y
CONFIG_NLS_CODEPAGE_855=y
CONFIG_NLS_CODEPAGE_857=y
CONFIG_NLS_CODEPAGE_860=y
CONFIG_NLS_CODEPAGE_861=y
CONFIG_NLS_CODEPAGE_862=y
CONFIG_NLS_CODEPAGE_863=y
# CONFIG_NLS_CODEPAGE_864 is not set
# CONFIG_NLS_CODEPAGE_865 is not set
# CONFIG_NLS_CODEPAGE_866 is not set
CONFIG_NLS_CODEPAGE_869=y
# CONFIG_NLS_CODEPAGE_936 is not set
CONFIG_NLS_CODEPAGE_950=y
CONFIG_NLS_CODEPAGE_932=y
CONFIG_NLS_CODEPAGE_949=y
CONFIG_NLS_CODEPAGE_874=y
# CONFIG_NLS_ISO8859_8 is not set
CONFIG_NLS_CODEPAGE_1250=y
CONFIG_NLS_CODEPAGE_1251=y
CONFIG_NLS_ASCII=y
CONFIG_NLS_ISO8859_1=y
# CONFIG_NLS_ISO8859_2 is not set
# CONFIG_NLS_ISO8859_3 is not set
CONFIG_NLS_ISO8859_4=y
# CONFIG_NLS_ISO8859_5 is not set
CONFIG_NLS_ISO8859_6=y
CONFIG_NLS_ISO8859_7=y
CONFIG_NLS_ISO8859_9=y
# CONFIG_NLS_ISO8859_13 is not set
CONFIG_NLS_ISO8859_14=y
CONFIG_NLS_ISO8859_15=y
CONFIG_NLS_KOI8_R=y
CONFIG_NLS_KOI8_U=y
CONFIG_NLS_UTF8=y
#
# Kernel hacking
#
CONFIG_TRACE_IRQFLAGS_SUPPORT=y
CONFIG_ALLOW_WARNINGS=y
CONFIG_ENABLE_WARN_DEPRECATED=y
CONFIG_ENABLE_MUST_CHECK=y
CONFIG_FRAME_WARN=2048
CONFIG_MAGIC_SYSRQ=y
CONFIG_UNUSED_SYMBOLS=y
CONFIG_DEBUG_FS=y
CONFIG_HEADERS_CHECK=y
CONFIG_DEBUG_SECTION_MISMATCH=y
CONFIG_DEBUG_KERNEL=y
CONFIG_DEBUG_SHIRQ=y
# CONFIG_DETECT_SOFTLOCKUP is not set
CONFIG_DETECT_HUNG_TASK=y
CONFIG_BOOTPARAM_HUNG_TASK_PANIC=y
CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=1
CONFIG_SCHED_DEBUG=y
CONFIG_SCHEDSTATS=y
CONFIG_DEBUG_OBJECTS=y
# CONFIG_DEBUG_OBJECTS_SELFTEST is not set
CONFIG_DEBUG_OBJECTS_FREE=y
CONFIG_DEBUG_OBJECTS_TIMERS=y
CONFIG_DEBUG_OBJECTS_ENABLE_DEFAULT=1
CONFIG_SLUB_DEBUG_ON=y
CONFIG_SLUB_STATS=y
CONFIG_DEBUG_RT_MUTEXES=y
CONFIG_DEBUG_PI_LIST=y
# CONFIG_RT_MUTEX_TESTER is not set
CONFIG_DEBUG_SPINLOCK=y
CONFIG_DEBUG_MUTEXES=y
CONFIG_DEBUG_LOCK_ALLOC=y
# CONFIG_PROVE_LOCKING is not set
CONFIG_LOCKDEP=y
CONFIG_LOCK_STAT=y
CONFIG_DEBUG_LOCKDEP=y
CONFIG_TRACE_IRQFLAGS=y
CONFIG_DEBUG_SPINLOCK_SLEEP=y
CONFIG_DEBUG_LOCKING_API_SELFTESTS=y
CONFIG_STACKTRACE=y
CONFIG_DEBUG_KOBJECT=y
# CONFIG_DEBUG_BUGVERBOSE is not set
CONFIG_DEBUG_VM=y
CONFIG_DEBUG_VIRTUAL=y
CONFIG_DEBUG_WRITECOUNT=y
# CONFIG_DEBUG_MEMORY_INIT is not set
CONFIG_DEBUG_LIST=y
CONFIG_DEBUG_SG=y
CONFIG_DEBUG_NOTIFIERS=y
CONFIG_ARCH_WANT_FRAME_POINTERS=y
CONFIG_FRAME_POINTER=y
CONFIG_RCU_TORTURE_TEST=y
CONFIG_RCU_TORTURE_TEST_RUNNABLE=y
CONFIG_RCU_CPU_STALL_DETECTOR=y
CONFIG_BACKTRACE_SELF_TEST=y
CONFIG_DEBUG_BLOCK_EXT_DEVT=y
CONFIG_FAULT_INJECTION=y
# CONFIG_FAILSLAB is not set
CONFIG_FAIL_PAGE_ALLOC=y
CONFIG_FAIL_MAKE_REQUEST=y
CONFIG_FAIL_IO_TIMEOUT=y
CONFIG_FAULT_INJECTION_DEBUG_FS=y
CONFIG_LATENCYTOP=y
CONFIG_DEBUG_PAGEALLOC=y
CONFIG_USER_STACKTRACE_SUPPORT=y
CONFIG_NOP_TRACER=y
CONFIG_HAVE_FUNCTION_TRACER=y
CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y
CONFIG_HAVE_DYNAMIC_FTRACE=y
CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
CONFIG_HAVE_HW_BRANCH_TRACER=y
CONFIG_HAVE_FTRACE_SYSCALLS=y
CONFIG_TRACER_MAX_TRACE=y
CONFIG_RING_BUFFER=y
CONFIG_EVENT_TRACING=y
CONFIG_TRACING=y
CONFIG_TRACING_SUPPORT=y
#
# Tracers
#
CONFIG_FUNCTION_TRACER=y
CONFIG_FUNCTION_GRAPH_TRACER=y
CONFIG_IRQSOFF_TRACER=y
# CONFIG_SYSPROF_TRACER is not set
CONFIG_SCHED_TRACER=y
CONFIG_CONTEXT_SWITCH_TRACER=y
CONFIG_EVENT_TRACER=y
CONFIG_FTRACE_SYSCALLS=y
CONFIG_BOOT_TRACER=y
CONFIG_TRACE_BRANCH_PROFILING=y
CONFIG_PROFILE_ALL_BRANCHES=y
CONFIG_TRACING_BRANCHES=y
CONFIG_BRANCH_TRACER=y
CONFIG_POWER_TRACER=y
CONFIG_STACK_TRACER=y
# CONFIG_HW_BRANCH_TRACER is not set
CONFIG_KMEMTRACE=y
# CONFIG_WORKQUEUE_TRACER is not set
CONFIG_BLK_DEV_IO_TRACE=y
# CONFIG_DYNAMIC_FTRACE is not set
# CONFIG_FUNCTION_PROFILER is not set
CONFIG_FTRACE_SELFTEST=y
CONFIG_FTRACE_STARTUP_TEST=y
# CONFIG_MMIOTRACE is not set
CONFIG_PROVIDE_OHCI1394_DMA_INIT=y
CONFIG_BUILD_DOCSRC=y
CONFIG_DMA_API_DEBUG=y
CONFIG_SAMPLES=y
# CONFIG_SAMPLE_KOBJECT is not set
CONFIG_HAVE_ARCH_KGDB=y
CONFIG_HAVE_ARCH_KMEMCHECK=y
# CONFIG_STRICT_DEVMEM is not set
# CONFIG_X86_VERBOSE_BOOTUP is not set
# CONFIG_EARLY_PRINTK is not set
CONFIG_DEBUG_STACKOVERFLOW=y
CONFIG_DEBUG_STACK_USAGE=y
# CONFIG_DEBUG_PER_CPU_MAPS is not set
# CONFIG_X86_PTDUMP is not set
CONFIG_DEBUG_RODATA=y
# CONFIG_DEBUG_RODATA_TEST is not set
CONFIG_IOMMU_DEBUG=y
CONFIG_IOMMU_LEAK=y
CONFIG_X86_DS_SELFTEST=y
CONFIG_HAVE_MMIOTRACE_SUPPORT=y
CONFIG_IO_DELAY_TYPE_0X80=0
CONFIG_IO_DELAY_TYPE_0XED=1
CONFIG_IO_DELAY_TYPE_UDELAY=2
CONFIG_IO_DELAY_TYPE_NONE=3
CONFIG_IO_DELAY_0X80=y
# CONFIG_IO_DELAY_0XED is not set
# CONFIG_IO_DELAY_UDELAY is not set
# CONFIG_IO_DELAY_NONE is not set
CONFIG_DEFAULT_IO_DELAY_TYPE=0
CONFIG_DEBUG_BOOT_PARAMS=y
CONFIG_CPA_DEBUG=y
CONFIG_OPTIMIZE_INLINING=y
#
# Security options
#
CONFIG_KEYS=y
CONFIG_KEYS_DEBUG_PROC_KEYS=y
CONFIG_SECURITY=y
CONFIG_SECURITYFS=y
CONFIG_SECURITY_NETWORK=y
CONFIG_SECURITY_NETWORK_XFRM=y
CONFIG_SECURITY_PATH=y
CONFIG_SECURITY_FILE_CAPABILITIES=y
CONFIG_SECURITY_DEFAULT_MMAP_MIN_ADDR=0
CONFIG_SECURITY_SELINUX=y
CONFIG_SECURITY_SELINUX_BOOTPARAM=y
CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=1
CONFIG_SECURITY_SELINUX_DISABLE=y
# CONFIG_SECURITY_SELINUX_DEVELOP is not set
CONFIG_SECURITY_SELINUX_AVC_STATS=y
CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE=1
CONFIG_SECURITY_SELINUX_POLICYDB_VERSION_MAX=y
CONFIG_SECURITY_SELINUX_POLICYDB_VERSION_MAX_VALUE=19
CONFIG_SECURITY_SMACK=y
CONFIG_SECURITY_TOMOYO=y
CONFIG_XOR_BLOCKS=y
CONFIG_ASYNC_CORE=y
CONFIG_ASYNC_MEMCPY=y
CONFIG_ASYNC_XOR=y
CONFIG_CRYPTO=y
#
# Crypto core or helper
#
CONFIG_CRYPTO_FIPS=y
CONFIG_CRYPTO_ALGAPI=y
CONFIG_CRYPTO_ALGAPI2=y
CONFIG_CRYPTO_AEAD=y
CONFIG_CRYPTO_AEAD2=y
CONFIG_CRYPTO_BLKCIPHER=y
CONFIG_CRYPTO_BLKCIPHER2=y
CONFIG_CRYPTO_HASH=y
CONFIG_CRYPTO_HASH2=y
CONFIG_CRYPTO_RNG=y
CONFIG_CRYPTO_RNG2=y
CONFIG_CRYPTO_PCOMP=y
CONFIG_CRYPTO_MANAGER=y
CONFIG_CRYPTO_MANAGER2=y
CONFIG_CRYPTO_GF128MUL=y
CONFIG_CRYPTO_NULL=y
CONFIG_CRYPTO_WORKQUEUE=y
CONFIG_CRYPTO_CRYPTD=y
CONFIG_CRYPTO_AUTHENC=y
#
# Authenticated Encryption with Associated Data
#
CONFIG_CRYPTO_CCM=y
CONFIG_CRYPTO_GCM=y
CONFIG_CRYPTO_SEQIV=y
#
# Block modes
#
CONFIG_CRYPTO_CBC=y
CONFIG_CRYPTO_CTR=y
CONFIG_CRYPTO_CTS=y
CONFIG_CRYPTO_ECB=y
# CONFIG_CRYPTO_PCBC is not set
#
# Hash modes
#
CONFIG_CRYPTO_HMAC=y
#
# Digest
#
# CONFIG_CRYPTO_CRC32C is not set
CONFIG_CRYPTO_CRC32C_INTEL=y
# CONFIG_CRYPTO_MD4 is not set
CONFIG_CRYPTO_MD5=y
CONFIG_CRYPTO_MICHAEL_MIC=y
# CONFIG_CRYPTO_RMD128 is not set
CONFIG_CRYPTO_RMD160=y
CONFIG_CRYPTO_RMD256=y
CONFIG_CRYPTO_RMD320=y
CONFIG_CRYPTO_SHA1=y
CONFIG_CRYPTO_SHA256=y
# CONFIG_CRYPTO_SHA512 is not set
# CONFIG_CRYPTO_TGR192 is not set
CONFIG_CRYPTO_WP512=y
#
# Ciphers
#
CONFIG_CRYPTO_AES=y
CONFIG_CRYPTO_AES_X86_64=y
CONFIG_CRYPTO_AES_NI_INTEL=y
CONFIG_CRYPTO_ANUBIS=y
CONFIG_CRYPTO_ARC4=y
# CONFIG_CRYPTO_BLOWFISH is not set
# CONFIG_CRYPTO_CAMELLIA is not set
# CONFIG_CRYPTO_CAST5 is not set
CONFIG_CRYPTO_CAST6=y
CONFIG_CRYPTO_DES=y
CONFIG_CRYPTO_FCRYPT=y
CONFIG_CRYPTO_KHAZAD=y
CONFIG_CRYPTO_SEED=y
CONFIG_CRYPTO_SERPENT=y
CONFIG_CRYPTO_TEA=y
CONFIG_CRYPTO_TWOFISH=y
CONFIG_CRYPTO_TWOFISH_COMMON=y
# CONFIG_CRYPTO_TWOFISH_X86_64 is not set
#
# Compression
#
CONFIG_CRYPTO_DEFLATE=y
# CONFIG_CRYPTO_ZLIB is not set
CONFIG_CRYPTO_LZO=y
#
# Random Number Generation
#
CONFIG_CRYPTO_ANSI_CPRNG=y
CONFIG_CRYPTO_HW=y
# CONFIG_CRYPTO_DEV_HIFN_795X is not set
CONFIG_HAVE_KVM=y
CONFIG_HAVE_KVM_IRQCHIP=y
CONFIG_VIRTUALIZATION=y
CONFIG_KVM=y
CONFIG_KVM_INTEL=y
CONFIG_KVM_AMD=y
# CONFIG_KVM_TRACE is not set
CONFIG_VIRTIO=y
CONFIG_VIRTIO_RING=y
CONFIG_VIRTIO_BALLOON=y
CONFIG_BINARY_PRINTF=y
#
# Library routines
#
CONFIG_BITREVERSE=y
CONFIG_GENERIC_FIND_FIRST_BIT=y
CONFIG_GENERIC_FIND_NEXT_BIT=y
CONFIG_GENERIC_FIND_LAST_BIT=y
# CONFIG_CRC_CCITT is not set
CONFIG_CRC16=y
CONFIG_CRC_T10DIF=y
CONFIG_CRC_ITU_T=y
CONFIG_CRC32=y
CONFIG_CRC7=y
# CONFIG_LIBCRC32C is not set
CONFIG_ZLIB_INFLATE=y
CONFIG_ZLIB_DEFLATE=y
CONFIG_LZO_COMPRESS=y
CONFIG_LZO_DECOMPRESS=y
CONFIG_DECOMPRESS_BZIP2=y
CONFIG_HAS_IOMEM=y
CONFIG_HAS_IOPORT=y
CONFIG_HAS_DMA=y
CONFIG_NLATTR=y
CONFIG_FORCE_SUCCESSFUL_BUILD=y
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [PATCH 0/8] [GIT PULL] TRACE_EVENT for modules
2009-04-14 18:21 ` Ingo Molnar
@ 2009-04-14 18:33 ` Steven Rostedt
2009-04-14 18:35 ` Ingo Molnar
0 siblings, 1 reply; 60+ messages in thread
From: Steven Rostedt @ 2009-04-14 18:33 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Andrew Morton, Thomas Gleixner, Peter Zijlstra,
Frederic Weisbecker, Theodore Tso, Arjan van de Ven,
Christoph Hellwig, Mathieu Desnoyers, Jeremy Fitzhardinge,
Lai Jiangshan, Zhaolei, Li Zefan, KOSAKI Motohiro,
Masami Hiramatsu, Frank Ch. Eigler, Tom Zanussi, Jiaying Zhang,
Michael Rubin, Martin Bligh
On Tue, 14 Apr 2009, Ingo Molnar wrote:
>
> * Steven Rostedt <rostedt@goodmis.org> wrote:
>
> > include/trace/define_trace.h | 79 ++++++
> > include/trace/ftrace.h | 493 +++++++++++++++++++++++++++++++++++
> > include/trace/irq.h | 56 ++++-
> > include/trace/irq_event_types.h | 55 ----
> > include/trace/kmem.h | 189 +++++++++++++-
> > include/trace/lockdep.h | 55 ++++-
> > include/trace/lockdep_event_types.h | 57 ----
> > include/trace/sched.h | 336 +++++++++++++++++++++++-
> > include/trace/sched_event_types.h | 337 ------------------------
> > include/trace/skb.h | 39 +++-
> > include/trace/skb_event_types.h | 38 ---
> > include/trace/trace_event_types.h | 7 -
> > include/trace/trace_events.h | 7 -
>
> Detail: we still have include/trace/kmem_event_types.h around - is
> that intentional? It isnt actually used by anything so we can git-rm
> it.
I rebased it several times, doing minor tweaks and such. I think I may
have missed a git-rm. That file is suppose to be deleted.
>
> Also, we mix tracepoint definition headers with other misc headers
> such as syscall.h or boot.h.
>
> I think it would be cleaner and better sructured to have these
> centrally enumerated tracepoint definitions separated in
> include/trace/events/.
>
> That sub-directory would _only_ include the TRACE_EVENT()
> definitions - nothing else. Hence it would also be a nice in-situ
> template collection for anyone adding new tracepoints. The existence
> of other headers really distracts from that.
>
> What do you think?
I'm fine with that. As long as people are fine with doing:
#include <trace/events/sched.h>
and such.
-- Steve
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [PATCH 0/8] [GIT PULL] TRACE_EVENT for modules
2009-04-14 18:33 ` Steven Rostedt
@ 2009-04-14 18:35 ` Ingo Molnar
0 siblings, 0 replies; 60+ messages in thread
From: Ingo Molnar @ 2009-04-14 18:35 UTC (permalink / raw)
To: Steven Rostedt
Cc: linux-kernel, Andrew Morton, Thomas Gleixner, Peter Zijlstra,
Frederic Weisbecker, Theodore Tso, Arjan van de Ven,
Christoph Hellwig, Mathieu Desnoyers, Jeremy Fitzhardinge,
Lai Jiangshan, Zhaolei, Li Zefan, KOSAKI Motohiro,
Masami Hiramatsu, Frank Ch. Eigler, Tom Zanussi, Jiaying Zhang,
Michael Rubin, Martin Bligh
* Steven Rostedt <rostedt@goodmis.org> wrote:
>
> On Tue, 14 Apr 2009, Ingo Molnar wrote:
>
> >
> > * Steven Rostedt <rostedt@goodmis.org> wrote:
> >
> > > include/trace/define_trace.h | 79 ++++++
> > > include/trace/ftrace.h | 493 +++++++++++++++++++++++++++++++++++
> > > include/trace/irq.h | 56 ++++-
> > > include/trace/irq_event_types.h | 55 ----
> > > include/trace/kmem.h | 189 +++++++++++++-
> > > include/trace/lockdep.h | 55 ++++-
> > > include/trace/lockdep_event_types.h | 57 ----
> > > include/trace/sched.h | 336 +++++++++++++++++++++++-
> > > include/trace/sched_event_types.h | 337 ------------------------
> > > include/trace/skb.h | 39 +++-
> > > include/trace/skb_event_types.h | 38 ---
> > > include/trace/trace_event_types.h | 7 -
> > > include/trace/trace_events.h | 7 -
> >
> > Detail: we still have include/trace/kmem_event_types.h around - is
> > that intentional? It isnt actually used by anything so we can git-rm
> > it.
>
> I rebased it several times, doing minor tweaks and such. I think I may
> have missed a git-rm. That file is suppose to be deleted.
>
> >
> > Also, we mix tracepoint definition headers with other misc headers
> > such as syscall.h or boot.h.
> >
> > I think it would be cleaner and better sructured to have these
> > centrally enumerated tracepoint definitions separated in
> > include/trace/events/.
> >
> > That sub-directory would _only_ include the TRACE_EVENT()
> > definitions - nothing else. Hence it would also be a nice in-situ
> > template collection for anyone adding new tracepoints. The existence
> > of other headers really distracts from that.
> >
> > What do you think?
>
> I'm fine with that. As long as people are fine with doing:
>
> #include <trace/events/sched.h>
>
> and such.
Yes, i think it's very clear that way: trace/events/*.h bits are for
tracepoint definitions.
Ingo
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [PATCH 3/8] tracing: make trace_seq operations available for core kernel
2009-04-14 17:23 ` [PATCH 3/8] tracing: make trace_seq operations available for core kernel Steven Rostedt
@ 2009-04-14 19:12 ` Peter Zijlstra
2009-04-15 2:19 ` Steven Rostedt
0 siblings, 1 reply; 60+ messages in thread
From: Peter Zijlstra @ 2009-04-14 19:12 UTC (permalink / raw)
To: Steven Rostedt
Cc: linux-kernel, Ingo Molnar, Andrew Morton, Thomas Gleixner,
Frederic Weisbecker, Theodore Tso, Arjan van de Ven,
Christoph Hellwig, Mathieu Desnoyers, Jeremy Fitzhardinge,
Lai Jiangshan, Zhaolei, Li Zefan, KOSAKI Motohiro,
Masami Hiramatsu, Frank Ch. Eigler, Tom Zanussi, Jiaying Zhang,
Michael Rubin, Martin Bligh
On Tue, 2009-04-14 at 13:23 -0400, Steven Rostedt wrote:
> +struct trace_seq {
> + unsigned char buffer[PAGE_SIZE];
> + unsigned int len;
> + unsigned int readpos;
> +};
Would not PAGE_SIZE-2*sizeof(int) be enough? That would make the struct
fit into a single page and avoid an order-1 allocation.
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [PATCH 5/8] tracing/events: move the ftrace event tracing code to core
2009-04-14 17:23 ` [PATCH 5/8] tracing/events: move the ftrace event tracing code to core Steven Rostedt
@ 2009-04-14 19:23 ` Peter Zijlstra
2009-04-15 2:25 ` Steven Rostedt
0 siblings, 1 reply; 60+ messages in thread
From: Peter Zijlstra @ 2009-04-14 19:23 UTC (permalink / raw)
To: Steven Rostedt
Cc: linux-kernel, Ingo Molnar, Andrew Morton, Thomas Gleixner,
Frederic Weisbecker, Theodore Tso, Arjan van de Ven,
Christoph Hellwig, Mathieu Desnoyers, Jeremy Fitzhardinge,
Lai Jiangshan, Zhaolei, Li Zefan, KOSAKI Motohiro,
Masami Hiramatsu, Frank Ch. Eigler, Tom Zanussi, Jiaying Zhang,
Michael Rubin, Martin Bligh
On Tue, 2009-04-14 at 13:23 -0400, Steven Rostedt wrote:
> + * static struct trace_event ftrace_event_type_<call> = {
> + * .trace = ftrace_raw_output_<call>, <-- stage 2
> + * };
> + * static struct ftrace_event_call __used
> + * __attribute__((__aligned__(4)))
> + * __attribute__((section("_ftrace_events"))) event_<call> = {
> + * .name = "<call>",
> + * .system = "<system>",
> + * .raw_init = ftrace_raw_init_event_<call>,
> + * .regfunc = ftrace_reg_event_<call>,
> + * .unregfunc = ftrace_unreg_event_<call>,
> + * .show_format = ftrace_format_<call>,
> + * }
Is there a good reason these are two different structs?
I've always wondered about that, it seems natural to unify them and to
generalize the reverse lookup hash that is now private to trace_output.
The trace_event_profile code could use that reverse lookup, that linear
search it currently does it really lame.
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [PATCH 0/8] [GIT PULL] TRACE_EVENT for modules
2009-04-14 17:23 [PATCH 0/8] [GIT PULL] TRACE_EVENT for modules Steven Rostedt
` (9 preceding siblings ...)
2009-04-14 18:21 ` Ingo Molnar
@ 2009-04-14 21:04 ` Theodore Tso
2009-04-14 21:23 ` Steven Rostedt
` (3 more replies)
10 siblings, 4 replies; 60+ messages in thread
From: Theodore Tso @ 2009-04-14 21:04 UTC (permalink / raw)
To: Steven Rostedt
Cc: linux-kernel, Ingo Molnar, Andrew Morton, Thomas Gleixner,
Peter Zijlstra, Frederic Weisbecker, Arjan van de Ven,
Christoph Hellwig, Mathieu Desnoyers, Jeremy Fitzhardinge,
Lai Jiangshan, Zhaolei, Li Zefan, KOSAKI Motohiro,
Masami Hiramatsu, Frank Ch. Eigler, Tom Zanussi, Jiaying Zhang,
Michael Rubin, Martin Bligh
On Tue, Apr 14, 2009 at 01:23:37PM -0400, Steven Rostedt wrote:
>
> Removal of the two headers per trace system. No need to have
> include/trace/sched.h and include/linux/sched_event_types.h
> All the changes go into include/trace/sched.h. But note that how that
> file is made is important. One could look at the sched.h file, or
> skb.h, lockdep.h and kmem.h as an example.
Hi Steven,
One thing which I would really like is to avoid needing to drop the
header file in include/trace/<subsystem.h>.
The problem that I have with this is that for ext4, we need to access
private data structures which are defined in header files in
fs/ext4/*.h --- which we moved into fs/ext4 a long time ago at the
request of those who felt include/linux/* was getting rather
cluttered, and if a subsystem had header files which were only needed
by files for that particular subsystems, they should be moved out of
include/linux.
I supported the above-mentioned cleanup, but it's causing problems
given that include/trace/ext4_events_types.h (or include/trace/ext4.h
in the new world order) needs access to various structure definitions
in fs/ext4/*.h. I could move the required header files into
include/linux/ext4_tracing_types.h --- which has the downside that it
is a very random collection of data structures --- or I could entirely
revert the cleanup we did long ago and move all of the ext4 header
files back into include/linux. But better yet would be if there was
some way we could tell the tracing subsystem that tracing header file
for ext4 could be found in fs/ext4/ext4_trace.h.
Any chance you could support something like this?
Thanks, regards,
- Ted
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [PATCH 0/8] [GIT PULL] TRACE_EVENT for modules
2009-04-14 21:04 ` Theodore Tso
@ 2009-04-14 21:23 ` Steven Rostedt
2009-04-14 21:59 ` Steven Rostedt
2009-04-14 21:29 ` Frank Ch. Eigler
` (2 subsequent siblings)
3 siblings, 1 reply; 60+ messages in thread
From: Steven Rostedt @ 2009-04-14 21:23 UTC (permalink / raw)
To: Theodore Tso
Cc: linux-kernel, Ingo Molnar, Andrew Morton, Thomas Gleixner,
Peter Zijlstra, Frederic Weisbecker, Arjan van de Ven,
Christoph Hellwig, Mathieu Desnoyers, Jeremy Fitzhardinge,
Lai Jiangshan, Zhaolei, Li Zefan, KOSAKI Motohiro,
Masami Hiramatsu, Frank Ch. Eigler, Tom Zanussi, Jiaying Zhang,
Michael Rubin, Martin Bligh
On Tue, 14 Apr 2009, Theodore Tso wrote:
> On Tue, Apr 14, 2009 at 01:23:37PM -0400, Steven Rostedt wrote:
> >
> > Removal of the two headers per trace system. No need to have
> > include/trace/sched.h and include/linux/sched_event_types.h
> > All the changes go into include/trace/sched.h. But note that how that
> > file is made is important. One could look at the sched.h file, or
> > skb.h, lockdep.h and kmem.h as an example.
>
> Hi Steven,
>
> One thing which I would really like is to avoid needing to drop the
> header file in include/trace/<subsystem.h>.
>
> The problem that I have with this is that for ext4, we need to access
> private data structures which are defined in header files in
> fs/ext4/*.h --- which we moved into fs/ext4 a long time ago at the
> request of those who felt include/linux/* was getting rather
> cluttered, and if a subsystem had header files which were only needed
> by files for that particular subsystems, they should be moved out of
> include/linux.
>
> I supported the above-mentioned cleanup, but it's causing problems
> given that include/trace/ext4_events_types.h (or include/trace/ext4.h
> in the new world order) needs access to various structure definitions
> in fs/ext4/*.h. I could move the required header files into
> include/linux/ext4_tracing_types.h --- which has the downside that it
> is a very random collection of data structures --- or I could entirely
> revert the cleanup we did long ago and move all of the ext4 header
> files back into include/linux. But better yet would be if there was
> some way we could tell the tracing subsystem that tracing header file
> for ext4 could be found in fs/ext4/ext4_trace.h.
>
> Any chance you could support something like this?
Yes, at the bottom of your header file, before including define_trace.h,
you can simply add:
#undef TRACE_INCLUDE_PATH
#define TRACE_INCLUDE_PATH ../../fs/ext4
#include <trace/define_trace.h>
the TRACE_INCLUDE_PATH is a reference from where trace/define_trace.h is
located. It may even be cleaner to do:
#undef TRACE_INCLUDE_PATH
#define TRACE_INCLUDE_PATH EXT4_PATH
and in the Makefile have:
CFLAGS_ext4_jbd2.o := -DEXT4_PATH=$(PWD)
That's something like what I did for my external module test.
-- Steve
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [PATCH 0/8] [GIT PULL] TRACE_EVENT for modules
2009-04-14 21:04 ` Theodore Tso
2009-04-14 21:23 ` Steven Rostedt
@ 2009-04-14 21:29 ` Frank Ch. Eigler
2009-04-14 22:00 ` Steven Rostedt
2009-04-16 16:53 ` Christoph Hellwig
2009-04-14 21:48 ` Jeremy Fitzhardinge
2009-04-16 16:52 ` Christoph Hellwig
3 siblings, 2 replies; 60+ messages in thread
From: Frank Ch. Eigler @ 2009-04-14 21:29 UTC (permalink / raw)
To: Theodore Tso, Steven Rostedt, linux-kernel, Ingo Molnar,
Andrew Morton, Thomas Gleixner, Peter Zijlstra,
Frederic Weisbecker, Arjan van de Ven, Christoph Hellwig,
Mathieu Desnoyers, Jeremy Fitzhardinge, Lai Jiangshan, Zhaolei,
Li Zefan, KOSAKI Motohiro, Masami Hiramatsu, Tom Zanussi,
Jiaying Zhang, Michael Rubin, Martin Bligh
Hi -
On Tue, Apr 14, 2009 at 05:04:45PM -0400, Theodore Tso wrote:
> [...]
> One thing which I would really like is to avoid needing to drop the
> header file in include/trace/<subsystem.h>.
>
> The problem that I have with this is that for ext4, we need to access
> private data structures which are defined in header files in
> fs/ext4/*.h --- which we moved into fs/ext4 a long time ago [...]
If the tracepoints/events expand to code that exposes those private
structures, then those structures are perhaps not quite so private any
more. That argues for moving those headers back under include/..., or
at least those type decls made reachable from the tracepoints.
- FChE
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [PATCH 0/8] [GIT PULL] TRACE_EVENT for modules
2009-04-14 21:04 ` Theodore Tso
2009-04-14 21:23 ` Steven Rostedt
2009-04-14 21:29 ` Frank Ch. Eigler
@ 2009-04-14 21:48 ` Jeremy Fitzhardinge
2009-04-14 21:55 ` Steven Rostedt
2009-04-16 16:52 ` Christoph Hellwig
3 siblings, 1 reply; 60+ messages in thread
From: Jeremy Fitzhardinge @ 2009-04-14 21:48 UTC (permalink / raw)
To: Theodore Tso, Steven Rostedt, linux-kernel, Ingo Molnar,
Andrew Morton, Thomas Gleixner, Peter Zijlstra,
Frederic Weisbecker, Arjan van de Ven, Christoph Hellwig,
Mathieu Desnoyers, Jeremy Fitzhardinge, Lai Jiangshan, Zhaolei,
Li Zefan, KOSAKI Motohiro, Masami Hiramatsu, Frank Ch. Eigler,
Tom Zanussi, Jiaying Zhang, Michael Rubin, Martin Bligh
Theodore Tso wrote:
> Any chance you could support something like this?
>
>
I think that's already there. I'm defining
arch/x86/include/asm/paravirt-trace.h with:
#ifndef _ASM_X86_PARAVIRT_TRACE_H
#define _ASM_X86_PARAVIRT_TRACE_H
#include <linux/tracepoint.h>
#include <asm/paravirt_types.h>
#undef TRACE_SYSTEM
#define TRACE_SYSTEM pvops
#define TRACE_INCLUDE_FILE paravirt-trace
#define TRACE_INCLUDE_PATH asm
[...]
Which ends up including <asm/paravirt-trace.h>
J
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [PATCH 1/8] tracing: consolidate trace and trace_event headers
2009-04-14 17:23 ` [PATCH 1/8] tracing: consolidate trace and trace_event headers Steven Rostedt
@ 2009-04-14 21:51 ` Frederic Weisbecker
2009-04-14 22:04 ` Steven Rostedt
0 siblings, 1 reply; 60+ messages in thread
From: Frederic Weisbecker @ 2009-04-14 21:51 UTC (permalink / raw)
To: Steven Rostedt
Cc: linux-kernel, Ingo Molnar, Andrew Morton, Thomas Gleixner,
Peter Zijlstra, Theodore Tso, Arjan van de Ven, Christoph Hellwig,
Mathieu Desnoyers, Jeremy Fitzhardinge, Lai Jiangshan, Zhaolei,
Li Zefan, KOSAKI Motohiro, Masami Hiramatsu, Frank Ch. Eigler,
Tom Zanussi, Jiaying Zhang, Michael Rubin, Martin Bligh,
Jason Baron, Mathieu Desnoyers
On Tue, Apr 14, 2009 at 01:23:38PM -0400, Steven Rostedt wrote:
> From: Steven Rostedt <srostedt@redhat.com>
>
> Impact: clean up
>
> Neil Horman (et. al.) criticized the way the trace events were broken up
> into two files. The reason for that was that ftrace needed to separate out
> the declarations from where the #include <linux/tracepoint.h> was used.
> It then dawned on me that the tracepoint.h header only needs to define the
> TRACE_EVENT macro if it is not already defined.
>
> The solution is simply to test if TRACE_EVENT is defined, and if it is not
> then the linux/tracepoint.h header can define it. This change consolidates
> all the <traces>.h and <traces>_event_types.h into the <traces>.h file.
>
> Reported-by: Neil Horman <nhorman@tuxdriver.com>
> Reported-by: Theodore Tso <tytso@mit.edu>
> Reported-by: Jiaying Zhang <jiayingz@google.com>
> Cc: Zhaolei <zhaolei@cn.fujitsu.com>
> Cc: Frederic Weisbecker <fweisbec@gmail.com>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Jason Baron <jbaron@redhat.com>
> Cc: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
> ---
> include/linux/tracepoint.h | 9 +-
> include/trace/irq.h | 51 +++++-
> include/trace/irq_event_types.h | 55 ------
> include/trace/kmem.h | 189 +++++++++++++++++++-
> include/trace/lockdep.h | 52 +++++-
> include/trace/lockdep_event_types.h | 57 ------
> include/trace/sched.h | 333 ++++++++++++++++++++++++++++++++++-
> include/trace/sched_event_types.h | 337 -----------------------------------
> include/trace/skb.h | 36 ++++-
> include/trace/skb_event_types.h | 38 ----
> include/trace/trace_event_types.h | 7 -
> kernel/trace/events.c | 1 +
> kernel/trace/trace_events_stage_1.h | 4 +-
> kernel/trace/trace_events_stage_2.h | 8 +-
> kernel/trace/trace_events_stage_3.h | 4 +-
> 15 files changed, 663 insertions(+), 518 deletions(-)
> delete mode 100644 include/trace/irq_event_types.h
> delete mode 100644 include/trace/lockdep_event_types.h
> delete mode 100644 include/trace/sched_event_types.h
> delete mode 100644 include/trace/skb_event_types.h
> delete mode 100644 include/trace/trace_event_types.h
I don't know if you use git-format-patch without -M or
something else specific to git pull request. But it looks
like the renames are not detected here, so it's a bit
hard to know what have been actually happened or deleted
in the end result.
Thanks,
Frederic.
> diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h
> index d35a7ee..4353f3f 100644
> --- a/include/linux/tracepoint.h
> +++ b/include/linux/tracepoint.h
> @@ -31,6 +31,8 @@ struct tracepoint {
> * Keep in sync with vmlinux.lds.h.
> */
>
> +#ifndef DECLARE_TRACE
> +
> #define TP_PROTO(args...) args
> #define TP_ARGS(args...) args
>
> @@ -114,6 +116,7 @@ static inline void tracepoint_update_probe_range(struct tracepoint *begin,
> struct tracepoint *end)
> { }
> #endif /* CONFIG_TRACEPOINTS */
> +#endif /* DECLARE_TRACE */
>
> /*
> * Connect a probe to a tracepoint.
> @@ -154,10 +157,13 @@ static inline void tracepoint_synchronize_unregister(void)
> }
>
> #define PARAMS(args...) args
> +
> +#ifndef TRACE_FORMAT
> #define TRACE_FORMAT(name, proto, args, fmt) \
> DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
> +#endif
>
> -
> +#ifndef TRACE_EVENT
> /*
> * For use with the TRACE_EVENT macro:
> *
> @@ -262,5 +268,6 @@ static inline void tracepoint_synchronize_unregister(void)
>
> #define TRACE_EVENT(name, proto, args, struct, assign, print) \
> DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
> +#endif
>
> #endif
> diff --git a/include/trace/irq.h b/include/trace/irq.h
> index ff5d449..04ab4c6 100644
> --- a/include/trace/irq.h
> +++ b/include/trace/irq.h
> @@ -1,9 +1,54 @@
> -#ifndef _TRACE_IRQ_H
> +#if !defined(_TRACE_IRQ_H) || defined(TRACE_HEADER_MULTI_READ)
> #define _TRACE_IRQ_H
>
> -#include <linux/interrupt.h>
> #include <linux/tracepoint.h>
> +#include <linux/interrupt.h>
> +
> +#undef TRACE_SYSTEM
> +#define TRACE_SYSTEM irq
> +
> +/*
> + * Tracepoint for entry of interrupt handler:
> + */
> +TRACE_FORMAT(irq_handler_entry,
> + TP_PROTO(int irq, struct irqaction *action),
> + TP_ARGS(irq, action),
> + TP_FMT("irq=%d handler=%s", irq, action->name)
> + );
> +
> +/*
> + * Tracepoint for return of an interrupt handler:
> + */
> +TRACE_EVENT(irq_handler_exit,
> +
> + TP_PROTO(int irq, struct irqaction *action, int ret),
> +
> + TP_ARGS(irq, action, ret),
> +
> + TP_STRUCT__entry(
> + __field( int, irq )
> + __field( int, ret )
> + ),
> +
> + TP_fast_assign(
> + __entry->irq = irq;
> + __entry->ret = ret;
> + ),
> +
> + TP_printk("irq=%d return=%s",
> + __entry->irq, __entry->ret ? "handled" : "unhandled")
> +);
> +
> +TRACE_FORMAT(softirq_entry,
> + TP_PROTO(struct softirq_action *h, struct softirq_action *vec),
> + TP_ARGS(h, vec),
> + TP_FMT("softirq=%d action=%s", (int)(h - vec), softirq_to_name[h-vec])
> + );
>
> -#include <trace/irq_event_types.h>
> +TRACE_FORMAT(softirq_exit,
> + TP_PROTO(struct softirq_action *h, struct softirq_action *vec),
> + TP_ARGS(h, vec),
> + TP_FMT("softirq=%d action=%s", (int)(h - vec), softirq_to_name[h-vec])
> + );
>
> #endif
> diff --git a/include/trace/irq_event_types.h b/include/trace/irq_event_types.h
> deleted file mode 100644
> index 85964eb..0000000
> --- a/include/trace/irq_event_types.h
> +++ /dev/null
> @@ -1,55 +0,0 @@
> -
> -/* use <trace/irq.h> instead */
> -#ifndef TRACE_FORMAT
> -# error Do not include this file directly.
> -# error Unless you know what you are doing.
> -#endif
> -
> -#undef TRACE_SYSTEM
> -#define TRACE_SYSTEM irq
> -
> -/*
> - * Tracepoint for entry of interrupt handler:
> - */
> -TRACE_FORMAT(irq_handler_entry,
> - TP_PROTO(int irq, struct irqaction *action),
> - TP_ARGS(irq, action),
> - TP_FMT("irq=%d handler=%s", irq, action->name)
> - );
> -
> -/*
> - * Tracepoint for return of an interrupt handler:
> - */
> -TRACE_EVENT(irq_handler_exit,
> -
> - TP_PROTO(int irq, struct irqaction *action, int ret),
> -
> - TP_ARGS(irq, action, ret),
> -
> - TP_STRUCT__entry(
> - __field( int, irq )
> - __field( int, ret )
> - ),
> -
> - TP_fast_assign(
> - __entry->irq = irq;
> - __entry->ret = ret;
> - ),
> -
> - TP_printk("irq=%d return=%s",
> - __entry->irq, __entry->ret ? "handled" : "unhandled")
> -);
> -
> -TRACE_FORMAT(softirq_entry,
> - TP_PROTO(struct softirq_action *h, struct softirq_action *vec),
> - TP_ARGS(h, vec),
> - TP_FMT("softirq=%d action=%s", (int)(h - vec), softirq_to_name[h-vec])
> - );
> -
> -TRACE_FORMAT(softirq_exit,
> - TP_PROTO(struct softirq_action *h, struct softirq_action *vec),
> - TP_ARGS(h, vec),
> - TP_FMT("softirq=%d action=%s", (int)(h - vec), softirq_to_name[h-vec])
> - );
> -
> -#undef TRACE_SYSTEM
> diff --git a/include/trace/kmem.h b/include/trace/kmem.h
> index 46efc24..d7d1218 100644
> --- a/include/trace/kmem.h
> +++ b/include/trace/kmem.h
> @@ -1,9 +1,192 @@
> -#ifndef _TRACE_KMEM_H
> +#if !defined(_TRACE_KMEM_H) || defined(TRACE_HEADER_MULTI_READ)
> #define _TRACE_KMEM_H
>
> #include <linux/types.h>
> #include <linux/tracepoint.h>
>
> -#include <trace/kmem_event_types.h>
> +#undef TRACE_SYSTEM
> +#define TRACE_SYSTEM kmem
>
> -#endif /* _TRACE_KMEM_H */
> +TRACE_EVENT(kmalloc,
> +
> + TP_PROTO(unsigned long call_site,
> + const void *ptr,
> + size_t bytes_req,
> + size_t bytes_alloc,
> + gfp_t gfp_flags),
> +
> + TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags),
> +
> + TP_STRUCT__entry(
> + __field( unsigned long, call_site )
> + __field( const void *, ptr )
> + __field( size_t, bytes_req )
> + __field( size_t, bytes_alloc )
> + __field( gfp_t, gfp_flags )
> + ),
> +
> + TP_fast_assign(
> + __entry->call_site = call_site;
> + __entry->ptr = ptr;
> + __entry->bytes_req = bytes_req;
> + __entry->bytes_alloc = bytes_alloc;
> + __entry->gfp_flags = gfp_flags;
> + ),
> +
> + TP_printk("call_site=%lx ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%08x",
> + __entry->call_site,
> + __entry->ptr,
> + __entry->bytes_req,
> + __entry->bytes_alloc,
> + __entry->gfp_flags)
> +);
> +
> +TRACE_EVENT(kmem_cache_alloc,
> +
> + TP_PROTO(unsigned long call_site,
> + const void *ptr,
> + size_t bytes_req,
> + size_t bytes_alloc,
> + gfp_t gfp_flags),
> +
> + TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags),
> +
> + TP_STRUCT__entry(
> + __field( unsigned long, call_site )
> + __field( const void *, ptr )
> + __field( size_t, bytes_req )
> + __field( size_t, bytes_alloc )
> + __field( gfp_t, gfp_flags )
> + ),
> +
> + TP_fast_assign(
> + __entry->call_site = call_site;
> + __entry->ptr = ptr;
> + __entry->bytes_req = bytes_req;
> + __entry->bytes_alloc = bytes_alloc;
> + __entry->gfp_flags = gfp_flags;
> + ),
> +
> + TP_printk("call_site=%lx ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%08x",
> + __entry->call_site,
> + __entry->ptr,
> + __entry->bytes_req,
> + __entry->bytes_alloc,
> + __entry->gfp_flags)
> +);
> +
> +TRACE_EVENT(kmalloc_node,
> +
> + TP_PROTO(unsigned long call_site,
> + const void *ptr,
> + size_t bytes_req,
> + size_t bytes_alloc,
> + gfp_t gfp_flags,
> + int node),
> +
> + TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags, node),
> +
> + TP_STRUCT__entry(
> + __field( unsigned long, call_site )
> + __field( const void *, ptr )
> + __field( size_t, bytes_req )
> + __field( size_t, bytes_alloc )
> + __field( gfp_t, gfp_flags )
> + __field( int, node )
> + ),
> +
> + TP_fast_assign(
> + __entry->call_site = call_site;
> + __entry->ptr = ptr;
> + __entry->bytes_req = bytes_req;
> + __entry->bytes_alloc = bytes_alloc;
> + __entry->gfp_flags = gfp_flags;
> + __entry->node = node;
> + ),
> +
> + TP_printk("call_site=%lx ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%08x node=%d",
> + __entry->call_site,
> + __entry->ptr,
> + __entry->bytes_req,
> + __entry->bytes_alloc,
> + __entry->gfp_flags,
> + __entry->node)
> +);
> +
> +TRACE_EVENT(kmem_cache_alloc_node,
> +
> + TP_PROTO(unsigned long call_site,
> + const void *ptr,
> + size_t bytes_req,
> + size_t bytes_alloc,
> + gfp_t gfp_flags,
> + int node),
> +
> + TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags, node),
> +
> + TP_STRUCT__entry(
> + __field( unsigned long, call_site )
> + __field( const void *, ptr )
> + __field( size_t, bytes_req )
> + __field( size_t, bytes_alloc )
> + __field( gfp_t, gfp_flags )
> + __field( int, node )
> + ),
> +
> + TP_fast_assign(
> + __entry->call_site = call_site;
> + __entry->ptr = ptr;
> + __entry->bytes_req = bytes_req;
> + __entry->bytes_alloc = bytes_alloc;
> + __entry->gfp_flags = gfp_flags;
> + __entry->node = node;
> + ),
> +
> + TP_printk("call_site=%lx ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%08x node=%d",
> + __entry->call_site,
> + __entry->ptr,
> + __entry->bytes_req,
> + __entry->bytes_alloc,
> + __entry->gfp_flags,
> + __entry->node)
> +);
> +
> +TRACE_EVENT(kfree,
> +
> + TP_PROTO(unsigned long call_site, const void *ptr),
> +
> + TP_ARGS(call_site, ptr),
> +
> + TP_STRUCT__entry(
> + __field( unsigned long, call_site )
> + __field( const void *, ptr )
> + ),
> +
> + TP_fast_assign(
> + __entry->call_site = call_site;
> + __entry->ptr = ptr;
> + ),
> +
> + TP_printk("call_site=%lx ptr=%p", __entry->call_site, __entry->ptr)
> +);
> +
> +TRACE_EVENT(kmem_cache_free,
> +
> + TP_PROTO(unsigned long call_site, const void *ptr),
> +
> + TP_ARGS(call_site, ptr),
> +
> + TP_STRUCT__entry(
> + __field( unsigned long, call_site )
> + __field( const void *, ptr )
> + ),
> +
> + TP_fast_assign(
> + __entry->call_site = call_site;
> + __entry->ptr = ptr;
> + ),
> +
> + TP_printk("call_site=%lx ptr=%p", __entry->call_site, __entry->ptr)
> +);
> +
> +#endif
> diff --git a/include/trace/lockdep.h b/include/trace/lockdep.h
> index 5ca67df..8ee7900 100644
> --- a/include/trace/lockdep.h
> +++ b/include/trace/lockdep.h
> @@ -1,9 +1,57 @@
> -#ifndef _TRACE_LOCKDEP_H
> +#if !defined(_TRACE_LOCKDEP_H) || defined(TRACE_HEADER_MULTI_READ)
> #define _TRACE_LOCKDEP_H
>
> #include <linux/lockdep.h>
> #include <linux/tracepoint.h>
>
> -#include <trace/lockdep_event_types.h>
> +#undef TRACE_SYSTEM
> +#define TRACE_SYSTEM lock
> +
> +#ifdef CONFIG_LOCKDEP
> +
> +TRACE_FORMAT(lock_acquire,
> + TP_PROTO(struct lockdep_map *lock, unsigned int subclass,
> + int trylock, int read, int check,
> + struct lockdep_map *next_lock, unsigned long ip),
> + TP_ARGS(lock, subclass, trylock, read, check, next_lock, ip),
> + TP_FMT("%s%s%s", trylock ? "try " : "",
> + read ? "read " : "", lock->name)
> + );
> +
> +TRACE_FORMAT(lock_release,
> + TP_PROTO(struct lockdep_map *lock, int nested, unsigned long ip),
> + TP_ARGS(lock, nested, ip),
> + TP_FMT("%s", lock->name)
> + );
> +
> +#ifdef CONFIG_LOCK_STAT
> +
> +TRACE_FORMAT(lock_contended,
> + TP_PROTO(struct lockdep_map *lock, unsigned long ip),
> + TP_ARGS(lock, ip),
> + TP_FMT("%s", lock->name)
> + );
> +
> +TRACE_EVENT(lock_acquired,
> + TP_PROTO(struct lockdep_map *lock, unsigned long ip, s64 waittime),
> +
> + TP_ARGS(lock, ip, waittime),
> +
> + TP_STRUCT__entry(
> + __field(const char *, name)
> + __field(unsigned long, wait_usec)
> + __field(unsigned long, wait_nsec_rem)
> + ),
> + TP_fast_assign(
> + __entry->name = lock->name;
> + __entry->wait_nsec_rem = do_div(waittime, NSEC_PER_USEC);
> + __entry->wait_usec = (unsigned long) waittime;
> + ),
> + TP_printk("%s (%lu.%03lu us)", __entry->name, __entry->wait_usec,
> + __entry->wait_nsec_rem)
> +);
>
> #endif
> +#endif
> +
> +#endif /* _TRACE_LOCKDEP_H */
> diff --git a/include/trace/lockdep_event_types.h b/include/trace/lockdep_event_types.h
> deleted file mode 100644
> index 863f1e4..0000000
> --- a/include/trace/lockdep_event_types.h
> +++ /dev/null
> @@ -1,57 +0,0 @@
> -
> -#ifndef TRACE_FORMAT
> -# error Do not include this file directly.
> -# error Unless you know what you are doing.
> -#endif
> -
> -#undef TRACE_SYSTEM
> -#define TRACE_SYSTEM lock
> -
> -#ifdef CONFIG_LOCKDEP
> -
> -TRACE_FORMAT(lock_acquire,
> - TP_PROTO(struct lockdep_map *lock, unsigned int subclass,
> - int trylock, int read, int check,
> - struct lockdep_map *next_lock, unsigned long ip),
> - TP_ARGS(lock, subclass, trylock, read, check, next_lock, ip),
> - TP_FMT("%s%s%s", trylock ? "try " : "",
> - read ? "read " : "", lock->name)
> - );
> -
> -TRACE_FORMAT(lock_release,
> - TP_PROTO(struct lockdep_map *lock, int nested, unsigned long ip),
> - TP_ARGS(lock, nested, ip),
> - TP_FMT("%s", lock->name)
> - );
> -
> -#ifdef CONFIG_LOCK_STAT
> -
> -TRACE_FORMAT(lock_contended,
> - TP_PROTO(struct lockdep_map *lock, unsigned long ip),
> - TP_ARGS(lock, ip),
> - TP_FMT("%s", lock->name)
> - );
> -
> -TRACE_EVENT(lock_acquired,
> - TP_PROTO(struct lockdep_map *lock, unsigned long ip, s64 waittime),
> -
> - TP_ARGS(lock, ip, waittime),
> -
> - TP_STRUCT__entry(
> - __field(const char *, name)
> - __field(unsigned long, wait_usec)
> - __field(unsigned long, wait_nsec_rem)
> - ),
> - TP_fast_assign(
> - __entry->name = lock->name;
> - __entry->wait_nsec_rem = do_div(waittime, NSEC_PER_USEC);
> - __entry->wait_usec = (unsigned long) waittime;
> - ),
> - TP_printk("%s (%lu.%03lu us)", __entry->name, __entry->wait_usec,
> - __entry->wait_nsec_rem)
> -);
> -
> -#endif
> -#endif
> -
> -#undef TRACE_SYSTEM
> diff --git a/include/trace/sched.h b/include/trace/sched.h
> index 4e372a1..5b1cf4a 100644
> --- a/include/trace/sched.h
> +++ b/include/trace/sched.h
> @@ -1,9 +1,336 @@
> -#ifndef _TRACE_SCHED_H
> +#if !defined(_TRACE_SCHED_H) || defined(TRACE_HEADER_MULTI_READ)
> #define _TRACE_SCHED_H
>
> #include <linux/sched.h>
> #include <linux/tracepoint.h>
>
> -#include <trace/sched_event_types.h>
> +#undef TRACE_SYSTEM
> +#define TRACE_SYSTEM sched
>
> -#endif
> +/*
> + * Tracepoint for calling kthread_stop, performed to end a kthread:
> + */
> +TRACE_EVENT(sched_kthread_stop,
> +
> + TP_PROTO(struct task_struct *t),
> +
> + TP_ARGS(t),
> +
> + TP_STRUCT__entry(
> + __array( char, comm, TASK_COMM_LEN )
> + __field( pid_t, pid )
> + ),
> +
> + TP_fast_assign(
> + memcpy(__entry->comm, t->comm, TASK_COMM_LEN);
> + __entry->pid = t->pid;
> + ),
> +
> + TP_printk("task %s:%d", __entry->comm, __entry->pid)
> +);
> +
> +/*
> + * Tracepoint for the return value of the kthread stopping:
> + */
> +TRACE_EVENT(sched_kthread_stop_ret,
> +
> + TP_PROTO(int ret),
> +
> + TP_ARGS(ret),
> +
> + TP_STRUCT__entry(
> + __field( int, ret )
> + ),
> +
> + TP_fast_assign(
> + __entry->ret = ret;
> + ),
> +
> + TP_printk("ret %d", __entry->ret)
> +);
> +
> +/*
> + * Tracepoint for waiting on task to unschedule:
> + *
> + * (NOTE: the 'rq' argument is not used by generic trace events,
> + * but used by the latency tracer plugin. )
> + */
> +TRACE_EVENT(sched_wait_task,
> +
> + TP_PROTO(struct rq *rq, struct task_struct *p),
> +
> + TP_ARGS(rq, p),
> +
> + TP_STRUCT__entry(
> + __array( char, comm, TASK_COMM_LEN )
> + __field( pid_t, pid )
> + __field( int, prio )
> + ),
> +
> + TP_fast_assign(
> + memcpy(__entry->comm, p->comm, TASK_COMM_LEN);
> + __entry->pid = p->pid;
> + __entry->prio = p->prio;
> + ),
> +
> + TP_printk("task %s:%d [%d]",
> + __entry->comm, __entry->pid, __entry->prio)
> +);
> +
> +/*
> + * Tracepoint for waking up a task:
> + *
> + * (NOTE: the 'rq' argument is not used by generic trace events,
> + * but used by the latency tracer plugin. )
> + */
> +TRACE_EVENT(sched_wakeup,
> +
> + TP_PROTO(struct rq *rq, struct task_struct *p, int success),
> +
> + TP_ARGS(rq, p, success),
> +
> + TP_STRUCT__entry(
> + __array( char, comm, TASK_COMM_LEN )
> + __field( pid_t, pid )
> + __field( int, prio )
> + __field( int, success )
> + ),
> +
> + TP_fast_assign(
> + memcpy(__entry->comm, p->comm, TASK_COMM_LEN);
> + __entry->pid = p->pid;
> + __entry->prio = p->prio;
> + __entry->success = success;
> + ),
> +
> + TP_printk("task %s:%d [%d] success=%d",
> + __entry->comm, __entry->pid, __entry->prio,
> + __entry->success)
> +);
> +
> +/*
> + * Tracepoint for waking up a new task:
> + *
> + * (NOTE: the 'rq' argument is not used by generic trace events,
> + * but used by the latency tracer plugin. )
> + */
> +TRACE_EVENT(sched_wakeup_new,
> +
> + TP_PROTO(struct rq *rq, struct task_struct *p, int success),
> +
> + TP_ARGS(rq, p, success),
> +
> + TP_STRUCT__entry(
> + __array( char, comm, TASK_COMM_LEN )
> + __field( pid_t, pid )
> + __field( int, prio )
> + __field( int, success )
> + ),
> +
> + TP_fast_assign(
> + memcpy(__entry->comm, p->comm, TASK_COMM_LEN);
> + __entry->pid = p->pid;
> + __entry->prio = p->prio;
> + __entry->success = success;
> + ),
> +
> + TP_printk("task %s:%d [%d] success=%d",
> + __entry->comm, __entry->pid, __entry->prio,
> + __entry->success)
> +);
> +
> +/*
> + * Tracepoint for task switches, performed by the scheduler:
> + *
> + * (NOTE: the 'rq' argument is not used by generic trace events,
> + * but used by the latency tracer plugin. )
> + */
> +TRACE_EVENT(sched_switch,
> +
> + TP_PROTO(struct rq *rq, struct task_struct *prev,
> + struct task_struct *next),
> +
> + TP_ARGS(rq, prev, next),
> +
> + TP_STRUCT__entry(
> + __array( char, prev_comm, TASK_COMM_LEN )
> + __field( pid_t, prev_pid )
> + __field( int, prev_prio )
> + __array( char, next_comm, TASK_COMM_LEN )
> + __field( pid_t, next_pid )
> + __field( int, next_prio )
> + ),
> +
> + TP_fast_assign(
> + memcpy(__entry->next_comm, next->comm, TASK_COMM_LEN);
> + __entry->prev_pid = prev->pid;
> + __entry->prev_prio = prev->prio;
> + memcpy(__entry->prev_comm, prev->comm, TASK_COMM_LEN);
> + __entry->next_pid = next->pid;
> + __entry->next_prio = next->prio;
> + ),
> +
> + TP_printk("task %s:%d [%d] ==> %s:%d [%d]",
> + __entry->prev_comm, __entry->prev_pid, __entry->prev_prio,
> + __entry->next_comm, __entry->next_pid, __entry->next_prio)
> +);
> +
> +/*
> + * Tracepoint for a task being migrated:
> + */
> +TRACE_EVENT(sched_migrate_task,
> +
> + TP_PROTO(struct task_struct *p, int orig_cpu, int dest_cpu),
> +
> + TP_ARGS(p, orig_cpu, dest_cpu),
> +
> + TP_STRUCT__entry(
> + __array( char, comm, TASK_COMM_LEN )
> + __field( pid_t, pid )
> + __field( int, prio )
> + __field( int, orig_cpu )
> + __field( int, dest_cpu )
> + ),
> +
> + TP_fast_assign(
> + memcpy(__entry->comm, p->comm, TASK_COMM_LEN);
> + __entry->pid = p->pid;
> + __entry->prio = p->prio;
> + __entry->orig_cpu = orig_cpu;
> + __entry->dest_cpu = dest_cpu;
> + ),
> +
> + TP_printk("task %s:%d [%d] from: %d to: %d",
> + __entry->comm, __entry->pid, __entry->prio,
> + __entry->orig_cpu, __entry->dest_cpu)
> +);
> +
> +/*
> + * Tracepoint for freeing a task:
> + */
> +TRACE_EVENT(sched_process_free,
> +
> + TP_PROTO(struct task_struct *p),
> +
> + TP_ARGS(p),
> +
> + TP_STRUCT__entry(
> + __array( char, comm, TASK_COMM_LEN )
> + __field( pid_t, pid )
> + __field( int, prio )
> + ),
> +
> + TP_fast_assign(
> + memcpy(__entry->comm, p->comm, TASK_COMM_LEN);
> + __entry->pid = p->pid;
> + __entry->prio = p->prio;
> + ),
> +
> + TP_printk("task %s:%d [%d]",
> + __entry->comm, __entry->pid, __entry->prio)
> +);
> +
> +/*
> + * Tracepoint for a task exiting:
> + */
> +TRACE_EVENT(sched_process_exit,
> +
> + TP_PROTO(struct task_struct *p),
> +
> + TP_ARGS(p),
> +
> + TP_STRUCT__entry(
> + __array( char, comm, TASK_COMM_LEN )
> + __field( pid_t, pid )
> + __field( int, prio )
> + ),
> +
> + TP_fast_assign(
> + memcpy(__entry->comm, p->comm, TASK_COMM_LEN);
> + __entry->pid = p->pid;
> + __entry->prio = p->prio;
> + ),
> +
> + TP_printk("task %s:%d [%d]",
> + __entry->comm, __entry->pid, __entry->prio)
> +);
> +
> +/*
> + * Tracepoint for a waiting task:
> + */
> +TRACE_EVENT(sched_process_wait,
> +
> + TP_PROTO(struct pid *pid),
> +
> + TP_ARGS(pid),
> +
> + TP_STRUCT__entry(
> + __array( char, comm, TASK_COMM_LEN )
> + __field( pid_t, pid )
> + __field( int, prio )
> + ),
> +
> + TP_fast_assign(
> + memcpy(__entry->comm, current->comm, TASK_COMM_LEN);
> + __entry->pid = pid_nr(pid);
> + __entry->prio = current->prio;
> + ),
> +
> + TP_printk("task %s:%d [%d]",
> + __entry->comm, __entry->pid, __entry->prio)
> +);
> +
> +/*
> + * Tracepoint for do_fork:
> + */
> +TRACE_EVENT(sched_process_fork,
> +
> + TP_PROTO(struct task_struct *parent, struct task_struct *child),
> +
> + TP_ARGS(parent, child),
> +
> + TP_STRUCT__entry(
> + __array( char, parent_comm, TASK_COMM_LEN )
> + __field( pid_t, parent_pid )
> + __array( char, child_comm, TASK_COMM_LEN )
> + __field( pid_t, child_pid )
> + ),
> +
> + TP_fast_assign(
> + memcpy(__entry->parent_comm, parent->comm, TASK_COMM_LEN);
> + __entry->parent_pid = parent->pid;
> + memcpy(__entry->child_comm, child->comm, TASK_COMM_LEN);
> + __entry->child_pid = child->pid;
> + ),
> +
> + TP_printk("parent %s:%d child %s:%d",
> + __entry->parent_comm, __entry->parent_pid,
> + __entry->child_comm, __entry->child_pid)
> +);
> +
> +/*
> + * Tracepoint for sending a signal:
> + */
> +TRACE_EVENT(sched_signal_send,
> +
> + TP_PROTO(int sig, struct task_struct *p),
> +
> + TP_ARGS(sig, p),
> +
> + TP_STRUCT__entry(
> + __field( int, sig )
> + __array( char, comm, TASK_COMM_LEN )
> + __field( pid_t, pid )
> + ),
> +
> + TP_fast_assign(
> + memcpy(__entry->comm, p->comm, TASK_COMM_LEN);
> + __entry->pid = p->pid;
> + __entry->sig = sig;
> + ),
> +
> + TP_printk("sig: %d task %s:%d",
> + __entry->sig, __entry->comm, __entry->pid)
> +);
> +
> +#endif /* _TRACE_SCHED_H */
> diff --git a/include/trace/sched_event_types.h b/include/trace/sched_event_types.h
> deleted file mode 100644
> index 63547dc..0000000
> --- a/include/trace/sched_event_types.h
> +++ /dev/null
> @@ -1,337 +0,0 @@
> -
> -/* use <trace/sched.h> instead */
> -#ifndef TRACE_EVENT
> -# error Do not include this file directly.
> -# error Unless you know what you are doing.
> -#endif
> -
> -#undef TRACE_SYSTEM
> -#define TRACE_SYSTEM sched
> -
> -/*
> - * Tracepoint for calling kthread_stop, performed to end a kthread:
> - */
> -TRACE_EVENT(sched_kthread_stop,
> -
> - TP_PROTO(struct task_struct *t),
> -
> - TP_ARGS(t),
> -
> - TP_STRUCT__entry(
> - __array( char, comm, TASK_COMM_LEN )
> - __field( pid_t, pid )
> - ),
> -
> - TP_fast_assign(
> - memcpy(__entry->comm, t->comm, TASK_COMM_LEN);
> - __entry->pid = t->pid;
> - ),
> -
> - TP_printk("task %s:%d", __entry->comm, __entry->pid)
> -);
> -
> -/*
> - * Tracepoint for the return value of the kthread stopping:
> - */
> -TRACE_EVENT(sched_kthread_stop_ret,
> -
> - TP_PROTO(int ret),
> -
> - TP_ARGS(ret),
> -
> - TP_STRUCT__entry(
> - __field( int, ret )
> - ),
> -
> - TP_fast_assign(
> - __entry->ret = ret;
> - ),
> -
> - TP_printk("ret %d", __entry->ret)
> -);
> -
> -/*
> - * Tracepoint for waiting on task to unschedule:
> - *
> - * (NOTE: the 'rq' argument is not used by generic trace events,
> - * but used by the latency tracer plugin. )
> - */
> -TRACE_EVENT(sched_wait_task,
> -
> - TP_PROTO(struct rq *rq, struct task_struct *p),
> -
> - TP_ARGS(rq, p),
> -
> - TP_STRUCT__entry(
> - __array( char, comm, TASK_COMM_LEN )
> - __field( pid_t, pid )
> - __field( int, prio )
> - ),
> -
> - TP_fast_assign(
> - memcpy(__entry->comm, p->comm, TASK_COMM_LEN);
> - __entry->pid = p->pid;
> - __entry->prio = p->prio;
> - ),
> -
> - TP_printk("task %s:%d [%d]",
> - __entry->comm, __entry->pid, __entry->prio)
> -);
> -
> -/*
> - * Tracepoint for waking up a task:
> - *
> - * (NOTE: the 'rq' argument is not used by generic trace events,
> - * but used by the latency tracer plugin. )
> - */
> -TRACE_EVENT(sched_wakeup,
> -
> - TP_PROTO(struct rq *rq, struct task_struct *p, int success),
> -
> - TP_ARGS(rq, p, success),
> -
> - TP_STRUCT__entry(
> - __array( char, comm, TASK_COMM_LEN )
> - __field( pid_t, pid )
> - __field( int, prio )
> - __field( int, success )
> - ),
> -
> - TP_fast_assign(
> - memcpy(__entry->comm, p->comm, TASK_COMM_LEN);
> - __entry->pid = p->pid;
> - __entry->prio = p->prio;
> - __entry->success = success;
> - ),
> -
> - TP_printk("task %s:%d [%d] success=%d",
> - __entry->comm, __entry->pid, __entry->prio,
> - __entry->success)
> -);
> -
> -/*
> - * Tracepoint for waking up a new task:
> - *
> - * (NOTE: the 'rq' argument is not used by generic trace events,
> - * but used by the latency tracer plugin. )
> - */
> -TRACE_EVENT(sched_wakeup_new,
> -
> - TP_PROTO(struct rq *rq, struct task_struct *p, int success),
> -
> - TP_ARGS(rq, p, success),
> -
> - TP_STRUCT__entry(
> - __array( char, comm, TASK_COMM_LEN )
> - __field( pid_t, pid )
> - __field( int, prio )
> - __field( int, success )
> - ),
> -
> - TP_fast_assign(
> - memcpy(__entry->comm, p->comm, TASK_COMM_LEN);
> - __entry->pid = p->pid;
> - __entry->prio = p->prio;
> - __entry->success = success;
> - ),
> -
> - TP_printk("task %s:%d [%d] success=%d",
> - __entry->comm, __entry->pid, __entry->prio,
> - __entry->success)
> -);
> -
> -/*
> - * Tracepoint for task switches, performed by the scheduler:
> - *
> - * (NOTE: the 'rq' argument is not used by generic trace events,
> - * but used by the latency tracer plugin. )
> - */
> -TRACE_EVENT(sched_switch,
> -
> - TP_PROTO(struct rq *rq, struct task_struct *prev,
> - struct task_struct *next),
> -
> - TP_ARGS(rq, prev, next),
> -
> - TP_STRUCT__entry(
> - __array( char, prev_comm, TASK_COMM_LEN )
> - __field( pid_t, prev_pid )
> - __field( int, prev_prio )
> - __array( char, next_comm, TASK_COMM_LEN )
> - __field( pid_t, next_pid )
> - __field( int, next_prio )
> - ),
> -
> - TP_fast_assign(
> - memcpy(__entry->next_comm, next->comm, TASK_COMM_LEN);
> - __entry->prev_pid = prev->pid;
> - __entry->prev_prio = prev->prio;
> - memcpy(__entry->prev_comm, prev->comm, TASK_COMM_LEN);
> - __entry->next_pid = next->pid;
> - __entry->next_prio = next->prio;
> - ),
> -
> - TP_printk("task %s:%d [%d] ==> %s:%d [%d]",
> - __entry->prev_comm, __entry->prev_pid, __entry->prev_prio,
> - __entry->next_comm, __entry->next_pid, __entry->next_prio)
> -);
> -
> -/*
> - * Tracepoint for a task being migrated:
> - */
> -TRACE_EVENT(sched_migrate_task,
> -
> - TP_PROTO(struct task_struct *p, int orig_cpu, int dest_cpu),
> -
> - TP_ARGS(p, orig_cpu, dest_cpu),
> -
> - TP_STRUCT__entry(
> - __array( char, comm, TASK_COMM_LEN )
> - __field( pid_t, pid )
> - __field( int, prio )
> - __field( int, orig_cpu )
> - __field( int, dest_cpu )
> - ),
> -
> - TP_fast_assign(
> - memcpy(__entry->comm, p->comm, TASK_COMM_LEN);
> - __entry->pid = p->pid;
> - __entry->prio = p->prio;
> - __entry->orig_cpu = orig_cpu;
> - __entry->dest_cpu = dest_cpu;
> - ),
> -
> - TP_printk("task %s:%d [%d] from: %d to: %d",
> - __entry->comm, __entry->pid, __entry->prio,
> - __entry->orig_cpu, __entry->dest_cpu)
> -);
> -
> -/*
> - * Tracepoint for freeing a task:
> - */
> -TRACE_EVENT(sched_process_free,
> -
> - TP_PROTO(struct task_struct *p),
> -
> - TP_ARGS(p),
> -
> - TP_STRUCT__entry(
> - __array( char, comm, TASK_COMM_LEN )
> - __field( pid_t, pid )
> - __field( int, prio )
> - ),
> -
> - TP_fast_assign(
> - memcpy(__entry->comm, p->comm, TASK_COMM_LEN);
> - __entry->pid = p->pid;
> - __entry->prio = p->prio;
> - ),
> -
> - TP_printk("task %s:%d [%d]",
> - __entry->comm, __entry->pid, __entry->prio)
> -);
> -
> -/*
> - * Tracepoint for a task exiting:
> - */
> -TRACE_EVENT(sched_process_exit,
> -
> - TP_PROTO(struct task_struct *p),
> -
> - TP_ARGS(p),
> -
> - TP_STRUCT__entry(
> - __array( char, comm, TASK_COMM_LEN )
> - __field( pid_t, pid )
> - __field( int, prio )
> - ),
> -
> - TP_fast_assign(
> - memcpy(__entry->comm, p->comm, TASK_COMM_LEN);
> - __entry->pid = p->pid;
> - __entry->prio = p->prio;
> - ),
> -
> - TP_printk("task %s:%d [%d]",
> - __entry->comm, __entry->pid, __entry->prio)
> -);
> -
> -/*
> - * Tracepoint for a waiting task:
> - */
> -TRACE_EVENT(sched_process_wait,
> -
> - TP_PROTO(struct pid *pid),
> -
> - TP_ARGS(pid),
> -
> - TP_STRUCT__entry(
> - __array( char, comm, TASK_COMM_LEN )
> - __field( pid_t, pid )
> - __field( int, prio )
> - ),
> -
> - TP_fast_assign(
> - memcpy(__entry->comm, current->comm, TASK_COMM_LEN);
> - __entry->pid = pid_nr(pid);
> - __entry->prio = current->prio;
> - ),
> -
> - TP_printk("task %s:%d [%d]",
> - __entry->comm, __entry->pid, __entry->prio)
> -);
> -
> -/*
> - * Tracepoint for do_fork:
> - */
> -TRACE_EVENT(sched_process_fork,
> -
> - TP_PROTO(struct task_struct *parent, struct task_struct *child),
> -
> - TP_ARGS(parent, child),
> -
> - TP_STRUCT__entry(
> - __array( char, parent_comm, TASK_COMM_LEN )
> - __field( pid_t, parent_pid )
> - __array( char, child_comm, TASK_COMM_LEN )
> - __field( pid_t, child_pid )
> - ),
> -
> - TP_fast_assign(
> - memcpy(__entry->parent_comm, parent->comm, TASK_COMM_LEN);
> - __entry->parent_pid = parent->pid;
> - memcpy(__entry->child_comm, child->comm, TASK_COMM_LEN);
> - __entry->child_pid = child->pid;
> - ),
> -
> - TP_printk("parent %s:%d child %s:%d",
> - __entry->parent_comm, __entry->parent_pid,
> - __entry->child_comm, __entry->child_pid)
> -);
> -
> -/*
> - * Tracepoint for sending a signal:
> - */
> -TRACE_EVENT(sched_signal_send,
> -
> - TP_PROTO(int sig, struct task_struct *p),
> -
> - TP_ARGS(sig, p),
> -
> - TP_STRUCT__entry(
> - __field( int, sig )
> - __array( char, comm, TASK_COMM_LEN )
> - __field( pid_t, pid )
> - ),
> -
> - TP_fast_assign(
> - memcpy(__entry->comm, p->comm, TASK_COMM_LEN);
> - __entry->pid = p->pid;
> - __entry->sig = sig;
> - ),
> -
> - TP_printk("sig: %d task %s:%d",
> - __entry->sig, __entry->comm, __entry->pid)
> -);
> -
> -#undef TRACE_SYSTEM
> diff --git a/include/trace/skb.h b/include/trace/skb.h
> index d2de717..e6fd281 100644
> --- a/include/trace/skb.h
> +++ b/include/trace/skb.h
> @@ -1,9 +1,37 @@
> -#ifndef _TRACE_SKB_H_
> -#define _TRACE_SKB_H_
> +#if !defined(_TRACE_SKB_H) || defined(TRACE_HEADER_MULTI_READ)
> +#define _TRACE_SKB_H
>
> #include <linux/skbuff.h>
> #include <linux/tracepoint.h>
>
> -#include <trace/skb_event_types.h>
> +#undef TRACE_SYSTEM
> +#define TRACE_SYSTEM skb
>
> -#endif
> +/*
> + * Tracepoint for free an sk_buff:
> + */
> +TRACE_EVENT(kfree_skb,
> +
> + TP_PROTO(struct sk_buff *skb, void *location),
> +
> + TP_ARGS(skb, location),
> +
> + TP_STRUCT__entry(
> + __field( void *, skbaddr )
> + __field( unsigned short, protocol )
> + __field( void *, location )
> + ),
> +
> + TP_fast_assign(
> + __entry->skbaddr = skb;
> + if (skb) {
> + __entry->protocol = ntohs(skb->protocol);
> + }
> + __entry->location = location;
> + ),
> +
> + TP_printk("skbaddr=%p protocol=%u location=%p",
> + __entry->skbaddr, __entry->protocol, __entry->location)
> +);
> +
> +#endif /* _TRACE_SKB_H */
> diff --git a/include/trace/skb_event_types.h b/include/trace/skb_event_types.h
> deleted file mode 100644
> index 4a1c504..0000000
> --- a/include/trace/skb_event_types.h
> +++ /dev/null
> @@ -1,38 +0,0 @@
> -
> -/* use <trace/skb.h> instead */
> -#ifndef TRACE_EVENT
> -# error Do not include this file directly.
> -# error Unless you know what you are doing.
> -#endif
> -
> -#undef TRACE_SYSTEM
> -#define TRACE_SYSTEM skb
> -
> -/*
> - * Tracepoint for free an sk_buff:
> - */
> -TRACE_EVENT(kfree_skb,
> -
> - TP_PROTO(struct sk_buff *skb, void *location),
> -
> - TP_ARGS(skb, location),
> -
> - TP_STRUCT__entry(
> - __field( void *, skbaddr )
> - __field( unsigned short, protocol )
> - __field( void *, location )
> - ),
> -
> - TP_fast_assign(
> - __entry->skbaddr = skb;
> - if (skb) {
> - __entry->protocol = ntohs(skb->protocol);
> - }
> - __entry->location = location;
> - ),
> -
> - TP_printk("skbaddr=%p protocol=%u location=%p",
> - __entry->skbaddr, __entry->protocol, __entry->location)
> -);
> -
> -#undef TRACE_SYSTEM
> diff --git a/include/trace/trace_event_types.h b/include/trace/trace_event_types.h
> deleted file mode 100644
> index 552a50e..0000000
> --- a/include/trace/trace_event_types.h
> +++ /dev/null
> @@ -1,7 +0,0 @@
> -/* trace/<type>_event_types.h here */
> -
> -#include <trace/sched_event_types.h>
> -#include <trace/irq_event_types.h>
> -#include <trace/lockdep_event_types.h>
> -#include <trace/skb_event_types.h>
> -#include <trace/kmem_event_types.h>
> diff --git a/kernel/trace/events.c b/kernel/trace/events.c
> index 246f2aa..5a35a91 100644
> --- a/kernel/trace/events.c
> +++ b/kernel/trace/events.c
> @@ -8,6 +8,7 @@
>
> #include "trace_output.h"
>
> +#define TRACE_HEADER_MULTI_READ
> #include "trace_events_stage_1.h"
> #include "trace_events_stage_2.h"
> #include "trace_events_stage_3.h"
> diff --git a/kernel/trace/trace_events_stage_1.h b/kernel/trace/trace_events_stage_1.h
> index 38985f9..475f46a 100644
> --- a/kernel/trace/trace_events_stage_1.h
> +++ b/kernel/trace/trace_events_stage_1.h
> @@ -1,7 +1,7 @@
> /*
> * Stage 1 of the trace events.
> *
> - * Override the macros in <trace/trace_event_types.h> to include the following:
> + * Override the macros in <trace/trace_events.h> to include the following:
> *
> * struct ftrace_raw_<call> {
> * struct trace_entry ent;
> @@ -36,4 +36,4 @@
> }; \
> static struct ftrace_event_call event_##name
>
> -#include <trace/trace_event_types.h>
> +#include <trace/trace_events.h>
> diff --git a/kernel/trace/trace_events_stage_2.h b/kernel/trace/trace_events_stage_2.h
> index 59cfd7d..aa4a67a 100644
> --- a/kernel/trace/trace_events_stage_2.h
> +++ b/kernel/trace/trace_events_stage_2.h
> @@ -1,7 +1,7 @@
> /*
> * Stage 2 of the trace events.
> *
> - * Override the macros in <trace/trace_event_types.h> to include the following:
> + * Override the macros in <trace/trace_events.h> to include the following:
> *
> * enum print_line_t
> * ftrace_raw_output_<call>(struct trace_iterator *iter, int flags)
> @@ -64,7 +64,7 @@ ftrace_raw_output_##call(struct trace_iterator *iter, int flags) \
> return TRACE_TYPE_HANDLED; \
> }
>
> -#include <trace/trace_event_types.h>
> +#include <trace/trace_events.h>
>
> /*
> * Setup the showing format of trace point.
> @@ -128,7 +128,7 @@ ftrace_format_##call(struct trace_seq *s) \
> return ret; \
> }
>
> -#include <trace/trace_event_types.h>
> +#include <trace/trace_events.h>
>
> #undef __field
> #define __field(type, item) \
> @@ -167,4 +167,4 @@ ftrace_define_fields_##call(void) \
> return ret; \
> }
>
> -#include <trace/trace_event_types.h>
> +#include <trace/trace_events.h>
> diff --git a/kernel/trace/trace_events_stage_3.h b/kernel/trace/trace_events_stage_3.h
> index 5bb1b7f..45c04e1 100644
> --- a/kernel/trace/trace_events_stage_3.h
> +++ b/kernel/trace/trace_events_stage_3.h
> @@ -1,7 +1,7 @@
> /*
> * Stage 3 of the trace events.
> *
> - * Override the macros in <trace/trace_event_types.h> to include the following:
> + * Override the macros in <trace/trace_events.h> to include the following:
> *
> * static void ftrace_event_<call>(proto)
> * {
> @@ -272,7 +272,7 @@ __attribute__((section("_ftrace_events"))) event_##call = { \
> _TRACE_PROFILE_INIT(call) \
> }
>
> -#include <trace/trace_event_types.h>
> +#include <trace/trace_events.h>
>
> #undef _TRACE_PROFILE
> #undef _TRACE_PROFILE_INIT
> --
> 1.6.2.1
>
> --
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [PATCH 0/8] [GIT PULL] TRACE_EVENT for modules
2009-04-14 21:48 ` Jeremy Fitzhardinge
@ 2009-04-14 21:55 ` Steven Rostedt
2009-04-14 22:33 ` Jeremy Fitzhardinge
0 siblings, 1 reply; 60+ messages in thread
From: Steven Rostedt @ 2009-04-14 21:55 UTC (permalink / raw)
To: Jeremy Fitzhardinge
Cc: Theodore Tso, linux-kernel, Ingo Molnar, Andrew Morton,
Thomas Gleixner, Peter Zijlstra, Frederic Weisbecker,
Arjan van de Ven, Christoph Hellwig, Mathieu Desnoyers,
Lai Jiangshan, Zhaolei, Li Zefan, KOSAKI Motohiro,
Masami Hiramatsu, Frank Ch. Eigler, Tom Zanussi, Jiaying Zhang,
Michael Rubin, Martin Bligh
On Tue, 14 Apr 2009, Jeremy Fitzhardinge wrote:
> Theodore Tso wrote:
> > Any chance you could support something like this?
> >
> >
>
> I think that's already there. I'm defining
> arch/x86/include/asm/paravirt-trace.h with:
>
> #ifndef _ASM_X86_PARAVIRT_TRACE_H
> #define _ASM_X86_PARAVIRT_TRACE_H
>
> #include <linux/tracepoint.h>
> #include <asm/paravirt_types.h>
>
> #undef TRACE_SYSTEM
> #define TRACE_SYSTEM pvops
>
> #define TRACE_INCLUDE_FILE paravirt-trace
> #define TRACE_INCLUDE_PATH asm
> [...]
>
>
> Which ends up including <asm/paravirt-trace.h>
Not quite. It ends up looking like
#include "asm/paravirt-trace.h"
As long as there is no "asm" directory in the include/trace directory, I
think that is fine.
-- Steve
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [PATCH 0/8] [GIT PULL] TRACE_EVENT for modules
2009-04-14 21:23 ` Steven Rostedt
@ 2009-04-14 21:59 ` Steven Rostedt
0 siblings, 0 replies; 60+ messages in thread
From: Steven Rostedt @ 2009-04-14 21:59 UTC (permalink / raw)
To: Theodore Tso
Cc: linux-kernel, Ingo Molnar, Andrew Morton, Thomas Gleixner,
Peter Zijlstra, Frederic Weisbecker, Arjan van de Ven,
Christoph Hellwig, Mathieu Desnoyers, Jeremy Fitzhardinge,
Lai Jiangshan, Zhaolei, Li Zefan, KOSAKI Motohiro,
Masami Hiramatsu, Frank Ch. Eigler, Tom Zanussi, Jiaying Zhang,
Michael Rubin, Martin Bligh
On Tue, 14 Apr 2009, Steven Rostedt wrote:
>
> Yes, at the bottom of your header file, before including define_trace.h,
> you can simply add:
>
> #undef TRACE_INCLUDE_PATH
> #define TRACE_INCLUDE_PATH ../../fs/ext4
>
> #include <trace/define_trace.h>
>
> the TRACE_INCLUDE_PATH is a reference from where trace/define_trace.h is
> located. It may even be cleaner to do:
>
>
> #undef TRACE_INCLUDE_PATH
> #define TRACE_INCLUDE_PATH EXT4_PATH
>
> and in the Makefile have:
>
> CFLAGS_ext4_jbd2.o := -DEXT4_PATH=$(PWD)
>
> That's something like what I did for my external module test.
Note, you only need to add the CFLAGS for the object that performs the:
#define CREATE_TRACE_POINTS
-- Steve
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [PATCH 0/8] [GIT PULL] TRACE_EVENT for modules
2009-04-14 21:29 ` Frank Ch. Eigler
@ 2009-04-14 22:00 ` Steven Rostedt
2009-04-16 16:53 ` Christoph Hellwig
1 sibling, 0 replies; 60+ messages in thread
From: Steven Rostedt @ 2009-04-14 22:00 UTC (permalink / raw)
To: Frank Ch. Eigler
Cc: Theodore Tso, linux-kernel, Ingo Molnar, Andrew Morton,
Thomas Gleixner, Peter Zijlstra, Frederic Weisbecker,
Arjan van de Ven, Christoph Hellwig, Mathieu Desnoyers,
Jeremy Fitzhardinge, Lai Jiangshan, Zhaolei, Li Zefan,
KOSAKI Motohiro, Masami Hiramatsu, Tom Zanussi, Jiaying Zhang,
Michael Rubin, Martin Bligh
On Tue, 14 Apr 2009, Frank Ch. Eigler wrote:
> Hi -
>
> On Tue, Apr 14, 2009 at 05:04:45PM -0400, Theodore Tso wrote:
> > [...]
> > One thing which I would really like is to avoid needing to drop the
> > header file in include/trace/<subsystem.h>.
> >
> > The problem that I have with this is that for ext4, we need to access
> > private data structures which are defined in header files in
> > fs/ext4/*.h --- which we moved into fs/ext4 a long time ago [...]
>
> If the tracepoints/events expand to code that exposes those private
> structures, then those structures are perhaps not quite so private any
> more. That argues for moving those headers back under include/..., or
> at least those type decls made reachable from the tracepoints.
I think those headers are fine. This must also work when ext4 is a module.
-- Steve
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [PATCH 1/8] tracing: consolidate trace and trace_event headers
2009-04-14 21:51 ` Frederic Weisbecker
@ 2009-04-14 22:04 ` Steven Rostedt
0 siblings, 0 replies; 60+ messages in thread
From: Steven Rostedt @ 2009-04-14 22:04 UTC (permalink / raw)
To: Frederic Weisbecker
Cc: linux-kernel, Ingo Molnar, Andrew Morton, Thomas Gleixner,
Peter Zijlstra, Theodore Tso, Arjan van de Ven, Christoph Hellwig,
Mathieu Desnoyers, Jeremy Fitzhardinge, Lai Jiangshan, Zhaolei,
Li Zefan, KOSAKI Motohiro, Masami Hiramatsu, Frank Ch. Eigler,
Tom Zanussi, Jiaying Zhang, Michael Rubin, Martin Bligh,
Jason Baron, Mathieu Desnoyers
On Tue, 14 Apr 2009, Frederic Weisbecker wrote:
> On Tue, Apr 14, 2009 at 01:23:38PM -0400, Steven Rostedt wrote:
> > From: Steven Rostedt <srostedt@redhat.com>
> >
> > Impact: clean up
> >
> > Neil Horman (et. al.) criticized the way the trace events were broken up
> > into two files. The reason for that was that ftrace needed to separate out
> > the declarations from where the #include <linux/tracepoint.h> was used.
> > It then dawned on me that the tracepoint.h header only needs to define the
> > TRACE_EVENT macro if it is not already defined.
> >
> > The solution is simply to test if TRACE_EVENT is defined, and if it is not
> > then the linux/tracepoint.h header can define it. This change consolidates
> > all the <traces>.h and <traces>_event_types.h into the <traces>.h file.
> >
> > Reported-by: Neil Horman <nhorman@tuxdriver.com>
> > Reported-by: Theodore Tso <tytso@mit.edu>
> > Reported-by: Jiaying Zhang <jiayingz@google.com>
> > Cc: Zhaolei <zhaolei@cn.fujitsu.com>
> > Cc: Frederic Weisbecker <fweisbec@gmail.com>
> > Cc: Peter Zijlstra <peterz@infradead.org>
> > Cc: Jason Baron <jbaron@redhat.com>
> > Cc: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
> > Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
> > ---
> > include/linux/tracepoint.h | 9 +-
> > include/trace/irq.h | 51 +++++-
> > include/trace/irq_event_types.h | 55 ------
> > include/trace/kmem.h | 189 +++++++++++++++++++-
> > include/trace/lockdep.h | 52 +++++-
> > include/trace/lockdep_event_types.h | 57 ------
> > include/trace/sched.h | 333 ++++++++++++++++++++++++++++++++++-
> > include/trace/sched_event_types.h | 337 -----------------------------------
> > include/trace/skb.h | 36 ++++-
> > include/trace/skb_event_types.h | 38 ----
> > include/trace/trace_event_types.h | 7 -
> > kernel/trace/events.c | 1 +
> > kernel/trace/trace_events_stage_1.h | 4 +-
> > kernel/trace/trace_events_stage_2.h | 8 +-
> > kernel/trace/trace_events_stage_3.h | 4 +-
> > 15 files changed, 663 insertions(+), 518 deletions(-)
> > delete mode 100644 include/trace/irq_event_types.h
> > delete mode 100644 include/trace/lockdep_event_types.h
> > delete mode 100644 include/trace/sched_event_types.h
> > delete mode 100644 include/trace/skb_event_types.h
> > delete mode 100644 include/trace/trace_event_types.h
>
>
>
> I don't know if you use git-format-patch without -M or
> something else specific to git pull request. But it looks
> like the renames are not detected here, so it's a bit
> hard to know what have been actually happened or deleted
> in the end result.
>
Hmm, good point. I use git format-patch with no options and then use quilt
to send the emair. I always want the patches to work with quilt, thus I
avoid anything git specific.
My repo is public, so anyone can still look at it and run any git command
they want.
-- Steve
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [PATCH 0/8] [GIT PULL] TRACE_EVENT for modules
2009-04-14 21:55 ` Steven Rostedt
@ 2009-04-14 22:33 ` Jeremy Fitzhardinge
2009-04-15 8:29 ` Ingo Molnar
0 siblings, 1 reply; 60+ messages in thread
From: Jeremy Fitzhardinge @ 2009-04-14 22:33 UTC (permalink / raw)
To: Steven Rostedt
Cc: Theodore Tso, linux-kernel, Ingo Molnar, Andrew Morton,
Thomas Gleixner, Peter Zijlstra, Frederic Weisbecker,
Arjan van de Ven, Christoph Hellwig, Mathieu Desnoyers,
Lai Jiangshan, Zhaolei, Li Zefan, KOSAKI Motohiro,
Masami Hiramatsu, Frank Ch. Eigler, Tom Zanussi, Jiaying Zhang,
Michael Rubin, Martin Bligh, Mathieu Desnoyers
Steven Rostedt wrote:
> On Tue, 14 Apr 2009, Jeremy Fitzhardinge wrote:
>
>
>> Theodore Tso wrote:
>>
>>> Any chance you could support something like this?
>>>
>>>
>>>
>> I think that's already there. I'm defining
>> arch/x86/include/asm/paravirt-trace.h with:
>>
>> #ifndef _ASM_X86_PARAVIRT_TRACE_H
>> #define _ASM_X86_PARAVIRT_TRACE_H
>>
>> #include <linux/tracepoint.h>
>> #include <asm/paravirt_types.h>
>>
>> #undef TRACE_SYSTEM
>> #define TRACE_SYSTEM pvops
>>
>> #define TRACE_INCLUDE_FILE paravirt-trace
>> #define TRACE_INCLUDE_PATH asm
>> [...]
>>
>>
>> Which ends up including <asm/paravirt-trace.h>
>>
>
> Not quite. It ends up looking like
>
> #include "asm/paravirt-trace.h"
>
> As long as there is no "asm" directory in the include/trace directory, I
> think that is fine.
OK.
I'm having a bit of trouble with paravirt-trace.h when I actually
include it in paravirt.h. asm/paravirt.h is itself included in lots of
places, and so its fairly easy to end up with cyclic include
dependencies which are fairly painful. In this case I'm seeing
asm/paravirt.h -> linux/tracepoint.h -> linux/rcupate.h -> {lots of
stuff}, which gives errors like:
CC arch/x86/kernel/asm-offsets.s
In file included from /home/jeremy/git/linux/include/linux/thread_info.h:55,
from /home/jeremy/git/linux/include/linux/preempt.h:9,
from /home/jeremy/git/linux/include/linux/spinlock.h:50,
from /home/jeremy/git/linux/include/linux/rcupdate.h:37,
from /home/jeremy/git/linux/include/linux/tracepoint.h:18,
from /home/jeremy/git/linux/arch/x86/include/asm/paravirt-trace.h:4,
from /home/jeremy/git/linux/arch/x86/include/asm/paravirt.h:18,
from /home/jeremy/git/linux/arch/x86/include/asm/irqflags.h:55,
from /home/jeremy/git/linux/include/linux/irqflags.h:57,
from /home/jeremy/git/linux/arch/x86/include/asm/system.h:11,
from /home/jeremy/git/linux/arch/x86/include/asm/processor.h:17,
from /home/jeremy/git/linux/include/linux/prefetch.h:14,
from /home/jeremy/git/linux/include/linux/list.h:6,
from /home/jeremy/git/linux/include/linux/module.h:9,
from /home/jeremy/git/linux/include/linux/crypto.h:21,
from /home/jeremy/git/linux/arch/x86/kernel/asm-offsets_64.c:7,
from /home/jeremy/git/linux/arch/x86/kernel/asm-offsets.c:4:
/home/jeremy/git/linux/arch/x86/include/asm/thread_info.h:34: error: expected specifier-qualifier-list before 'mm_segment_t'
I'm wondering if there's much downside in making the code __DO_TRACE()
out of line so that we can make tracepoint.h have absolutely minimal
include dependencies?
J
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [PATCH 2/8] tracing: create automated trace defines
2009-04-14 17:23 ` [PATCH 2/8] tracing: create automated trace defines Steven Rostedt
@ 2009-04-14 23:44 ` Jeremy Fitzhardinge
2009-04-15 1:45 ` Mathieu Desnoyers
2009-04-15 7:04 ` Zhaolei
1 sibling, 1 reply; 60+ messages in thread
From: Jeremy Fitzhardinge @ 2009-04-14 23:44 UTC (permalink / raw)
To: Steven Rostedt
Cc: linux-kernel, Ingo Molnar, Andrew Morton, Thomas Gleixner,
Peter Zijlstra, Frederic Weisbecker, Theodore Tso,
Arjan van de Ven, Christoph Hellwig, Mathieu Desnoyers,
Lai Jiangshan, Zhaolei, Li Zefan, KOSAKI Motohiro,
Masami Hiramatsu, Frank Ch. Eigler, Tom Zanussi, Jiaying Zhang,
Michael Rubin, Martin Bligh, Peter Zijlstra, Neil Horman,
Eduard - Gabriel Munteanu, Pekka Enberg
How about something like this:
>From f7fa71c046bc383706bf58503c4b75e05e252152 Mon Sep 17 00:00:00 2001
From: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Date: Tue, 14 Apr 2009 16:41:18 -0700
Subject: [PATCH] tracing: move __DO_TRACE out of line
Mainly simplify linux/tracepoint.h's include dependencies (removes
rcupdate.h), but it can't help with icache locality, since it
definitely moves the code out of line, rather than relying on gcc
to do it.
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h
index 4353f3f..1052e33 100644
--- a/include/linux/tracepoint.h
+++ b/include/linux/tracepoint.h
@@ -15,7 +15,6 @@
*/
#include <linux/types.h>
-#include <linux/rcupdate.h>
struct module;
struct tracepoint;
@@ -42,19 +41,20 @@ struct tracepoint {
* it_func[0] is never NULL because there is at least one element in the array
* when the array itself is non NULL.
*/
-#define __DO_TRACE(tp, proto, args) \
- do { \
+#define DEFINE_DO_TRACE(name, proto, args) \
+ void __do_trace_##name(struct tracepoint *tp, TP_PROTO(proto)) \
+ { \
void **it_func; \
\
rcu_read_lock_sched_notrace(); \
- it_func = rcu_dereference((tp)->funcs); \
+ it_func = rcu_dereference(tp->funcs); \
if (it_func) { \
do { \
((void(*)(proto))(*it_func))(args); \
} while (*(++it_func)); \
} \
rcu_read_unlock_sched_notrace(); \
- } while (0)
+ }
/*
* Make sure the alignment of the structure in the __tracepoints section will
@@ -63,11 +63,13 @@ struct tracepoint {
*/
#define DECLARE_TRACE(name, proto, args) \
extern struct tracepoint __tracepoint_##name; \
+ extern void __do_trace_##name(struct tracepoint *tp, \
+ TP_PROTO(proto)); \
static inline void trace_##name(proto) \
{ \
if (unlikely(__tracepoint_##name.state)) \
- __DO_TRACE(&__tracepoint_##name, \
- TP_PROTO(proto), TP_ARGS(args)); \
+ __do_trace_##name(&__tracepoint_##name, \
+ TP_ARGS(args)); \
} \
static inline int register_trace_##name(void (*probe)(proto)) \
{ \
@@ -151,10 +153,7 @@ extern int tracepoint_get_iter_range(struct tracepoint **tracepoint,
* probe unregistration and the end of module exit to make sure there is no
* caller executing a probe when it is freed.
*/
-static inline void tracepoint_synchronize_unregister(void)
-{
- synchronize_sched();
-}
+extern void tracepoint_synchronize_unregister(void);
#define PARAMS(args...) args
diff --git a/include/trace/define_trace.h b/include/trace/define_trace.h
index 980eb66..1a0502e 100644
--- a/include/trace/define_trace.h
+++ b/include/trace/define_trace.h
@@ -24,14 +24,17 @@
#undef TRACE_EVENT
#define TRACE_EVENT(name, proto, args, tstruct, assign, print) \
+ DEFINE_DO_TRACE(name, TP_PROTO(proto), TP_ARGS(args)) \
DEFINE_TRACE(name)
#undef TRACE_FORMAT
-#define TRACE_FORMAT(name, proto, args, print) \
+#define TRACE_FORMAT(name, proto, args, print) \
+ DEFINE_DO_TRACE(name, TP_PROTO(proto), TP_ARGS(args)) \
DEFINE_TRACE(name)
#undef DECLARE_TRACE
-#define DECLARE_TRACE(name, proto, args) \
+#define DECLARE_TRACE(name, proto, args) \
+ DEFINE_DO_TRACE(name, TP_PROTO(proto), TP_ARGS(args)) \
DEFINE_TRACE(name)
#undef TRACE_INCLUDE
diff --git a/kernel/tracepoint.c b/kernel/tracepoint.c
index 1ef5d3a..6ac1f48 100644
--- a/kernel/tracepoint.c
+++ b/kernel/tracepoint.c
@@ -545,6 +545,12 @@ void tracepoint_iter_reset(struct tracepoint_iter *iter)
}
EXPORT_SYMBOL_GPL(tracepoint_iter_reset);
+void tracepoint_synchronize_unregister(void)
+{
+ synchronize_sched();
+}
+EXPORT_SYMBOL_GPL(tracepoint_synchronize_unregister);
+
#ifdef CONFIG_MODULES
int tracepoint_module_notify(struct notifier_block *self,
^ permalink raw reply related [flat|nested] 60+ messages in thread
* Re: [PATCH 2/8] tracing: create automated trace defines
2009-04-14 23:44 ` Jeremy Fitzhardinge
@ 2009-04-15 1:45 ` Mathieu Desnoyers
2009-04-15 16:07 ` Jeremy Fitzhardinge
0 siblings, 1 reply; 60+ messages in thread
From: Mathieu Desnoyers @ 2009-04-15 1:45 UTC (permalink / raw)
To: Jeremy Fitzhardinge
Cc: Steven Rostedt, linux-kernel, Ingo Molnar, Andrew Morton,
Thomas Gleixner, Peter Zijlstra, Frederic Weisbecker,
Theodore Tso, Arjan van de Ven, Christoph Hellwig, Lai Jiangshan,
Zhaolei, Li Zefan, KOSAKI Motohiro, Masami Hiramatsu,
Frank Ch. Eigler, Tom Zanussi, Jiaying Zhang, Michael Rubin,
Martin Bligh, Peter Zijlstra, Neil Horman,
Eduard - Gabriel Munteanu, Pekka Enberg
* Jeremy Fitzhardinge (jeremy@goop.org) wrote:
> How about something like this:
>
> From f7fa71c046bc383706bf58503c4b75e05e252152 Mon Sep 17 00:00:00 2001
> From: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
> Date: Tue, 14 Apr 2009 16:41:18 -0700
> Subject: [PATCH] tracing: move __DO_TRACE out of line
>
> Mainly simplify linux/tracepoint.h's include dependencies (removes
> rcupdate.h), but it can't help with icache locality, since it
> definitely moves the code out of line, rather than relying on gcc
> to do it.
>
> Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
>
> diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h
> index 4353f3f..1052e33 100644
> --- a/include/linux/tracepoint.h
> +++ b/include/linux/tracepoint.h
> @@ -15,7 +15,6 @@
> */
>
> #include <linux/types.h>
> -#include <linux/rcupdate.h>
>
> struct module;
> struct tracepoint;
> @@ -42,19 +41,20 @@ struct tracepoint {
> * it_func[0] is never NULL because there is at least one element in the array
> * when the array itself is non NULL.
> */
> -#define __DO_TRACE(tp, proto, args) \
> - do { \
> +#define DEFINE_DO_TRACE(name, proto, args) \
> + void __do_trace_##name(struct tracepoint *tp, TP_PROTO(proto)) \
I fear that won't work with "void" prototype. If we need this kind of
flexibility, we will need to create a special case for empty prototype.
Mathieu
> + { \
> void **it_func; \
> \
> rcu_read_lock_sched_notrace(); \
> - it_func = rcu_dereference((tp)->funcs); \
> + it_func = rcu_dereference(tp->funcs); \
> if (it_func) { \
> do { \
> ((void(*)(proto))(*it_func))(args); \
> } while (*(++it_func)); \
> } \
> rcu_read_unlock_sched_notrace(); \
> - } while (0)
> + }
>
> /*
> * Make sure the alignment of the structure in the __tracepoints section will
> @@ -63,11 +63,13 @@ struct tracepoint {
> */
> #define DECLARE_TRACE(name, proto, args) \
> extern struct tracepoint __tracepoint_##name; \
> + extern void __do_trace_##name(struct tracepoint *tp, \
> + TP_PROTO(proto)); \
> static inline void trace_##name(proto) \
> { \
> if (unlikely(__tracepoint_##name.state)) \
> - __DO_TRACE(&__tracepoint_##name, \
> - TP_PROTO(proto), TP_ARGS(args)); \
> + __do_trace_##name(&__tracepoint_##name, \
> + TP_ARGS(args)); \
> } \
> static inline int register_trace_##name(void (*probe)(proto)) \
> { \
> @@ -151,10 +153,7 @@ extern int tracepoint_get_iter_range(struct tracepoint **tracepoint,
> * probe unregistration and the end of module exit to make sure there is no
> * caller executing a probe when it is freed.
> */
> -static inline void tracepoint_synchronize_unregister(void)
> -{
> - synchronize_sched();
> -}
> +extern void tracepoint_synchronize_unregister(void);
>
> #define PARAMS(args...) args
>
> diff --git a/include/trace/define_trace.h b/include/trace/define_trace.h
> index 980eb66..1a0502e 100644
> --- a/include/trace/define_trace.h
> +++ b/include/trace/define_trace.h
> @@ -24,14 +24,17 @@
>
> #undef TRACE_EVENT
> #define TRACE_EVENT(name, proto, args, tstruct, assign, print) \
> + DEFINE_DO_TRACE(name, TP_PROTO(proto), TP_ARGS(args)) \
> DEFINE_TRACE(name)
>
> #undef TRACE_FORMAT
> -#define TRACE_FORMAT(name, proto, args, print) \
> +#define TRACE_FORMAT(name, proto, args, print) \
> + DEFINE_DO_TRACE(name, TP_PROTO(proto), TP_ARGS(args)) \
> DEFINE_TRACE(name)
>
> #undef DECLARE_TRACE
> -#define DECLARE_TRACE(name, proto, args) \
> +#define DECLARE_TRACE(name, proto, args) \
> + DEFINE_DO_TRACE(name, TP_PROTO(proto), TP_ARGS(args)) \
> DEFINE_TRACE(name)
>
> #undef TRACE_INCLUDE
> diff --git a/kernel/tracepoint.c b/kernel/tracepoint.c
> index 1ef5d3a..6ac1f48 100644
> --- a/kernel/tracepoint.c
> +++ b/kernel/tracepoint.c
> @@ -545,6 +545,12 @@ void tracepoint_iter_reset(struct tracepoint_iter *iter)
> }
> EXPORT_SYMBOL_GPL(tracepoint_iter_reset);
>
> +void tracepoint_synchronize_unregister(void)
> +{
> + synchronize_sched();
> +}
> +EXPORT_SYMBOL_GPL(tracepoint_synchronize_unregister);
> +
> #ifdef CONFIG_MODULES
>
> int tracepoint_module_notify(struct notifier_block *self,
>
>
--
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [PATCH 3/8] tracing: make trace_seq operations available for core kernel
2009-04-14 19:12 ` Peter Zijlstra
@ 2009-04-15 2:19 ` Steven Rostedt
0 siblings, 0 replies; 60+ messages in thread
From: Steven Rostedt @ 2009-04-15 2:19 UTC (permalink / raw)
To: Peter Zijlstra
Cc: linux-kernel, Ingo Molnar, Andrew Morton, Thomas Gleixner,
Frederic Weisbecker, Theodore Tso, Arjan van de Ven,
Christoph Hellwig, Mathieu Desnoyers, Jeremy Fitzhardinge,
Lai Jiangshan, Zhaolei, Li Zefan, KOSAKI Motohiro,
Masami Hiramatsu, Frank Ch. Eigler, Tom Zanussi, Jiaying Zhang,
Michael Rubin, Martin Bligh
On Tue, 14 Apr 2009, Peter Zijlstra wrote:
> On Tue, 2009-04-14 at 13:23 -0400, Steven Rostedt wrote:
> > +struct trace_seq {
> > + unsigned char buffer[PAGE_SIZE];
> > + unsigned int len;
> > + unsigned int readpos;
> > +};
>
> Would not PAGE_SIZE-2*sizeof(int) be enough? That would make the struct
> fit into a single page and avoid an order-1 allocation.
That may be an option. I've even thought about doing that before. Not sure
why I did not. But we could give it a try.
-- Steve
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [PATCH 5/8] tracing/events: move the ftrace event tracing code to core
2009-04-14 19:23 ` Peter Zijlstra
@ 2009-04-15 2:25 ` Steven Rostedt
2009-04-15 3:40 ` Jiaying Zhang
0 siblings, 1 reply; 60+ messages in thread
From: Steven Rostedt @ 2009-04-15 2:25 UTC (permalink / raw)
To: Peter Zijlstra
Cc: linux-kernel, Ingo Molnar, Andrew Morton, Thomas Gleixner,
Frederic Weisbecker, Theodore Tso, Arjan van de Ven,
Christoph Hellwig, Mathieu Desnoyers, Jeremy Fitzhardinge,
Lai Jiangshan, Zhaolei, Li Zefan, KOSAKI Motohiro,
Masami Hiramatsu, Frank Ch. Eigler, Tom Zanussi, Jiaying Zhang,
Michael Rubin, Martin Bligh
On Tue, 14 Apr 2009, Peter Zijlstra wrote:
> On Tue, 2009-04-14 at 13:23 -0400, Steven Rostedt wrote:
> > + * static struct trace_event ftrace_event_type_<call> = {
> > + * .trace = ftrace_raw_output_<call>, <-- stage 2
> > + * };
>
> > + * static struct ftrace_event_call __used
> > + * __attribute__((__aligned__(4)))
> > + * __attribute__((section("_ftrace_events"))) event_<call> = {
> > + * .name = "<call>",
> > + * .system = "<system>",
> > + * .raw_init = ftrace_raw_init_event_<call>,
> > + * .regfunc = ftrace_reg_event_<call>,
> > + * .unregfunc = ftrace_unreg_event_<call>,
> > + * .show_format = ftrace_format_<call>,
> > + * }
>
> Is there a good reason these are two different structs?
>
> I've always wondered about that, it seems natural to unify them and to
> generalize the reverse lookup hash that is now private to trace_output.
>
> The trace_event_profile code could use that reverse lookup, that linear
> search it currently does it really lame.
Hmm, I'll have to look at that. Of course that means touching these crazy
macros again ;-)
-- Steve
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [PATCH 8/8] tracing/events: add support for modules to TRACE_EVENT
2009-04-14 17:23 ` [PATCH 8/8] tracing/events: add support for modules to TRACE_EVENT Steven Rostedt
@ 2009-04-15 3:22 ` Rusty Russell
0 siblings, 0 replies; 60+ messages in thread
From: Rusty Russell @ 2009-04-15 3:22 UTC (permalink / raw)
To: Steven Rostedt
Cc: linux-kernel, Ingo Molnar, Andrew Morton, Thomas Gleixner,
Peter Zijlstra, Frederic Weisbecker, Theodore Tso,
Arjan van de Ven, Christoph Hellwig, Mathieu Desnoyers,
Jeremy Fitzhardinge, Lai Jiangshan, Zhaolei, Li Zefan,
KOSAKI Motohiro, Masami Hiramatsu, Frank Ch. Eigler, Tom Zanussi,
Jiaying Zhang, Michael Rubin, Martin Bligh
On Wed, 15 Apr 2009 02:53:45 am Steven Rostedt wrote:
> From: Steven Rostedt <srostedt@redhat.com>
>
> Impact: allow modules to add TRACE_EVENTS on load
Acked-by: Rusty Russell <rusty@rustcorp.com.au> (module parts)
Thanks!
Rusty.
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [PATCH 5/8] tracing/events: move the ftrace event tracing code to core
2009-04-15 2:25 ` Steven Rostedt
@ 2009-04-15 3:40 ` Jiaying Zhang
0 siblings, 0 replies; 60+ messages in thread
From: Jiaying Zhang @ 2009-04-15 3:40 UTC (permalink / raw)
To: Steven Rostedt
Cc: Peter Zijlstra, linux-kernel, Ingo Molnar, Andrew Morton,
Thomas Gleixner, Frederic Weisbecker, Theodore Tso,
Arjan van de Ven, Christoph Hellwig, Mathieu Desnoyers,
Jeremy Fitzhardinge, Lai Jiangshan, Zhaolei, Li Zefan,
KOSAKI Motohiro, Masami Hiramatsu, Frank Ch. Eigler, Tom Zanussi,
Michael Rubin, Martin Bligh
I think merging these structures together can also allow you to move
certain parts of code to the general functions in kernel/trace/trace_events.c
so you don't need to define those functions for individual events.
Jiaying
On Tue, Apr 14, 2009 at 7:25 PM, Steven Rostedt <rostedt@goodmis.org> wrote:
>
> On Tue, 14 Apr 2009, Peter Zijlstra wrote:
>
>> On Tue, 2009-04-14 at 13:23 -0400, Steven Rostedt wrote:
>> > + * static struct trace_event ftrace_event_type_<call> = {
>> > + * .trace = ftrace_raw_output_<call>, <-- stage 2
>> > + * };
>>
>> > + * static struct ftrace_event_call __used
>> > + * __attribute__((__aligned__(4)))
>> > + * __attribute__((section("_ftrace_events"))) event_<call> = {
>> > + * .name = "<call>",
>> > + * .system = "<system>",
>> > + * .raw_init = ftrace_raw_init_event_<call>,
>> > + * .regfunc = ftrace_reg_event_<call>,
>> > + * .unregfunc = ftrace_unreg_event_<call>,
>> > + * .show_format = ftrace_format_<call>,
>> > + * }
>>
>> Is there a good reason these are two different structs?
>>
>> I've always wondered about that, it seems natural to unify them and to
>> generalize the reverse lookup hash that is now private to trace_output.
>>
>> The trace_event_profile code could use that reverse lookup, that linear
>> search it currently does it really lame.
>
> Hmm, I'll have to look at that. Of course that means touching these crazy
> macros again ;-)
>
> -- Steve
>
>
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [PATCH 2/8] tracing: create automated trace defines
2009-04-14 17:23 ` [PATCH 2/8] tracing: create automated trace defines Steven Rostedt
2009-04-14 23:44 ` Jeremy Fitzhardinge
@ 2009-04-15 7:04 ` Zhaolei
1 sibling, 0 replies; 60+ messages in thread
From: Zhaolei @ 2009-04-15 7:04 UTC (permalink / raw)
To: Steven Rostedt
Cc: linux-kernel, Ingo Molnar, Andrew Morton, Thomas Gleixner,
Peter Zijlstra, Frederic Weisbecker, Theodore Tso,
Arjan van de Ven, Christoph Hellwig, Mathieu Desnoyers,
Jeremy Fitzhardinge, Lai Jiangshan, Li Zefan, KOSAKI Motohiro,
Masami Hiramatsu, Frank Ch. Eigler, Tom Zanussi, Jiaying Zhang,
Michael Rubin, Martin Bligh, Peter Zijlstra, Neil Horman,
Eduard - Gabriel Munteanu, Pekka Enberg
Steven Rostedt wrote:
> From: Steven Rostedt <srostedt@redhat.com>
>
> This patch lowers the number of places a developer must modify to add
> new tracepoints. The current method to add a new tracepoint
> into an existing system is to write the trace point macro in the
> trace header with one of the macros TRACE_EVENT, TRACE_FORMAT or
> DECLARE_TRACE, then they must add the same named item into the C file
> with the macro DEFINE_TRACE(name) and then add the trace point.
>
> This change cuts out the needing to add the DEFINE_TRACE(name).
> Every file that uses the tracepoint must still include the trace/<type>.h
> file, but the one C file must also add a define before the including
> of that file.
>
> #define CREATE_TRACE_POINTS
> #include <trace/mytrace.h>
>
> This will cause the trace/mytrace.h file to also produce the C code
> necessary to implement the trace point.
>
> Note, if more than one trace/<type>.h is used to create the C code
> it is best to list them all together.
>
> #define CREATE_TRACE_POINTS
> #include <trace/foo.h>
> #include <trace/bar.h>
> #include <trace/fido.h>
>
> Thanks to Mathieu Desnoyers and Christoph Hellwig for coming up with
> the cleaner solution of the define above the includes over my first
> design to have the C code include a "special" header.
>
> This patch converts sched, irq and lockdep and skb to use this new
> method.
>
> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Neil Horman <nhorman@tuxdriver.com>
> Cc: Zhao Lei <zhaolei@cn.fujitsu.com>
> Cc: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
> Cc: Pekka Enberg <penberg@cs.helsinki.fi>
> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
> ---
> include/trace/define_trace.h | 75 ++++++++++++++++++++++++++++++++++++++++++
> include/trace/irq.h | 5 ++-
> include/trace/kmem.h | 4 ++-
> include/trace/lockdep.h | 3 ++
> include/trace/sched.h | 3 ++
> include/trace/skb.h | 3 ++
> kernel/exit.c | 4 --
> kernel/fork.c | 2 -
> kernel/irq/handle.c | 7 ++--
> kernel/kthread.c | 3 --
> kernel/lockdep.c | 12 ++-----
> kernel/sched.c | 10 ++----
> kernel/signal.c | 2 -
> kernel/softirq.c | 3 --
> mm/util.c | 11 ++----
> net/core/net-traces.c | 4 +-
> 16 files changed, 105 insertions(+), 46 deletions(-)
> create mode 100644 include/trace/define_trace.h
>
> diff --git a/include/trace/define_trace.h b/include/trace/define_trace.h
> new file mode 100644
> index 0000000..de9dc7d
> --- /dev/null
> +++ b/include/trace/define_trace.h
> @@ -0,0 +1,75 @@
> +/*
> + * Trace files that want to automate creationg of all tracepoints defined
> + * in their file should include this file. The following are macros that the
> + * trace file may define:
> + *
> + * TRACE_SYSTEM defines the system the tracepoint is for
> + *
> + * TRACE_INCLUDE_FILE if the file name is something other than TRACE_SYSTEM.h
> + * This macro may be defined to tell define_trace.h what file to include.
> + * Note, leave off the ".h".
> + *
> + * TRACE_INCLUDE_PATH if the path is something other than core kernel include/trace
> + * then this macro can define the path to use. Note, the path is relative to
> + * define_trace.h, not the file including it. Full path names for out of tree
> + * modules must be used.
> + */
> +
> +#ifdef CREATE_TRACE_POINTS
> +
> +/* Prevent recursion */
> +#undef CREATE_TRACE_POINTS
> +
> +#include <linux/stringify.h>
> +
> +#undef TRACE_EVENT
> +#define TRACE_EVENT(name, proto, args, tstruct, assign, print) \
> + DEFINE_TRACE(name)
> +
> +#undef TRACE_FORMAT
> +#define TRACE_FORMAT(name, proto, args, print) \
> + DEFINE_TRACE(name)
> +
> +#undef DECLARE_TRACE
> +#define DECLARE_TRACE(name, proto, args) \
> + DEFINE_TRACE(name)
> +
> +#undef TRACE_INCLUDE
> +#undef __TRACE_INCLUDE
> +
> +#ifndef TRACE_INCLUDE_FILE
> +# define TRACE_INCLUDE_FILE TRACE_SYSTEM
> +# define UNDEF_TRACE_INCLUDE_FILE
> +#endif
> +
> +#ifndef TRACE_INCLUDE_PATH
> +# define __TRACE_INCLUDE(system) <trace/system.h>
> +# define UNDEF_TRACE_INCLUDE_FILE
> +#else
> +# define __TRACE_INCLUDE(system) __stringify(TRACE_INCLUDE_PATH/system.h)
> +#endif
> +
> +# define TRACE_INCLUDE(system) __TRACE_INCLUDE(system)
> +
> +/* Let the trace headers be reread */
> +#define TRACE_HEADER_MULTI_READ
> +
> +#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
Hello, Steven
Include header file again is a power trap full of imagination.
It is great... but maybe we can choose a stupid way if we have.
And, TRACE_SYSTEM must be same as header file name if we use
current way.
How about just
#define TRACE_EVENT(name, proto, args, fmt) \
DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) \
DEFINE_TRACE(name)
in tracepoint.h?
It means we always define both whether for tracepoint provider or for
tracepoint user.(and make compiler a bit slow)
Thanks
Zhaolei
> +
> +#undef TRACE_HEADER_MULTI_READ
> +
> +/* Only undef what we defined in this file */
> +#ifdef UNDEF_TRACE_INCLUDE_FILE
> +# undef TRACE_INCLUDE_PATH
> +# undef UNDEF_TRACE_INCLUDE_FILE
> +#endif
> +
> +#ifdef UNDEF_TRACE_INCLUDE_FILE
> +# undef TRACE_INCLUDE_PATH
> +# undef UNDEF_TRACE_INCLUDE_FILE
> +#endif
> +
> +/* We may be processing more files */
> +#define CREATE_TRACE_POINTS
> +
> +#endif /* CREATE_TRACE_POINTS */
> diff --git a/include/trace/irq.h b/include/trace/irq.h
> index 04ab4c6..75e3468 100644
> --- a/include/trace/irq.h
> +++ b/include/trace/irq.h
> @@ -51,4 +51,7 @@ TRACE_FORMAT(softirq_exit,
> TP_FMT("softirq=%d action=%s", (int)(h - vec), softirq_to_name[h-vec])
> );
>
> -#endif
> +#endif /* _TRACE_IRQ_H */
> +
> +/* This part must be outside protection */
> +#include <trace/define_trace.h>
> diff --git a/include/trace/kmem.h b/include/trace/kmem.h
> index d7d1218..c22c42f 100644
> --- a/include/trace/kmem.h
> +++ b/include/trace/kmem.h
> @@ -188,5 +188,7 @@ TRACE_EVENT(kmem_cache_free,
>
> TP_printk("call_site=%lx ptr=%p", __entry->call_site, __entry->ptr)
> );
> +#endif /* _TRACE_KMEM_H */
>
> -#endif
> +/* This part must be outside protection */
> +#include <trace/define_trace.h>
> diff --git a/include/trace/lockdep.h b/include/trace/lockdep.h
> index 8ee7900..4d301e7 100644
> --- a/include/trace/lockdep.h
> +++ b/include/trace/lockdep.h
> @@ -55,3 +55,6 @@ TRACE_EVENT(lock_acquired,
> #endif
>
> #endif /* _TRACE_LOCKDEP_H */
> +
> +/* This part must be outside protection */
> +#include <trace/define_trace.h>
> diff --git a/include/trace/sched.h b/include/trace/sched.h
> index 5b1cf4a..ffa1cab 100644
> --- a/include/trace/sched.h
> +++ b/include/trace/sched.h
> @@ -334,3 +334,6 @@ TRACE_EVENT(sched_signal_send,
> );
>
> #endif /* _TRACE_SCHED_H */
> +
> +/* This part must be outside protection */
> +#include <trace/define_trace.h>
> diff --git a/include/trace/skb.h b/include/trace/skb.h
> index e6fd281..1e8fabb 100644
> --- a/include/trace/skb.h
> +++ b/include/trace/skb.h
> @@ -35,3 +35,6 @@ TRACE_EVENT(kfree_skb,
> );
>
> #endif /* _TRACE_SKB_H */
> +
> +/* This part must be outside protection */
> +#include <trace/define_trace.h>
> diff --git a/kernel/exit.c b/kernel/exit.c
> index abf9cf3..2fe9d2c 100644
> --- a/kernel/exit.c
> +++ b/kernel/exit.c
> @@ -56,10 +56,6 @@
> #include <asm/mmu_context.h>
> #include "cred-internals.h"
>
> -DEFINE_TRACE(sched_process_free);
> -DEFINE_TRACE(sched_process_exit);
> -DEFINE_TRACE(sched_process_wait);
> -
> static void exit_mm(struct task_struct * tsk);
>
> static void __unhash_process(struct task_struct *p)
> diff --git a/kernel/fork.c b/kernel/fork.c
> index b9e2edd..4bebf26 100644
> --- a/kernel/fork.c
> +++ b/kernel/fork.c
> @@ -83,8 +83,6 @@ DEFINE_PER_CPU(unsigned long, process_counts) = 0;
>
> __cacheline_aligned DEFINE_RWLOCK(tasklist_lock); /* outer */
>
> -DEFINE_TRACE(sched_process_fork);
> -
> int nr_processes(void)
> {
> int cpu;
> diff --git a/kernel/irq/handle.c b/kernel/irq/handle.c
> index d82142b..983d8be 100644
> --- a/kernel/irq/handle.c
> +++ b/kernel/irq/handle.c
> @@ -17,9 +17,11 @@
> #include <linux/kernel_stat.h>
> #include <linux/rculist.h>
> #include <linux/hash.h>
> -#include <trace/irq.h>
> #include <linux/bootmem.h>
>
> +#define CREATE_TRACE_POINTS
> +#include <trace/irq.h>
> +
> #include "internals.h"
>
> /*
> @@ -348,9 +350,6 @@ static void warn_no_thread(unsigned int irq, struct irqaction *action)
> "but no thread function available.", irq, action->name);
> }
>
> -DEFINE_TRACE(irq_handler_entry);
> -DEFINE_TRACE(irq_handler_exit);
> -
> /**
> * handle_IRQ_event - irq action chain handler
> * @irq: the interrupt number
> diff --git a/kernel/kthread.c b/kernel/kthread.c
> index 4ebaf85..e1c7692 100644
> --- a/kernel/kthread.c
> +++ b/kernel/kthread.c
> @@ -21,9 +21,6 @@ static DEFINE_SPINLOCK(kthread_create_lock);
> static LIST_HEAD(kthread_create_list);
> struct task_struct *kthreadd_task;
>
> -DEFINE_TRACE(sched_kthread_stop);
> -DEFINE_TRACE(sched_kthread_stop_ret);
> -
> struct kthread_create_info
> {
> /* Information passed to kthread() from kthreadd. */
> diff --git a/kernel/lockdep.c b/kernel/lockdep.c
> index c4582a6..257f21a 100644
> --- a/kernel/lockdep.c
> +++ b/kernel/lockdep.c
> @@ -42,12 +42,14 @@
> #include <linux/hash.h>
> #include <linux/ftrace.h>
> #include <linux/stringify.h>
> -#include <trace/lockdep.h>
>
> #include <asm/sections.h>
>
> #include "lockdep_internals.h"
>
> +#define CREATE_TRACE_POINTS
> +#include <trace/lockdep.h>
> +
> #ifdef CONFIG_PROVE_LOCKING
> int prove_locking = 1;
> module_param(prove_locking, int, 0644);
> @@ -2929,8 +2931,6 @@ void lock_set_class(struct lockdep_map *lock, const char *name,
> }
> EXPORT_SYMBOL_GPL(lock_set_class);
>
> -DEFINE_TRACE(lock_acquire);
> -
> /*
> * We are not always called with irqs disabled - do that here,
> * and also avoid lockdep recursion:
> @@ -2957,8 +2957,6 @@ void lock_acquire(struct lockdep_map *lock, unsigned int subclass,
> }
> EXPORT_SYMBOL_GPL(lock_acquire);
>
> -DEFINE_TRACE(lock_release);
> -
> void lock_release(struct lockdep_map *lock, int nested,
> unsigned long ip)
> {
> @@ -3061,8 +3059,6 @@ found_it:
> put_lock_stats(stats);
> }
>
> -DEFINE_TRACE(lock_acquired);
> -
> static void
> __lock_acquired(struct lockdep_map *lock, unsigned long ip)
> {
> @@ -3118,8 +3114,6 @@ found_it:
> lock->ip = ip;
> }
>
> -DEFINE_TRACE(lock_contended);
> -
> void lock_contended(struct lockdep_map *lock, unsigned long ip)
> {
> unsigned long flags;
> diff --git a/kernel/sched.c b/kernel/sched.c
> index 5724508..e6d4518 100644
> --- a/kernel/sched.c
> +++ b/kernel/sched.c
> @@ -72,13 +72,15 @@
> #include <linux/debugfs.h>
> #include <linux/ctype.h>
> #include <linux/ftrace.h>
> -#include <trace/sched.h>
>
> #include <asm/tlb.h>
> #include <asm/irq_regs.h>
>
> #include "sched_cpupri.h"
>
> +#define CREATE_TRACE_POINTS
> +#include <trace/sched.h>
> +
> /*
> * Convert user-nice values [ -20 ... 0 ... 19 ]
> * to static priority [ MAX_RT_PRIO..MAX_PRIO-1 ],
> @@ -118,12 +120,6 @@
> */
> #define RUNTIME_INF ((u64)~0ULL)
>
> -DEFINE_TRACE(sched_wait_task);
> -DEFINE_TRACE(sched_wakeup);
> -DEFINE_TRACE(sched_wakeup_new);
> -DEFINE_TRACE(sched_switch);
> -DEFINE_TRACE(sched_migrate_task);
> -
> #ifdef CONFIG_SMP
>
> static void double_rq_lock(struct rq *rq1, struct rq *rq2);
> diff --git a/kernel/signal.c b/kernel/signal.c
> index d803473..1d5703f 100644
> --- a/kernel/signal.c
> +++ b/kernel/signal.c
> @@ -41,8 +41,6 @@
>
> static struct kmem_cache *sigqueue_cachep;
>
> -DEFINE_TRACE(sched_signal_send);
> -
> static void __user *sig_handler(struct task_struct *t, int sig)
> {
> return t->sighand->action[sig - 1].sa.sa_handler;
> diff --git a/kernel/softirq.c b/kernel/softirq.c
> index 2fecefa..a2d9b45 100644
> --- a/kernel/softirq.c
> +++ b/kernel/softirq.c
> @@ -186,9 +186,6 @@ EXPORT_SYMBOL(local_bh_enable_ip);
> */
> #define MAX_SOFTIRQ_RESTART 10
>
> -DEFINE_TRACE(softirq_entry);
> -DEFINE_TRACE(softirq_exit);
> -
> asmlinkage void __do_softirq(void)
> {
> struct softirq_action *h;
> diff --git a/mm/util.c b/mm/util.c
> index 2599e83..0e74a22 100644
> --- a/mm/util.c
> +++ b/mm/util.c
> @@ -4,9 +4,11 @@
> #include <linux/module.h>
> #include <linux/err.h>
> #include <linux/sched.h>
> -#include <linux/tracepoint.h>
> #include <asm/uaccess.h>
>
> +#define CREATE_TRACE_POINTS
> +#include <trace/kmem.h>
> +
> /**
> * kstrdup - allocate space for and copy an existing string
> * @s: the string to duplicate
> @@ -239,13 +241,6 @@ int __attribute__((weak)) get_user_pages_fast(unsigned long start,
> EXPORT_SYMBOL_GPL(get_user_pages_fast);
>
> /* Tracepoints definitions. */
> -DEFINE_TRACE(kmalloc);
> -DEFINE_TRACE(kmem_cache_alloc);
> -DEFINE_TRACE(kmalloc_node);
> -DEFINE_TRACE(kmem_cache_alloc_node);
> -DEFINE_TRACE(kfree);
> -DEFINE_TRACE(kmem_cache_free);
> -
> EXPORT_TRACEPOINT_SYMBOL(kmalloc);
> EXPORT_TRACEPOINT_SYMBOL(kmem_cache_alloc);
> EXPORT_TRACEPOINT_SYMBOL(kmalloc_node);
> diff --git a/net/core/net-traces.c b/net/core/net-traces.c
> index c8fb456..8017720 100644
> --- a/net/core/net-traces.c
> +++ b/net/core/net-traces.c
> @@ -19,11 +19,11 @@
> #include <linux/workqueue.h>
> #include <linux/netlink.h>
> #include <linux/net_dropmon.h>
> -#include <trace/skb.h>
>
> #include <asm/unaligned.h>
> #include <asm/bitops.h>
>
> +#define CREATE_TRACE_POINTS
> +#include <trace/skb.h>
>
> -DEFINE_TRACE(kfree_skb);
> EXPORT_TRACEPOINT_SYMBOL_GPL(kfree_skb);
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [PATCH 0/8] [GIT PULL] TRACE_EVENT for modules
2009-04-14 22:33 ` Jeremy Fitzhardinge
@ 2009-04-15 8:29 ` Ingo Molnar
2009-04-16 2:29 ` Mathieu Desnoyers
0 siblings, 1 reply; 60+ messages in thread
From: Ingo Molnar @ 2009-04-15 8:29 UTC (permalink / raw)
To: Jeremy Fitzhardinge
Cc: Steven Rostedt, Theodore Tso, linux-kernel, Andrew Morton,
Thomas Gleixner, Peter Zijlstra, Frederic Weisbecker,
Arjan van de Ven, Christoph Hellwig, Mathieu Desnoyers,
Lai Jiangshan, Zhaolei, Li Zefan, KOSAKI Motohiro,
Masami Hiramatsu, Frank Ch. Eigler, Tom Zanussi, Jiaying Zhang,
Michael Rubin, Martin Bligh, Mathieu Desnoyers
* Jeremy Fitzhardinge <jeremy@goop.org> wrote:
> Steven Rostedt wrote:
>> On Tue, 14 Apr 2009, Jeremy Fitzhardinge wrote:
>>
>>
>>> Theodore Tso wrote:
>>>
>>>> Any chance you could support something like this?
>>>>
>>>>
>>> I think that's already there. I'm defining
>>> arch/x86/include/asm/paravirt-trace.h with:
>>>
>>> #ifndef _ASM_X86_PARAVIRT_TRACE_H
>>> #define _ASM_X86_PARAVIRT_TRACE_H
>>>
>>> #include <linux/tracepoint.h>
>>> #include <asm/paravirt_types.h>
>>>
>>> #undef TRACE_SYSTEM
>>> #define TRACE_SYSTEM pvops
>>>
>>> #define TRACE_INCLUDE_FILE paravirt-trace
>>> #define TRACE_INCLUDE_PATH asm
>>> [...]
>>>
>>>
>>> Which ends up including <asm/paravirt-trace.h>
>>>
>>
>> Not quite. It ends up looking like
>>
>> #include "asm/paravirt-trace.h"
>>
>> As long as there is no "asm" directory in the include/trace directory,
>> I think that is fine.
>
> OK.
>
> I'm having a bit of trouble with paravirt-trace.h when I actually
> include it in paravirt.h. asm/paravirt.h is itself included in
> lots of places, and so its fairly easy to end up with cyclic
> include dependencies which are fairly painful. In this case I'm
> seeing asm/paravirt.h -> linux/tracepoint.h -> linux/rcupate.h ->
> {lots of stuff}, which gives errors like:
tracepoint.h should not include any complex headers like rcupdate.h.
> I'm wondering if there's much downside in making the code
> __DO_TRACE() out of line so that we can make tracepoint.h have
> absolutely minimal include dependencies?
yeah.
And besides, the rcu_read_lock_sched_notrace() there should probably
be a preempt_disable_notrace() / preempt_enable_notrace() variant.
(it's sligtly faster that way and we better be atomic and
self-sufficient in tracepoints anyway)
Ingo
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [PATCH 2/8] tracing: create automated trace defines
2009-04-15 1:45 ` Mathieu Desnoyers
@ 2009-04-15 16:07 ` Jeremy Fitzhardinge
2009-04-16 2:34 ` Mathieu Desnoyers
0 siblings, 1 reply; 60+ messages in thread
From: Jeremy Fitzhardinge @ 2009-04-15 16:07 UTC (permalink / raw)
To: Mathieu Desnoyers
Cc: Steven Rostedt, linux-kernel, Ingo Molnar, Andrew Morton,
Thomas Gleixner, Peter Zijlstra, Frederic Weisbecker,
Theodore Tso, Arjan van de Ven, Christoph Hellwig, Lai Jiangshan,
Zhaolei, Li Zefan, KOSAKI Motohiro, Masami Hiramatsu,
Frank Ch. Eigler, Tom Zanussi, Jiaying Zhang, Michael Rubin,
Martin Bligh, Peter Zijlstra, Neil Horman,
Eduard - Gabriel Munteanu, Pekka Enberg
Mathieu Desnoyers wrote:
> * Jeremy Fitzhardinge (jeremy@goop.org) wrote:
>> -#define __DO_TRACE(tp, proto, args) \
>> - do { \
>> +#define DEFINE_DO_TRACE(name, proto, args) \
>> + void __do_trace_##name(struct tracepoint *tp, TP_PROTO(proto)) \
>>
>
> I fear that won't work with "void" prototype. If we need this kind of
> flexibility, we will need to create a special case for empty prototype.
>
Yes, that has been a bit awkward. I couldn't find a way to create a
no-param tracepoint, and so ended up passing a dummy arg. Stupid C syntax.
On the other hand, I can get something that actually compiles this way...
J
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [PATCH 0/8] [GIT PULL] TRACE_EVENT for modules
2009-04-15 8:29 ` Ingo Molnar
@ 2009-04-16 2:29 ` Mathieu Desnoyers
0 siblings, 0 replies; 60+ messages in thread
From: Mathieu Desnoyers @ 2009-04-16 2:29 UTC (permalink / raw)
To: Ingo Molnar, Paul E. McKenney
Cc: Jeremy Fitzhardinge, Steven Rostedt, Theodore Tso, linux-kernel,
Andrew Morton, Thomas Gleixner, Peter Zijlstra,
Frederic Weisbecker, Arjan van de Ven, Christoph Hellwig,
Lai Jiangshan, Zhaolei, Li Zefan, KOSAKI Motohiro,
Masami Hiramatsu, Frank Ch. Eigler, Tom Zanussi, Jiaying Zhang,
Michael Rubin, Martin Bligh
* Ingo Molnar (mingo@elte.hu) wrote:
>
> * Jeremy Fitzhardinge <jeremy@goop.org> wrote:
>
> > Steven Rostedt wrote:
> >> On Tue, 14 Apr 2009, Jeremy Fitzhardinge wrote:
> >>
> >>
> >>> Theodore Tso wrote:
> >>>
> >>>> Any chance you could support something like this?
> >>>>
> >>>>
> >>> I think that's already there. I'm defining
> >>> arch/x86/include/asm/paravirt-trace.h with:
> >>>
> >>> #ifndef _ASM_X86_PARAVIRT_TRACE_H
> >>> #define _ASM_X86_PARAVIRT_TRACE_H
> >>>
> >>> #include <linux/tracepoint.h>
> >>> #include <asm/paravirt_types.h>
> >>>
> >>> #undef TRACE_SYSTEM
> >>> #define TRACE_SYSTEM pvops
> >>>
> >>> #define TRACE_INCLUDE_FILE paravirt-trace
> >>> #define TRACE_INCLUDE_PATH asm
> >>> [...]
> >>>
> >>>
> >>> Which ends up including <asm/paravirt-trace.h>
> >>>
> >>
> >> Not quite. It ends up looking like
> >>
> >> #include "asm/paravirt-trace.h"
> >>
> >> As long as there is no "asm" directory in the include/trace directory,
> >> I think that is fine.
> >
> > OK.
> >
> > I'm having a bit of trouble with paravirt-trace.h when I actually
> > include it in paravirt.h. asm/paravirt.h is itself included in
> > lots of places, and so its fairly easy to end up with cyclic
> > include dependencies which are fairly painful. In this case I'm
> > seeing asm/paravirt.h -> linux/tracepoint.h -> linux/rcupate.h ->
> > {lots of stuff}, which gives errors like:
>
> tracepoint.h should not include any complex headers like rcupdate.h.
>
> > I'm wondering if there's much downside in making the code
> > __DO_TRACE() out of line so that we can make tracepoint.h have
> > absolutely minimal include dependencies?
>
> yeah.
>
> And besides, the rcu_read_lock_sched_notrace() there should probably
> be a preempt_disable_notrace() / preempt_enable_notrace() variant.
> (it's sligtly faster that way and we better be atomic and
> self-sufficient in tracepoints anyway)
>
Yes, rcu_read_(un)lock_sched_notrace maps directly to
preempt_(en/dis)able_notrace. But for RCU verifiability's sake, I made
sure to create rcu_read_lock versions of these primitives instead of
simply using preempt_disable. Maybe we should simply take those
low-level primitives out of rcupdate.h and put them in a simpler header?
Mathieu
> Ingo
>
--
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [PATCH 2/8] tracing: create automated trace defines
2009-04-15 16:07 ` Jeremy Fitzhardinge
@ 2009-04-16 2:34 ` Mathieu Desnoyers
2009-04-16 2:56 ` Jeremy Fitzhardinge
0 siblings, 1 reply; 60+ messages in thread
From: Mathieu Desnoyers @ 2009-04-16 2:34 UTC (permalink / raw)
To: Jeremy Fitzhardinge
Cc: Steven Rostedt, linux-kernel, Ingo Molnar, Andrew Morton,
Thomas Gleixner, Peter Zijlstra, Frederic Weisbecker,
Theodore Tso, Arjan van de Ven, Christoph Hellwig, Lai Jiangshan,
Zhaolei, Li Zefan, KOSAKI Motohiro, Masami Hiramatsu,
Frank Ch. Eigler, Tom Zanussi, Jiaying Zhang, Michael Rubin,
Martin Bligh, Peter Zijlstra, Neil Horman,
Eduard - Gabriel Munteanu, Pekka Enberg
* Jeremy Fitzhardinge (jeremy@goop.org) wrote:
> Mathieu Desnoyers wrote:
>> * Jeremy Fitzhardinge (jeremy@goop.org) wrote:
>>> -#define __DO_TRACE(tp, proto, args) \
>>> - do { \
>>> +#define DEFINE_DO_TRACE(name, proto, args) \
>>> + void __do_trace_##name(struct tracepoint *tp, TP_PROTO(proto)) \
>>>
>>
>> I fear that won't work with "void" prototype. If we need this kind of
>> flexibility, we will need to create a special case for empty prototype.
>>
>
> Yes, that has been a bit awkward. I couldn't find a way to create a
> no-param tracepoint, and so ended up passing a dummy arg. Stupid C
> syntax.
>
> On the other hand, I can get something that actually compiles this way...
>
> J
Is your only problem the fact that tracepoints include rcupdate.h ? This
can easily be solved by moving rcu_read_(un)lock_sched_notrace to a
rcu-update-<insert meaningful name here> and include this header in
rcupdate.h and tracepoint.h.
We could keep the indirection layer you proposed for synchronize_sched()
though, even if it adds an unnecessary function call. It's a slow path
anyway.
If by doing these modifications we succeed in keeping the "void"
parameters working _and_ make your stuff to compile, I think we would
have done something great. :-)
Mathieu
--
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [PATCH 2/8] tracing: create automated trace defines
2009-04-16 2:34 ` Mathieu Desnoyers
@ 2009-04-16 2:56 ` Jeremy Fitzhardinge
2009-04-16 23:44 ` Mathieu Desnoyers
0 siblings, 1 reply; 60+ messages in thread
From: Jeremy Fitzhardinge @ 2009-04-16 2:56 UTC (permalink / raw)
To: Mathieu Desnoyers
Cc: Steven Rostedt, linux-kernel, Ingo Molnar, Andrew Morton,
Thomas Gleixner, Peter Zijlstra, Frederic Weisbecker,
Theodore Tso, Arjan van de Ven, Christoph Hellwig, Lai Jiangshan,
Zhaolei, Li Zefan, KOSAKI Motohiro, Masami Hiramatsu,
Frank Ch. Eigler, Tom Zanussi, Jiaying Zhang, Michael Rubin,
Martin Bligh, Peter Zijlstra, Neil Horman,
Eduard - Gabriel Munteanu, Pekka Enberg
Mathieu Desnoyers wrote:
> Is your only problem the fact that tracepoints include rcupdate.h ?
No. That was the first roadblock, which caused massive cyclic
dependencies between includes and consequent failure to define
everything required. I solved that by pushing __DO_TRACE out of line.
Everything since then is a separate issue.
> This
> can easily be solved by moving rcu_read_(un)lock_sched_notrace to a
> rcu-update-<insert meaningful name here> and include this header in
> rcupdate.h and tracepoint.h.
>
I suppose, but I think pushing __do_trace_##name out of line is cleaner
anyway. And I think it's very important that tracepoint.h have a
*absolutely minimal* #include set, so that it can be safely included in
as many contexts as possible. asm/paravirt.h is complex enough as it
is, and I really don't want tracepoint bringing in any extra headers at
all. linux/types.h is about the only acceptable one.
> If by doing these modifications we succeed in keeping the "void"
> parameters working _and_ make your stuff to compile, I think we would
> have done something great. :-)
>
The void issue is irritating, but relatively minor compared to the
rest. If everything else gets solved except for the need to pass a
dummy param to no-arg tracepoints, then I think it'll be a generally
useful facility.
J
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [PATCH 0/8] [GIT PULL] TRACE_EVENT for modules
2009-04-14 21:04 ` Theodore Tso
` (2 preceding siblings ...)
2009-04-14 21:48 ` Jeremy Fitzhardinge
@ 2009-04-16 16:52 ` Christoph Hellwig
3 siblings, 0 replies; 60+ messages in thread
From: Christoph Hellwig @ 2009-04-16 16:52 UTC (permalink / raw)
To: Theodore Tso, Steven Rostedt, linux-kernel, Ingo Molnar,
Andrew Morton, Thomas Gleixner, Peter Zijlstra,
Frederic Weisbecker, Arjan van de Ven, Christoph Hellwig,
Mathieu Desnoyers, Jeremy Fitzhardinge, Lai Jiangshan, Zhaolei,
Li Zefan, KOSAKI Motohiro, Masami Hiramatsu, Frank Ch. Eigler,
Tom Zanussi, Jiaying Zhang, Michael Rubin, Martin Bligh
On Tue, Apr 14, 2009 at 05:04:45PM -0400, Theodore Tso wrote:
> One thing which I would really like is to avoid needing to drop the
> header file in include/trace/<subsystem.h>.
>
> The problem that I have with this is that for ext4, we need to access
> private data structures which are defined in header files in
> fs/ext4/*.h --- which we moved into fs/ext4 a long time ago at the
> request of those who felt include/linux/* was getting rather
> cluttered, and if a subsystem had header files which were only needed
> by files for that particular subsystems, they should be moved out of
> include/linux.
Same is true for XFS, or just about any other self-contained in a module
subsystem I can think of. My current XFS trace events stuff includes
tons of headers in the xfs header in include/trace and adds -Ifs/xfs to
kernel/trace/Makefile. The latter should be gone by the new
implementation compiling the tracing stubs into the module, but it's
still not pretty.
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [PATCH 0/8] [GIT PULL] TRACE_EVENT for modules
2009-04-14 21:29 ` Frank Ch. Eigler
2009-04-14 22:00 ` Steven Rostedt
@ 2009-04-16 16:53 ` Christoph Hellwig
1 sibling, 0 replies; 60+ messages in thread
From: Christoph Hellwig @ 2009-04-16 16:53 UTC (permalink / raw)
To: Frank Ch. Eigler
Cc: Theodore Tso, Steven Rostedt, linux-kernel, Ingo Molnar,
Andrew Morton, Thomas Gleixner, Peter Zijlstra,
Frederic Weisbecker, Arjan van de Ven, Christoph Hellwig,
Mathieu Desnoyers, Jeremy Fitzhardinge, Lai Jiangshan, Zhaolei,
Li Zefan, KOSAKI Motohiro, Masami Hiramatsu, Tom Zanussi,
Jiaying Zhang, Michael Rubin, Martin Bligh
On Tue, Apr 14, 2009 at 05:29:17PM -0400, Frank Ch. Eigler wrote:
> Hi -
>
> On Tue, Apr 14, 2009 at 05:04:45PM -0400, Theodore Tso wrote:
> > [...]
> > One thing which I would really like is to avoid needing to drop the
> > header file in include/trace/<subsystem.h>.
> >
> > The problem that I have with this is that for ext4, we need to access
> > private data structures which are defined in header files in
> > fs/ext4/*.h --- which we moved into fs/ext4 a long time ago [...]
>
> If the tracepoints/events expand to code that exposes those private
> structures, then those structures are perhaps not quite so private any
> more. That argues for moving those headers back under include/..., or
> at least those type decls made reachable from the tracepoints.
They expose them to the TRACE_EVENT output format, which then
pretty-prints them. They are still as private to the module as it gets.
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [PATCH 2/8] tracing: create automated trace defines
2009-04-16 2:56 ` Jeremy Fitzhardinge
@ 2009-04-16 23:44 ` Mathieu Desnoyers
2009-04-17 0:03 ` Jeremy Fitzhardinge
2009-04-20 7:12 ` [PATCH 2/8] tracing: create automated trace defines Andi Kleen
0 siblings, 2 replies; 60+ messages in thread
From: Mathieu Desnoyers @ 2009-04-16 23:44 UTC (permalink / raw)
To: Jeremy Fitzhardinge
Cc: Steven Rostedt, linux-kernel, Ingo Molnar, Andrew Morton,
Thomas Gleixner, Peter Zijlstra, Frederic Weisbecker,
Theodore Tso, Arjan van de Ven, Christoph Hellwig, Lai Jiangshan,
Zhaolei, Li Zefan, KOSAKI Motohiro, Masami Hiramatsu,
Frank Ch. Eigler, Tom Zanussi, Jiaying Zhang, Michael Rubin,
Martin Bligh, Peter Zijlstra, Neil Horman,
Eduard - Gabriel Munteanu, Pekka Enberg
* Jeremy Fitzhardinge (jeremy@goop.org) wrote:
> Mathieu Desnoyers wrote:
>> Is your only problem the fact that tracepoints include rcupdate.h ?
>
> No. That was the first roadblock, which caused massive cyclic
> dependencies between includes and consequent failure to define
> everything required. I solved that by pushing __DO_TRACE out of line.
> Everything since then is a separate issue.
>
>> This
>> can easily be solved by moving rcu_read_(un)lock_sched_notrace to a
>> rcu-update-<insert meaningful name here> and include this header in
>> rcupdate.h and tracepoint.h.
>>
> I suppose, but I think pushing __do_trace_##name out of line is cleaner
> anyway. And I think it's very important that tracepoint.h have a
> *absolutely minimal* #include set, so that it can be safely included in
> as many contexts as possible. asm/paravirt.h is complex enough as it
> is, and I really don't want tracepoint bringing in any extra headers at
> all. linux/types.h is about the only acceptable one.
>
>> If by doing these modifications we succeed in keeping the "void"
>> parameters working _and_ make your stuff to compile, I think we would
>> have done something great. :-)
>>
>
> The void issue is irritating, but relatively minor compared to the rest.
> If everything else gets solved except for the need to pass a dummy param
> to no-arg tracepoints, then I think it'll be a generally useful facility.
>
The other point I dislike about the out-of-line approach is that the
tracer will suffer from a pointless supplementary function call at each
event. Given how slow function calls are, at least on x86, I'd prefer
leaving the handler call chain inline, unless there is a very strong
reason not to do so.
I'll come up with a patch that leaves the tracepoint inline, but fixes
the header dependency.
Mathieu
> J
>
--
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [PATCH 2/8] tracing: create automated trace defines
2009-04-16 23:44 ` Mathieu Desnoyers
@ 2009-04-17 0:03 ` Jeremy Fitzhardinge
2009-04-17 0:13 ` Mathieu Desnoyers
2009-04-20 7:12 ` [PATCH 2/8] tracing: create automated trace defines Andi Kleen
1 sibling, 1 reply; 60+ messages in thread
From: Jeremy Fitzhardinge @ 2009-04-17 0:03 UTC (permalink / raw)
To: Mathieu Desnoyers
Cc: Steven Rostedt, linux-kernel, Ingo Molnar, Andrew Morton,
Thomas Gleixner, Peter Zijlstra, Frederic Weisbecker,
Theodore Tso, Arjan van de Ven, Christoph Hellwig, Lai Jiangshan,
Zhaolei, Li Zefan, KOSAKI Motohiro, Masami Hiramatsu,
Frank Ch. Eigler, Tom Zanussi, Jiaying Zhang, Michael Rubin,
Martin Bligh, Peter Zijlstra, Neil Horman,
Eduard - Gabriel Munteanu, Pekka Enberg
Mathieu Desnoyers wrote:
> The other point I dislike about the out-of-line approach is that the
> tracer will suffer from a pointless supplementary function call at each
> event. Given how slow function calls are, at least on x86, I'd prefer
> leaving the handler call chain inline, unless there is a very strong
> reason not to do so.
>
Are they? They're generally considered to be "free", because the call
and return are predicted 100% accurately.
> I'll come up with a patch that leaves the tracepoint inline, but fixes
> the header dependency.
>
OK.
J
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [PATCH 2/8] tracing: create automated trace defines
2009-04-17 0:03 ` Jeremy Fitzhardinge
@ 2009-04-17 0:13 ` Mathieu Desnoyers
2009-04-17 0:18 ` Jeremy Fitzhardinge
0 siblings, 1 reply; 60+ messages in thread
From: Mathieu Desnoyers @ 2009-04-17 0:13 UTC (permalink / raw)
To: Jeremy Fitzhardinge
Cc: Steven Rostedt, linux-kernel, Ingo Molnar, Andrew Morton,
Thomas Gleixner, Peter Zijlstra, Frederic Weisbecker,
Theodore Tso, Arjan van de Ven, Christoph Hellwig, Lai Jiangshan,
Zhaolei, Li Zefan, KOSAKI Motohiro, Masami Hiramatsu,
Frank Ch. Eigler, Tom Zanussi, Jiaying Zhang, Michael Rubin,
Martin Bligh, Peter Zijlstra, Neil Horman,
Eduard - Gabriel Munteanu, Pekka Enberg
* Jeremy Fitzhardinge (jeremy@goop.org) wrote:
> Mathieu Desnoyers wrote:
>> The other point I dislike about the out-of-line approach is that the
>> tracer will suffer from a pointless supplementary function call at each
>> event. Given how slow function calls are, at least on x86, I'd prefer
>> leaving the handler call chain inline, unless there is a very strong
>> reason not to do so.
>>
>
> Are they? They're generally considered to be "free", because the call
> and return are predicted 100% accurately.
>
Adding a simple function call within the tracer fast path, in LTTng, has
a very measurable performance impact on the tbench workload. This is why
I don't use any function call-based trace clocks in LTTng, but rather my
own inline trace clock.
Mathieu
>> I'll come up with a patch that leaves the tracepoint inline, but fixes
>> the header dependency.
>>
> OK.
>
> J
>
--
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [PATCH 2/8] tracing: create automated trace defines
2009-04-17 0:13 ` Mathieu Desnoyers
@ 2009-04-17 0:18 ` Jeremy Fitzhardinge
2009-04-17 0:28 ` Mathieu Desnoyers
0 siblings, 1 reply; 60+ messages in thread
From: Jeremy Fitzhardinge @ 2009-04-17 0:18 UTC (permalink / raw)
To: Mathieu Desnoyers
Cc: Steven Rostedt, linux-kernel, Ingo Molnar, Andrew Morton,
Thomas Gleixner, Peter Zijlstra, Frederic Weisbecker,
Theodore Tso, Arjan van de Ven, Christoph Hellwig, Lai Jiangshan,
Zhaolei, Li Zefan, KOSAKI Motohiro, Masami Hiramatsu,
Frank Ch. Eigler, Tom Zanussi, Jiaying Zhang, Michael Rubin,
Martin Bligh, Peter Zijlstra, Neil Horman,
Eduard - Gabriel Munteanu, Pekka Enberg
Mathieu Desnoyers wrote:
>> Are they? They're generally considered to be "free", because the call
>> and return are predicted 100% accurately.
>>
>>
>
> Adding a simple function call within the tracer fast path, in LTTng, has
> a very measurable performance impact on the tbench workload. This is why
> I don't use any function call-based trace clocks in LTTng, but rather my
> own inline trace clock.
I'm a bit concerned about all the code that tracing puts inline though.
It seems it would put quite a lot of icache overhead on the codepath
when the tracepoint is disabled, not least because its duplicated in
every instance of the tracepoint. And if the compiler decides to put
the unlikely() branch code out of line, then that's the same as making
it a function call (except that if it is a function call, all the
tracepoints will share the same code, and get a higher likelihood of
getting icache hits).
J
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [PATCH 2/8] tracing: create automated trace defines
2009-04-17 0:18 ` Jeremy Fitzhardinge
@ 2009-04-17 0:28 ` Mathieu Desnoyers
2009-04-17 0:43 ` Jeremy Fitzhardinge
0 siblings, 1 reply; 60+ messages in thread
From: Mathieu Desnoyers @ 2009-04-17 0:28 UTC (permalink / raw)
To: Jeremy Fitzhardinge
Cc: Steven Rostedt, linux-kernel, Ingo Molnar, Andrew Morton,
Thomas Gleixner, Peter Zijlstra, Frederic Weisbecker,
Theodore Tso, Arjan van de Ven, Christoph Hellwig, Lai Jiangshan,
Zhaolei, Li Zefan, KOSAKI Motohiro, Masami Hiramatsu,
Frank Ch. Eigler, Tom Zanussi, Jiaying Zhang, Michael Rubin,
Martin Bligh, Peter Zijlstra, Neil Horman,
Eduard - Gabriel Munteanu, Pekka Enberg
* Jeremy Fitzhardinge (jeremy@goop.org) wrote:
> Mathieu Desnoyers wrote:
>>> Are they? They're generally considered to be "free", because the
>>> call and return are predicted 100% accurately.
>>>
>>>
>>
>> Adding a simple function call within the tracer fast path, in LTTng, has
>> a very measurable performance impact on the tbench workload. This is why
>> I don't use any function call-based trace clocks in LTTng, but rather my
>> own inline trace clock.
>
> I'm a bit concerned about all the code that tracing puts inline though.
> It seems it would put quite a lot of icache overhead on the codepath
> when the tracepoint is disabled, not least because its duplicated in
> every instance of the tracepoint. And if the compiler decides to put
> the unlikely() branch code out of line, then that's the same as making
> it a function call (except that if it is a function call, all the
> tracepoints will share the same code, and get a higher likelihood of
> getting icache hits).
>
"all this code" is actually :
rcu_read_lock_sched_notrace(); \
it_func = rcu_dereference((tp)->funcs); \
if (it_func) { \
do { \
((void(*)(proto))(*it_func))(args); \
} while (*(++it_func)); \
} \
rcu_read_unlock_sched_notrace(); \
Which does nothing more than disabling preemption and a for loop to
call all the tracepoint handlers. I don't see the big win in laying out
the stack to call this code out-of-line; we would just remove the
preempt disable and the loop, which are minimal compared to most
call stacks.
So basically, tracepoints are already just doing a function call, with a
few more bytes for preempt disable and multiple handler support.
About the compiler deciding to put the unlikely branch out-of-line, I've
never seen any function calls generated just for the sake of saving
those few bytes, that would be crazy of the part of the compiler.
However, it can (and should) freely put the stack setup in the coldest
cache-lines possible, which are reachable by a near jump.
Mathieu
>
> J
>
--
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [PATCH 2/8] tracing: create automated trace defines
2009-04-17 0:28 ` Mathieu Desnoyers
@ 2009-04-17 0:43 ` Jeremy Fitzhardinge
2009-04-17 3:05 ` [PATCH] tracepoints : let subsystem nop-out the tracepoints at build time Mathieu Desnoyers
0 siblings, 1 reply; 60+ messages in thread
From: Jeremy Fitzhardinge @ 2009-04-17 0:43 UTC (permalink / raw)
To: Mathieu Desnoyers
Cc: Steven Rostedt, linux-kernel, Ingo Molnar, Andrew Morton,
Thomas Gleixner, Peter Zijlstra, Frederic Weisbecker,
Theodore Tso, Arjan van de Ven, Christoph Hellwig, Lai Jiangshan,
Zhaolei, Li Zefan, KOSAKI Motohiro, Masami Hiramatsu,
Frank Ch. Eigler, Tom Zanussi, Jiaying Zhang, Michael Rubin,
Martin Bligh, Peter Zijlstra, Neil Horman,
Eduard - Gabriel Munteanu, Pekka Enberg
Mathieu Desnoyers wrote:
> "all this code" is actually :
>
> rcu_read_lock_sched_notrace(); \
> it_func = rcu_dereference((tp)->funcs); \
> if (it_func) { \
> do { \
> ((void(*)(proto))(*it_func))(args); \
> } while (*(++it_func)); \
> } \
> rcu_read_unlock_sched_notrace(); \
>
> Which does nothing more than disabling preemption and a for loop to
> call all the tracepoint handlers. I don't see the big win in laying out
> the stack to call this code out-of-line; we would just remove the
> preempt disable and the loop, which are minimal compared to most
> call stacks.
>
Well, look at it from my perspective: Ingo has been repeatedly beating
me up for the overhead pvops adds to a native kernel, where it really is
just a (direct) function call. I want to instrument each pvop site with
a tracepoint so I can actually work out which calls are being called how
frequently to look for new optimisation opportunities.
I would guess the tracepoint code sequence is going to increase the
impact of each pvop call site by a fair bit, and that's not counting the
effects the extra register pressure will have. That's a pile of code to
add.
And frankly, that's fine by me, because I would expect this degree of
introspection to have some performance hit. But it does make the need
for per-subsystem tracing Kconfig entries fairly important, because I
don't think this would be acceptable to ship in a non-debug-everything
kernel build, even though other tracepoints might be.
> So basically, tracepoints are already just doing a function call, with a
> few more bytes for preempt disable and multiple handler support.
>
> About the compiler deciding to put the unlikely branch out-of-line, I've
> never seen any function calls generated just for the sake of saving
> those few bytes, that would be crazy of the part of the compiler.
> However, it can (and should) freely put the stack setup in the coldest
> cache-lines possible, which are reachable by a near jump.
>
No, it wouldn't generate a call. But if its going to put the code out
of line into cold cache-lines, then it may as well generate a call.
Anyway, the important point from my perspective is that tracepoint.h
have no #include dependencies beyond linux/types.h (compiler.h, etc).
J
^ permalink raw reply [flat|nested] 60+ messages in thread
* [PATCH] tracepoints : let subsystem nop-out the tracepoints at build time
2009-04-17 0:43 ` Jeremy Fitzhardinge
@ 2009-04-17 3:05 ` Mathieu Desnoyers
0 siblings, 0 replies; 60+ messages in thread
From: Mathieu Desnoyers @ 2009-04-17 3:05 UTC (permalink / raw)
To: Jeremy Fitzhardinge
Cc: Steven Rostedt, linux-kernel, Ingo Molnar, Andrew Morton,
Thomas Gleixner, Peter Zijlstra, Frederic Weisbecker,
Theodore Tso, Arjan van de Ven, Christoph Hellwig, Lai Jiangshan,
Zhaolei, Li Zefan, KOSAKI Motohiro, Masami Hiramatsu,
Frank Ch. Eigler, Tom Zanussi, Jiaying Zhang, Michael Rubin,
Martin Bligh, Peter Zijlstra, Neil Horman,
Eduard - Gabriel Munteanu, Pekka Enberg
* Jeremy Fitzhardinge (jeremy@goop.org) wrote:
> Mathieu Desnoyers wrote:
>> "all this code" is actually :
>>
>> rcu_read_lock_sched_notrace(); \
>> it_func = rcu_dereference((tp)->funcs); \
>> if (it_func) { \
>> do { \
>> ((void(*)(proto))(*it_func))(args); \
>> } while (*(++it_func)); \
>> } \
>> rcu_read_unlock_sched_notrace(); \
>>
>> Which does nothing more than disabling preemption and a for loop to
>> call all the tracepoint handlers. I don't see the big win in laying out
>> the stack to call this code out-of-line; we would just remove the
>> preempt disable and the loop, which are minimal compared to most
>> call stacks.
>>
>
> Well, look at it from my perspective: Ingo has been repeatedly beating
> me up for the overhead pvops adds to a native kernel, where it really is
> just a (direct) function call. I want to instrument each pvop site with
> a tracepoint so I can actually work out which calls are being called how
> frequently to look for new optimisation opportunities.
>
> I would guess the tracepoint code sequence is going to increase the
> impact of each pvop call site by a fair bit, and that's not counting the
> effects the extra register pressure will have. That's a pile of code to
> add.
>
> And frankly, that's fine by me, because I would expect this degree of
> introspection to have some performance hit. But it does make the need
> for per-subsystem tracing Kconfig entries fairly important, because I
> don't think this would be acceptable to ship in a non-debug-everything
> kernel build, even though other tracepoints might be.
>
Agreed. Tracepoints might change the code surrounding the pvops in a
similar fashion as the pvops themselves would change the code.
Therefore, it makes sense to have a Kconfig option to enable the pvops
tracepoints.
In terms of tracepoints (with the DECLARE_TRACE/DEFINE_TRACE semantic),
we could have something like :
in include/trace/pvops.h :
#include <linux/tracepoint.h>
#ifdef CONFIG_PVOPS_TRACEPOINTS
#define DECLARE_PVOPS_TRACE DECLARE_TRACE
#define DEFINE_PVOPS_TRACE DEFINE_TRACE
#define EXPORT_PVOPS_TRACEPOINT_SYMBOL_GPL EXPORT_TRACEPOINT_SYMBOL_GPL
#define EXPORT_PVOPS_TRACEPOINT_SYMBOL EXPORT_TRACEPOINT_SYMBOL
#else /* !CONFIG_PVOPS_TRACEPOINTS */
#define DECLARE_PVOPS_TRACE DECLARE_TRACE_NOP
#define DEFINE_PVOPS_TRACE DEFINE_TRACE_NOP
#define EXPORT_PVOPS_TRACEPOINT_SYMBOL_GPL EXPORT_TRACEPOINT_SYMBOL_GPL_NOP
#define EXPORT_PVOPS_TRACEPOINT_SYMBOL EXPORT_TRACEPOINT_SYMBOL_NOP
#endif /* CONFIG_PVOPS_TRACEPOINTS */
And then do the declarations/definitions using the new
DECLARE_PVOPS_TRACE / DEFINE_PVOPS_TRACE.
For that you'll need the patch I am attaching below. I'll let Steven
figure out how to tweak TRACE_EVENT() to support this new tracepoint
feature.
>> So basically, tracepoints are already just doing a function call, with a
>> few more bytes for preempt disable and multiple handler support.
>>
>> About the compiler deciding to put the unlikely branch out-of-line, I've
>> never seen any function calls generated just for the sake of saving
>> those few bytes, that would be crazy of the part of the compiler.
>> However, it can (and should) freely put the stack setup in the coldest
>> cache-lines possible, which are reachable by a near jump.
>>
>
> No, it wouldn't generate a call. But if its going to put the code out
> of line into cold cache-lines, then it may as well generate a call.
>
Jumping out-of-line was somewhat faster than calling a function if I
recall well my performance tests. But that's all been done long ago.
And note that whenever the tracer becomes active, the out-of-line code
of busy tracepoints becomes cache-hot, which means that there is no more
cache line fetch to perform, which leaves the stack setup and other
overhead of function call/return vs 2*jump very measurable.
> Anyway, the important point from my perspective is that tracepoint.h
> have no #include dependencies beyond linux/types.h (compiler.h, etc).
>
Is preempt.h a problem ?
Here is the patch.
Mathieu
tracepoints : let subsystem nop-out the tracepoints at build time
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
CC: Jeremy Fitzhardinge <jeremy@goop.org>
CC: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
CC: Steven Rostedt <rostedt@goodmis.org>
CC: Ingo Molnar <mingo@elte.hu>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: Christoph Hellwig <hch@lst.de>
---
include/linux/tracepoint.h | 38 ++++++++++++++++++++++----------------
1 file changed, 22 insertions(+), 16 deletions(-)
Index: linux.trees.git/include/linux/tracepoint.h
===================================================================
--- linux.trees.git.orig/include/linux/tracepoint.h 2009-04-16 22:40:26.000000000 -0400
+++ linux.trees.git/include/linux/tracepoint.h 2009-04-16 22:40:33.000000000 -0400
@@ -37,6 +37,24 @@ struct tracepoint {
#define TP_PROTO(args...) args
#define TP_ARGS(args...) args
+#define DECLARE_TRACE_NOP(name, proto, args) \
+ static inline void _do_trace_##name(struct tracepoint *tp, proto) \
+ { } \
+ static inline void trace_##name(proto) \
+ { } \
+ static inline int register_trace_##name(void (*probe)(proto)) \
+ { \
+ return -ENOSYS; \
+ } \
+ static inline int unregister_trace_##name(void (*probe)(proto)) \
+ { \
+ return -ENOSYS; \
+ }
+
+#define DEFINE_TRACE_NOP(name)
+#define EXPORT_TRACEPOINT_SYMBOL_GPL_NOP(name)
+#define EXPORT_TRACEPOINT_SYMBOL_NOP(name)
+
#ifdef CONFIG_TRACEPOINTS
/*
@@ -95,23 +113,11 @@ extern void tracepoint_update_probe_rang
struct tracepoint *end);
#else /* !CONFIG_TRACEPOINTS */
-#define DECLARE_TRACE(name, proto, args) \
- static inline void _do_trace_##name(struct tracepoint *tp, proto) \
- { } \
- static inline void trace_##name(proto) \
- { } \
- static inline int register_trace_##name(void (*probe)(proto)) \
- { \
- return -ENOSYS; \
- } \
- static inline int unregister_trace_##name(void (*probe)(proto)) \
- { \
- return -ENOSYS; \
- }
-#define DEFINE_TRACE(name)
-#define EXPORT_TRACEPOINT_SYMBOL_GPL(name)
-#define EXPORT_TRACEPOINT_SYMBOL(name)
+#define DECLARE_TRACE DECLARE_TRACE_NOP
+#define DEFINE_TRACE DEFINE_TRACE_NOP
+#define EXPORT_TRACEPOINT_SYMBOL_GPL EXPORT_TRACEPOINT_SYMBOL_GPL_NOP
+#define EXPORT_TRACEPOINT_SYMBOL EXPORT_TRACEPOINT_SYMBOL_NOP
static inline void tracepoint_update_probe_range(struct tracepoint *begin,
struct tracepoint *end)
--
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [PATCH 2/8] tracing: create automated trace defines
2009-04-16 23:44 ` Mathieu Desnoyers
2009-04-17 0:03 ` Jeremy Fitzhardinge
@ 2009-04-20 7:12 ` Andi Kleen
2009-04-21 15:51 ` Mathieu Desnoyers
1 sibling, 1 reply; 60+ messages in thread
From: Andi Kleen @ 2009-04-20 7:12 UTC (permalink / raw)
To: Mathieu Desnoyers
Cc: Jeremy Fitzhardinge, Steven Rostedt, linux-kernel, Ingo Molnar,
Andrew Morton, Thomas Gleixner, Peter Zijlstra,
Frederic Weisbecker, Theodore Tso, Arjan van de Ven,
Christoph Hellwig, Lai Jiangshan, Zhaolei, Li Zefan,
KOSAKI Motohiro, Masami Hiramatsu, Frank Ch. Eigler, Tom Zanussi,
Jiaying Zhang, Michael Rubin, Martin Bligh, Peter Zijlstra,
Neil Horman, Eduard - Gabriel Munteanu, Pekka
Mathieu Desnoyers <compudj@krystal.dyndns.org> writes:
> Given how slow function calls are, at least on x86,
That was with frame pointers right? Frame pointers tend to make
function calls slow.
-Andi
--
ak@linux.intel.com -- Speaking for myself only.
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [PATCH 2/8] tracing: create automated trace defines
2009-04-20 7:12 ` [PATCH 2/8] tracing: create automated trace defines Andi Kleen
@ 2009-04-21 15:51 ` Mathieu Desnoyers
2009-04-21 17:18 ` Jeremy Fitzhardinge
0 siblings, 1 reply; 60+ messages in thread
From: Mathieu Desnoyers @ 2009-04-21 15:51 UTC (permalink / raw)
To: Andi Kleen
Cc: Jeremy Fitzhardinge, Steven Rostedt, linux-kernel, Ingo Molnar,
Andrew Morton, Thomas Gleixner, Peter Zijlstra,
Frederic Weisbecker, Theodore Tso, Arjan van de Ven,
Christoph Hellwig, Lai Jiangshan, Zhaolei, Li Zefan,
KOSAKI Motohiro, Masami Hiramatsu, Frank Ch. Eigler, Tom Zanussi,
Jiaying Zhang, Michael Rubin, Martin Bligh, Peter Zijlstra,
Neil Horman, Eduard - Gabriel Munteanu, Pekka
* Andi Kleen (andi@firstfloor.org) wrote:
> Mathieu Desnoyers <compudj@krystal.dyndns.org> writes:
>
> > Given how slow function calls are, at least on x86,
>
> That was with frame pointers right? Frame pointers tend to make
> function calls slow.
>
Looking at my .config, CONFIG_FRAME_POINTER is disabled here. So we
should probably expect an even worse performance impact if we enable
them.
Mathieu
> -Andi
> --
> ak@linux.intel.com -- Speaking for myself only.
>
--
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [PATCH 2/8] tracing: create automated trace defines
2009-04-21 15:51 ` Mathieu Desnoyers
@ 2009-04-21 17:18 ` Jeremy Fitzhardinge
2009-04-21 17:21 ` Steven Rostedt
0 siblings, 1 reply; 60+ messages in thread
From: Jeremy Fitzhardinge @ 2009-04-21 17:18 UTC (permalink / raw)
To: Mathieu Desnoyers
Cc: Andi Kleen, Steven Rostedt, linux-kernel, Ingo Molnar,
Andrew Morton, Thomas Gleixner, Peter Zijlstra,
Frederic Weisbecker, Theodore Tso, Arjan van de Ven,
Christoph Hellwig, Lai Jiangshan, Zhaolei, Li Zefan,
KOSAKI Motohiro, Masami Hiramatsu, Frank Ch. Eigler, Tom Zanussi,
Jiaying Zhang, Michael Rubin, Martin Bligh, Peter Zijlstra,
Neil Horman, Eduard - Gabriel Munteanu, Pekka
Mathieu Desnoyers wrote:
> * Andi Kleen (andi@firstfloor.org) wrote:
>
>> Mathieu Desnoyers <compudj@krystal.dyndns.org> writes:
>>
>>
>>> Given how slow function calls are, at least on x86,
>>>
>> That was with frame pointers right? Frame pointers tend to make
>> function calls slow.
>>
>>
>
> Looking at my .config, CONFIG_FRAME_POINTER is disabled here. So we
> should probably expect an even worse performance impact if we enable
> them.
I tried disabling frame pointers, but it looked to me like tracing
selects them. Did I misread, or perhaps it was some other config option
doing it...
J
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [PATCH 2/8] tracing: create automated trace defines
2009-04-21 17:18 ` Jeremy Fitzhardinge
@ 2009-04-21 17:21 ` Steven Rostedt
2009-04-21 17:43 ` Jeremy Fitzhardinge
2009-04-21 20:28 ` Andi Kleen
0 siblings, 2 replies; 60+ messages in thread
From: Steven Rostedt @ 2009-04-21 17:21 UTC (permalink / raw)
To: Jeremy Fitzhardinge
Cc: Mathieu Desnoyers, Andi Kleen, linux-kernel, Ingo Molnar,
Andrew Morton, Thomas Gleixner, Peter Zijlstra,
Frederic Weisbecker, Theodore Tso, Arjan van de Ven,
Christoph Hellwig, Lai Jiangshan, Zhaolei, Li Zefan,
KOSAKI Motohiro, Masami Hiramatsu, Frank Ch. Eigler, Tom Zanussi,
Jiaying Zhang, Michael Rubin, Martin Bligh, Peter Zijlstra,
Neil Horman, Eduard - Gabriel Munteanu, Pekka
On Tue, 21 Apr 2009, Jeremy Fitzhardinge wrote:
> Mathieu Desnoyers wrote:
> > * Andi Kleen (andi@firstfloor.org) wrote:
> >
> > > Mathieu Desnoyers <compudj@krystal.dyndns.org> writes:
> > >
> > >
> > > > Given how slow function calls are, at least on x86,
> > > >
> > > That was with frame pointers right? Frame pointers tend to make
> > > function calls slow.
> > >
> > >
> >
> > Looking at my .config, CONFIG_FRAME_POINTER is disabled here. So we
> > should probably expect an even worse performance impact if we enable
> > them.
>
> I tried disabling frame pointers, but it looked to me like tracing selects
> them. Did I misread, or perhaps it was some other config option doing it...
It is needed for the function tracer (gcc -pg wont work without it). It is
the only tracer that selects it.
-- Steve
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [PATCH 2/8] tracing: create automated trace defines
2009-04-21 17:21 ` Steven Rostedt
@ 2009-04-21 17:43 ` Jeremy Fitzhardinge
2009-04-21 20:28 ` Andi Kleen
1 sibling, 0 replies; 60+ messages in thread
From: Jeremy Fitzhardinge @ 2009-04-21 17:43 UTC (permalink / raw)
To: Steven Rostedt
Cc: Mathieu Desnoyers, Andi Kleen, linux-kernel, Ingo Molnar,
Andrew Morton, Thomas Gleixner, Peter Zijlstra,
Frederic Weisbecker, Theodore Tso, Arjan van de Ven,
Christoph Hellwig, Lai Jiangshan, Zhaolei, Li Zefan,
KOSAKI Motohiro, Masami Hiramatsu, Frank Ch. Eigler, Tom Zanussi,
Jiaying Zhang, Michael Rubin, Martin Bligh, Peter Zijlstra,
Neil Horman, Eduard - Gabriel Munteanu, Pekka
Steven Rostedt wrote:
>
>> I tried disabling frame pointers, but it looked to me like tracing selects
>> them. Did I misread, or perhaps it was some other config option doing it...
>>
>
> It is needed for the function tracer (gcc -pg wont work without it). It is
> the only tracer that selects it.
>
Ah, right. I'm never sure what all the trace options actually control,
so I tend to enable them a bit indescriminately.
J
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [PATCH 2/8] tracing: create automated trace defines
2009-04-21 17:21 ` Steven Rostedt
2009-04-21 17:43 ` Jeremy Fitzhardinge
@ 2009-04-21 20:28 ` Andi Kleen
2009-04-21 21:17 ` Steven Rostedt
1 sibling, 1 reply; 60+ messages in thread
From: Andi Kleen @ 2009-04-21 20:28 UTC (permalink / raw)
To: Steven Rostedt
Cc: Jeremy Fitzhardinge, Mathieu Desnoyers, Andi Kleen, linux-kernel,
Ingo Molnar, Andrew Morton, Thomas Gleixner, Peter Zijlstra,
Frederic Weisbecker, Theodore Tso, Arjan van de Ven,
Christoph Hellwig, Lai Jiangshan, Zhaolei, Li Zefan,
KOSAKI Motohiro, Masami Hiramatsu, Frank Ch. Eigler, Tom Zanussi,
Jiaying Zhang, Michael Rubin, Martin Bligh, Peter Zijlstra,
Neil Horman, Eduard - Gabriel Munteanu, Pekka
> It is needed for the function tracer (gcc -pg wont work without it). It is
> the only tracer that selects it.
FWIW i still have gcc patches to fix that. They were first stalled
on copyright assignment and then on gcc's merge window being closed,
but now with 4.5 open for game I hope to resubmit them soon
again.
With that you can use -pg without frame pointer, but you have
to supply a special mcount function that expects the different
stack layout.
-Andi
--
ak@linux.intel.com -- Speaking for myself only.
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [PATCH 2/8] tracing: create automated trace defines
2009-04-21 20:28 ` Andi Kleen
@ 2009-04-21 21:17 ` Steven Rostedt
2009-04-21 21:23 ` Frank Ch. Eigler
2009-04-22 6:07 ` Andi Kleen
0 siblings, 2 replies; 60+ messages in thread
From: Steven Rostedt @ 2009-04-21 21:17 UTC (permalink / raw)
To: Andi Kleen
Cc: Jeremy Fitzhardinge, Mathieu Desnoyers, linux-kernel, Ingo Molnar,
Andrew Morton, Thomas Gleixner, Peter Zijlstra,
Frederic Weisbecker, Theodore Tso, Arjan van de Ven,
Christoph Hellwig, Lai Jiangshan, Zhaolei, Li Zefan,
KOSAKI Motohiro, Masami Hiramatsu, Frank Ch. Eigler, Tom Zanussi,
Jiaying Zhang, Michael Rubin, Martin Bligh, Peter Zijlstra,
Neil Horman, Eduard - Gabriel Munteanu, Pekka
On Tue, 21 Apr 2009, Andi Kleen wrote:
> > It is needed for the function tracer (gcc -pg wont work without it). It is
> > the only tracer that selects it.
>
> FWIW i still have gcc patches to fix that. They were first stalled
> on copyright assignment and then on gcc's merge window being closed,
> but now with 4.5 open for game I hope to resubmit them soon
> again.
>
> With that you can use -pg without frame pointer, but you have
> to supply a special mcount function that expects the different
> stack layout.
I think it was Ingo that let out the idea, and I'm starting to like it.
Perhaps we should fork off gcc and ship Linux with its own compiler. This
way we can optimize it for the kernel and not worry about any userland
optimizations.
I would like to do something like:
if (unlikely(err)) {
__section__(".error_sect") {
/* put error code here */
}
}
And have gcc in the error section (if it is big enough perhaps) do:
jmp .L123
.L124 [...]
and in the section ".error_sect" we would have:
.L123
/* error code here */
jmp .L124
We could do the same for trace points. That is, any part of code that
really would happen once in a while (error handling for one) we can move
off to its own section and keep hot paths hot.
-- Steve
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [PATCH 2/8] tracing: create automated trace defines
2009-04-21 21:17 ` Steven Rostedt
@ 2009-04-21 21:23 ` Frank Ch. Eigler
2009-04-21 21:33 ` Steven Rostedt
2009-04-22 6:07 ` Andi Kleen
1 sibling, 1 reply; 60+ messages in thread
From: Frank Ch. Eigler @ 2009-04-21 21:23 UTC (permalink / raw)
To: Steven Rostedt
Cc: Andi Kleen, Jeremy Fitzhardinge, Mathieu Desnoyers, linux-kernel,
Ingo Molnar, Andrew Morton, Thomas Gleixner, Peter Zijlstra,
Frederic Weisbecker, Theodore Tso, Arjan van de Ven,
Christoph Hellwig, Lai Jiangshan, Zhaolei, Li Zefan,
KOSAKI Motohiro, Masami Hiramatsu, Tom Zanussi, Jiaying Zhang,
Michael Rubin, Martin Bligh, Peter Zijlstra, Neil Horman,
Eduard - Gabriel Munteanu, Pekka
Hi -
On Tue, Apr 21, 2009 at 05:17:17PM -0400, Steven Rostedt wrote:
> [...] Perhaps we should fork off gcc and ship Linux with its own
> compiler. This way we can optimize it for the kernel and not worry
> about any userland optimizations.
In this regard, kernel land does not seem that unlike user land.
> if (unlikely(err)) {
> __section__(".error_sect") {
> /* put error code here */
> }
> }
>
> And have gcc in the error section (if it is big enough perhaps) do:
> jmp .L123
> .L124 [...]
> [...]
> jmp .L124
> We could do the same for trace points. That is, any part of code that
> really would happen once in a while (error handling for one) we can move
> off to its own section and keep hot paths hot.
This is called -freorder-blocks or -freorder-blocks-and-partition
(depending on how far you would like gcc to move unlikely blocks).
- FChE
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [PATCH 2/8] tracing: create automated trace defines
2009-04-21 21:23 ` Frank Ch. Eigler
@ 2009-04-21 21:33 ` Steven Rostedt
2009-04-22 5:47 ` Mathieu Desnoyers
0 siblings, 1 reply; 60+ messages in thread
From: Steven Rostedt @ 2009-04-21 21:33 UTC (permalink / raw)
To: Frank Ch. Eigler
Cc: Andi Kleen, Jeremy Fitzhardinge, Mathieu Desnoyers, LKML,
Ingo Molnar, Andrew Morton, Thomas Gleixner, Peter Zijlstra,
Frederic Weisbecker, Theodore Tso, Arjan van de Ven,
Christoph Hellwig, Lai Jiangshan, Zhaolei, Li Zefan,
KOSAKI Motohiro, Masami Hiramatsu, Tom Zanussi, Jiaying Zhang,
Michael Rubin, Martin Bligh, Peter Zijlstra, Neil Horman,
Eduard - Gabriel Munteanu
[ removed Pekka@firstfloor.org due to mail errors ]
On Tue, 21 Apr 2009, Frank Ch. Eigler wrote:
> Hi -
>
> On Tue, Apr 21, 2009 at 05:17:17PM -0400, Steven Rostedt wrote:
>
> > [...] Perhaps we should fork off gcc and ship Linux with its own
> > compiler. This way we can optimize it for the kernel and not worry
> > about any userland optimizations.
>
> In this regard, kernel land does not seem that unlike user land.
>
> > if (unlikely(err)) {
> > __section__(".error_sect") {
> > /* put error code here */
> > }
> > }
> >
> > And have gcc in the error section (if it is big enough perhaps) do:
> > jmp .L123
> > .L124 [...]
> > [...]
> > jmp .L124
>
> > We could do the same for trace points. That is, any part of code that
> > really would happen once in a while (error handling for one) we can move
> > off to its own section and keep hot paths hot.
>
> This is called -freorder-blocks or -freorder-blocks-and-partition
> (depending on how far you would like gcc to move unlikely blocks).
That does not let us pick and choose what and where to put the code.
But still, a fork of gcc would let us optimize it for the kernel, and not
for generic programs.
/me has been sitting too close to the furnace and must have been taking
up some of those fumes, to be considering a fork of gcc a good idea ;-)
-- Steve
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [PATCH 2/8] tracing: create automated trace defines
2009-04-21 21:33 ` Steven Rostedt
@ 2009-04-22 5:47 ` Mathieu Desnoyers
0 siblings, 0 replies; 60+ messages in thread
From: Mathieu Desnoyers @ 2009-04-22 5:47 UTC (permalink / raw)
To: Steven Rostedt
Cc: Frank Ch. Eigler, Andi Kleen, Jeremy Fitzhardinge, LKML,
Ingo Molnar, Andrew Morton, Thomas Gleixner, Peter Zijlstra,
Frederic Weisbecker, Theodore Tso, Arjan van de Ven,
Christoph Hellwig, Lai Jiangshan, Zhaolei, Li Zefan,
KOSAKI Motohiro, Masami Hiramatsu, Tom Zanussi, Jiaying Zhang,
Michael Rubin, Martin Bligh, Peter Zijlstra, Neil Horman,
Eduard - Gabriel Munteanu
* Steven Rostedt (rostedt@goodmis.org) wrote:
>
> [ removed Pekka@firstfloor.org due to mail errors ]
>
> On Tue, 21 Apr 2009, Frank Ch. Eigler wrote:
>
> > Hi -
> >
> > On Tue, Apr 21, 2009 at 05:17:17PM -0400, Steven Rostedt wrote:
> >
> > > [...] Perhaps we should fork off gcc and ship Linux with its own
> > > compiler. This way we can optimize it for the kernel and not worry
> > > about any userland optimizations.
> >
> > In this regard, kernel land does not seem that unlike user land.
> >
> > > if (unlikely(err)) {
> > > __section__(".error_sect") {
> > > /* put error code here */
> > > }
> > > }
> > >
> > > And have gcc in the error section (if it is big enough perhaps) do:
> > > jmp .L123
> > > .L124 [...]
> > > [...]
> > > jmp .L124
> >
> > > We could do the same for trace points. That is, any part of code that
> > > really would happen once in a while (error handling for one) we can move
> > > off to its own section and keep hot paths hot.
> >
> > This is called -freorder-blocks or -freorder-blocks-and-partition
> > (depending on how far you would like gcc to move unlikely blocks).
>
> That does not let us pick and choose what and where to put the code.
>
> But still, a fork of gcc would let us optimize it for the kernel, and not
> for generic programs.
>
> /me has been sitting too close to the furnace and must have been taking
> up some of those fumes, to be considering a fork of gcc a good idea ;-)
>
I guess we should have been sitting near the same furnace then. I'm
unsure how different from the current gcc this can go, but it could be a
very interesting exercise. Just removing unneeded front ends could
probably help adding features much faster than if we have to support
Fortran, Java, etc.
Mathieu
> -- Steve
>
--
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [PATCH 2/8] tracing: create automated trace defines
2009-04-21 21:17 ` Steven Rostedt
2009-04-21 21:23 ` Frank Ch. Eigler
@ 2009-04-22 6:07 ` Andi Kleen
2009-04-22 6:24 ` Steven Rostedt
1 sibling, 1 reply; 60+ messages in thread
From: Andi Kleen @ 2009-04-22 6:07 UTC (permalink / raw)
To: Steven Rostedt
Cc: Andi Kleen, Jeremy Fitzhardinge, Mathieu Desnoyers, linux-kernel,
Ingo Molnar, Andrew Morton, Thomas Gleixner, Peter Zijlstra,
Frederic Weisbecker, Theodore Tso, Arjan van de Ven,
Christoph Hellwig, Lai Jiangshan, Zhaolei, Li Zefan,
KOSAKI Motohiro, Masami Hiramatsu, Frank Ch. Eigler, Tom Zanussi,
Jiaying Zhang, Michael Rubin, Martin Bligh, Peter Zijlstra,
Neil Horman, Eduard - Gabriel Munteanu, Pekka
> I think it was Ingo that let out the idea, and I'm starting to like it.
>
> Perhaps we should fork off gcc and ship Linux with its own compiler. This
> way we can optimize it for the kernel and not worry about any userland
> optimizations.
>
> I would like to do something like:
>
> if (unlikely(err)) {
> __section__(".error_sect") {
gcc already supports that, you don't need to fork anything. It's called
hot/cold partitioning. Basically it splits functions into hot and cold
and unlikely parts and all the cold/unlikely parts go into a separate
sections.
I think it's normally not enabled by default on x86 though, probably because
it doesn't help too much.
By default (unless you specify -fno-reorder-blocks) it does the same
without sections, just moving unlikely code out of line.
-Andi
--
ak@linux.intel.com -- Speaking for myself only.
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [PATCH 2/8] tracing: create automated trace defines
2009-04-22 6:07 ` Andi Kleen
@ 2009-04-22 6:24 ` Steven Rostedt
2009-04-22 7:26 ` Andi Kleen
0 siblings, 1 reply; 60+ messages in thread
From: Steven Rostedt @ 2009-04-22 6:24 UTC (permalink / raw)
To: Andi Kleen
Cc: Jeremy Fitzhardinge, Mathieu Desnoyers, linux-kernel, Ingo Molnar,
Andrew Morton, Thomas Gleixner, Peter Zijlstra,
Frederic Weisbecker, Theodore Tso, Arjan van de Ven,
Christoph Hellwig, Lai Jiangshan, Zhaolei, Li Zefan,
KOSAKI Motohiro, Masami Hiramatsu, Frank Ch. Eigler, Tom Zanussi,
Jiaying Zhang, Michael Rubin, Martin Bligh, Peter Zijlstra,
Neil Horman, Eduard - Gabriel Munteanu, Pekka
On Wed, 22 Apr 2009, Andi Kleen wrote:
> > I think it was Ingo that let out the idea, and I'm starting to like it.
> >
> > Perhaps we should fork off gcc and ship Linux with its own compiler. This
> > way we can optimize it for the kernel and not worry about any userland
> > optimizations.
> >
> > I would like to do something like:
> >
> > if (unlikely(err)) {
> > __section__(".error_sect") {
>
>
> gcc already supports that, you don't need to fork anything. It's called
> hot/cold partitioning. Basically it splits functions into hot and cold
> and unlikely parts and all the cold/unlikely parts go into a separate
> sections.
>
> I think it's normally not enabled by default on x86 though, probably because
> it doesn't help too much.
>
> By default (unless you specify -fno-reorder-blocks) it does the same
> without sections, just moving unlikely code out of line.
The unlikely code does not always get moved out that far. It still sits
inside a function, and looking at the tracepoint code it did not move it
far enough.
If you have a bunch of functions that each with an unlikely statement,
those unlikely sections will still be interleaved within the function
code.
In the case of tracepoints, it would be nice to move all the code that
sets up the function call out of the hot paths. If we could move it to its
own section, that would be much better.
Having all "unlikely"s go into a separate section would not help much,
since according to the branch profiler there are a lot of "unlikely"s in
the kernel that are not too unlikely.
If gcc can indeed move "unlikely" code completely out of the fast path,
and put it into its own sections, then I think we should go through the
kernel and start removing all "likely" and "unlikely"s that are not 99%
accurate. Then we can enable the separate section cold paths and perhaps
see a performance benefit.
-- Steve
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [PATCH 2/8] tracing: create automated trace defines
2009-04-22 6:24 ` Steven Rostedt
@ 2009-04-22 7:26 ` Andi Kleen
0 siblings, 0 replies; 60+ messages in thread
From: Andi Kleen @ 2009-04-22 7:26 UTC (permalink / raw)
To: Steven Rostedt
Cc: Andi Kleen, Jeremy Fitzhardinge, Mathieu Desnoyers, linux-kernel,
Ingo Molnar, Andrew Morton, Thomas Gleixner, Peter Zijlstra,
Frederic Weisbecker, Theodore Tso, Arjan van de Ven,
Christoph Hellwig, Lai Jiangshan, Zhaolei, Li Zefan,
KOSAKI Motohiro, Masami Hiramatsu, Frank Ch. Eigler, Tom Zanussi,
Jiaying Zhang, Michael Rubin, Martin Bligh, Peter Zijlstra,
Neil Horman, Eduard - Gabriel Munteanu, Pekka
On Wed, Apr 22, 2009 at 02:24:17AM -0400, Steven Rostedt wrote:
>
> On Wed, 22 Apr 2009, Andi Kleen wrote:
>
> > > I think it was Ingo that let out the idea, and I'm starting to like it.
> > >
> > > Perhaps we should fork off gcc and ship Linux with its own compiler. This
> > > way we can optimize it for the kernel and not worry about any userland
> > > optimizations.
> > >
> > > I would like to do something like:
> > >
> > > if (unlikely(err)) {
> > > __section__(".error_sect") {
> >
> >
> > gcc already supports that, you don't need to fork anything. It's called
> > hot/cold partitioning. Basically it splits functions into hot and cold
> > and unlikely parts and all the cold/unlikely parts go into a separate
> > sections.
> >
> > I think it's normally not enabled by default on x86 though, probably because
> > it doesn't help too much.
> >
> > By default (unless you specify -fno-reorder-blocks) it does the same
> > without sections, just moving unlikely code out of line.
>
> The unlikely code does not always get moved out that far. It still sits
> inside a function, and looking at the tracepoint code it did not move it
> far enough.
That's because you didn't enable the hot/cold partioning as I wrote.
These are separate options. By default it doesn't use partitions on x86,
but it can.
> If gcc can indeed move "unlikely" code completely out of the fast path,
> and put it into its own sections, then I think we should go through the
> kernel and start removing all "likely" and "unlikely"s that are not 99%
> accurate. Then we can enable the separate section cold paths and perhaps
> see a performance benefit.
iirc there wasn't much for using separate partitions with the usual
user space benchmarks (SpecCPU etc.) on x86. It helped a bit on POWER
apparently though.
-Andi
--
ak@linux.intel.com -- Speaking for myself only.
^ permalink raw reply [flat|nested] 60+ messages in thread
end of thread, other threads:[~2009-04-22 8:19 UTC | newest]
Thread overview: 60+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-14 17:23 [PATCH 0/8] [GIT PULL] TRACE_EVENT for modules Steven Rostedt
2009-04-14 17:23 ` [PATCH 1/8] tracing: consolidate trace and trace_event headers Steven Rostedt
2009-04-14 21:51 ` Frederic Weisbecker
2009-04-14 22:04 ` Steven Rostedt
2009-04-14 17:23 ` [PATCH 2/8] tracing: create automated trace defines Steven Rostedt
2009-04-14 23:44 ` Jeremy Fitzhardinge
2009-04-15 1:45 ` Mathieu Desnoyers
2009-04-15 16:07 ` Jeremy Fitzhardinge
2009-04-16 2:34 ` Mathieu Desnoyers
2009-04-16 2:56 ` Jeremy Fitzhardinge
2009-04-16 23:44 ` Mathieu Desnoyers
2009-04-17 0:03 ` Jeremy Fitzhardinge
2009-04-17 0:13 ` Mathieu Desnoyers
2009-04-17 0:18 ` Jeremy Fitzhardinge
2009-04-17 0:28 ` Mathieu Desnoyers
2009-04-17 0:43 ` Jeremy Fitzhardinge
2009-04-17 3:05 ` [PATCH] tracepoints : let subsystem nop-out the tracepoints at build time Mathieu Desnoyers
2009-04-20 7:12 ` [PATCH 2/8] tracing: create automated trace defines Andi Kleen
2009-04-21 15:51 ` Mathieu Desnoyers
2009-04-21 17:18 ` Jeremy Fitzhardinge
2009-04-21 17:21 ` Steven Rostedt
2009-04-21 17:43 ` Jeremy Fitzhardinge
2009-04-21 20:28 ` Andi Kleen
2009-04-21 21:17 ` Steven Rostedt
2009-04-21 21:23 ` Frank Ch. Eigler
2009-04-21 21:33 ` Steven Rostedt
2009-04-22 5:47 ` Mathieu Desnoyers
2009-04-22 6:07 ` Andi Kleen
2009-04-22 6:24 ` Steven Rostedt
2009-04-22 7:26 ` Andi Kleen
2009-04-15 7:04 ` Zhaolei
2009-04-14 17:23 ` [PATCH 3/8] tracing: make trace_seq operations available for core kernel Steven Rostedt
2009-04-14 19:12 ` Peter Zijlstra
2009-04-15 2:19 ` Steven Rostedt
2009-04-14 17:23 ` [PATCH 4/8] tracing/events: move declarations from trace directory to core include Steven Rostedt
2009-04-14 17:23 ` [PATCH 5/8] tracing/events: move the ftrace event tracing code to core Steven Rostedt
2009-04-14 19:23 ` Peter Zijlstra
2009-04-15 2:25 ` Steven Rostedt
2009-04-15 3:40 ` Jiaying Zhang
2009-04-14 17:23 ` [PATCH 6/8] tracing/events: convert event call sites to use a link list Steven Rostedt
2009-04-14 17:23 ` [PATCH 7/8] tracing/events: add export symbols for trace events in modules Steven Rostedt
2009-04-14 17:23 ` [PATCH 8/8] tracing/events: add support for modules to TRACE_EVENT Steven Rostedt
2009-04-15 3:22 ` Rusty Russell
2009-04-14 18:15 ` [PATCH 0/8] [GIT PULL] TRACE_EVENT for modules Ingo Molnar
2009-04-14 18:25 ` Ingo Molnar
2009-04-14 18:21 ` Ingo Molnar
2009-04-14 18:33 ` Steven Rostedt
2009-04-14 18:35 ` Ingo Molnar
2009-04-14 21:04 ` Theodore Tso
2009-04-14 21:23 ` Steven Rostedt
2009-04-14 21:59 ` Steven Rostedt
2009-04-14 21:29 ` Frank Ch. Eigler
2009-04-14 22:00 ` Steven Rostedt
2009-04-16 16:53 ` Christoph Hellwig
2009-04-14 21:48 ` Jeremy Fitzhardinge
2009-04-14 21:55 ` Steven Rostedt
2009-04-14 22:33 ` Jeremy Fitzhardinge
2009-04-15 8:29 ` Ingo Molnar
2009-04-16 2:29 ` Mathieu Desnoyers
2009-04-16 16:52 ` Christoph Hellwig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox