diff options
author | Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> | 2008-11-14 17:47:47 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-11-16 03:01:36 -0500 |
commit | 7e066fb870fcd1025ec3ba7bbde5d541094f4ce1 (patch) | |
tree | 52acda06de25c029b9834110d7bf6b4abc50353b /samples | |
parent | 32f85742778dfc2c74975cf0b9f5bdb13470cb32 (diff) |
tracepoints: add DECLARE_TRACE() and DEFINE_TRACE()
Impact: API *CHANGE*. Must update all tracepoint users.
Add DEFINE_TRACE() to tracepoints to let them declare the tracepoint
structure in a single spot for all the kernel. It helps reducing memory
consumption, especially when declaring a lot of tracepoints, e.g. for
kmalloc tracing.
*API CHANGE WARNING*: now, DECLARE_TRACE() must be used in headers for
tracepoint declarations rather than DEFINE_TRACE(). This is the sane way
to do it. The name previously used was misleading.
Updates scheduler instrumentation to follow this API change.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'samples')
-rw-r--r-- | samples/tracepoints/tp-samples-trace.h | 4 | ||||
-rw-r--r-- | samples/tracepoints/tracepoint-sample.c | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/samples/tracepoints/tp-samples-trace.h b/samples/tracepoints/tp-samples-trace.h index 0216b55bd64..01724e04c55 100644 --- a/samples/tracepoints/tp-samples-trace.h +++ b/samples/tracepoints/tp-samples-trace.h | |||
@@ -4,10 +4,10 @@ | |||
4 | #include <linux/proc_fs.h> /* for struct inode and struct file */ | 4 | #include <linux/proc_fs.h> /* for struct inode and struct file */ |
5 | #include <linux/tracepoint.h> | 5 | #include <linux/tracepoint.h> |
6 | 6 | ||
7 | DEFINE_TRACE(subsys_event, | 7 | DECLARE_TRACE(subsys_event, |
8 | TPPROTO(struct inode *inode, struct file *file), | 8 | TPPROTO(struct inode *inode, struct file *file), |
9 | TPARGS(inode, file)); | 9 | TPARGS(inode, file)); |
10 | DEFINE_TRACE(subsys_eventb, | 10 | DECLARE_TRACE(subsys_eventb, |
11 | TPPROTO(void), | 11 | TPPROTO(void), |
12 | TPARGS()); | 12 | TPARGS()); |
13 | #endif | 13 | #endif |
diff --git a/samples/tracepoints/tracepoint-sample.c b/samples/tracepoints/tracepoint-sample.c index 4ae4b7fcc04..00d169792a3 100644 --- a/samples/tracepoints/tracepoint-sample.c +++ b/samples/tracepoints/tracepoint-sample.c | |||
@@ -13,6 +13,9 @@ | |||
13 | #include <linux/proc_fs.h> | 13 | #include <linux/proc_fs.h> |
14 | #include "tp-samples-trace.h" | 14 | #include "tp-samples-trace.h" |
15 | 15 | ||
16 | DEFINE_TRACE(subsys_event); | ||
17 | DEFINE_TRACE(subsys_eventb); | ||
18 | |||
16 | struct proc_dir_entry *pentry_example; | 19 | struct proc_dir_entry *pentry_example; |
17 | 20 | ||
18 | static int my_open(struct inode *inode, struct file *file) | 21 | static int my_open(struct inode *inode, struct file *file) |