aboutsummaryrefslogtreecommitdiffstats
path: root/include/trace
diff options
context:
space:
mode:
authorZhaolei <zhaolei@cn.fujitsu.com>2009-04-10 02:27:38 -0400
committerIngo Molnar <mingo@elte.hu>2009-04-12 09:22:56 -0400
commitfc182a4330fc22ea1b68fa3d5064dd85a73a4c4a (patch)
tree5c3b329199b514fc4133b21928348c901e2c74a8 /include/trace
parent02af61bb50f5d5f0322dbe5ab2a0d75808d25c7b (diff)
tracing, kmemtrace: Make kmem tracepoints use TRACE_EVENT macro
TRACE_EVENT is a more generic way to define tracepoints. Doing so adds these new capabilities to this tracepoint: - zero-copy and per-cpu splice() tracing - binary tracing without printf overhead - structured logging records exposed under /debug/tracing/events - trace events embedded in function tracer output and other plugins - user-defined, per tracepoint filter expressions Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com> Acked-by: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro> Acked-by: Pekka Enberg <penberg@cs.helsinki.fi> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Tom Zanussi <tzanussi@gmail.com> LKML-Reference: <49DEE6DA.80600@cn.fujitsu.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/trace')
-rw-r--r--include/trace/kmem.h39
-rw-r--r--include/trace/kmem_event_types.h193
-rw-r--r--include/trace/trace_event_types.h1
-rw-r--r--include/trace/trace_events.h1
4 files changed, 197 insertions, 37 deletions
diff --git a/include/trace/kmem.h b/include/trace/kmem.h
index 24d251928182..46efc2423f03 100644
--- a/include/trace/kmem.h
+++ b/include/trace/kmem.h
@@ -1,44 +1,9 @@
1#ifndef _TRACE_KMEM_H 1#ifndef _TRACE_KMEM_H
2#define _TRACE_KMEM_H 2#define _TRACE_KMEM_H
3 3
4#include <linux/tracepoint.h>
5#include <linux/types.h> 4#include <linux/types.h>
5#include <linux/tracepoint.h>
6 6
7DECLARE_TRACE(kmalloc, 7#include <trace/kmem_event_types.h>
8 TP_PROTO(unsigned long call_site,
9 const void *ptr,
10 size_t bytes_req,
11 size_t bytes_alloc,
12 gfp_t gfp_flags),
13 TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags));
14DECLARE_TRACE(kmem_cache_alloc,
15 TP_PROTO(unsigned long call_site,
16 const void *ptr,
17 size_t bytes_req,
18 size_t bytes_alloc,
19 gfp_t gfp_flags),
20 TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags));
21DECLARE_TRACE(kmalloc_node,
22 TP_PROTO(unsigned long call_site,
23 const void *ptr,
24 size_t bytes_req,
25 size_t bytes_alloc,
26 gfp_t gfp_flags,
27 int node),
28 TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags, node));
29DECLARE_TRACE(kmem_cache_alloc_node,
30 TP_PROTO(unsigned long call_site,
31 const void *ptr,
32 size_t bytes_req,
33 size_t bytes_alloc,
34 gfp_t gfp_flags,
35 int node),
36 TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags, node));
37DECLARE_TRACE(kfree,
38 TP_PROTO(unsigned long call_site, const void *ptr),
39 TP_ARGS(call_site, ptr));
40DECLARE_TRACE(kmem_cache_free,
41 TP_PROTO(unsigned long call_site, const void *ptr),
42 TP_ARGS(call_site, ptr));
43 8
44#endif /* _TRACE_KMEM_H */ 9#endif /* _TRACE_KMEM_H */
diff --git a/include/trace/kmem_event_types.h b/include/trace/kmem_event_types.h
new file mode 100644
index 000000000000..4ff420fe4675
--- /dev/null
+++ b/include/trace/kmem_event_types.h
@@ -0,0 +1,193 @@
1
2/* use <trace/kmem.h> instead */
3#ifndef TRACE_EVENT
4# error Do not include this file directly.
5# error Unless you know what you are doing.
6#endif
7
8#undef TRACE_SYSTEM
9#define TRACE_SYSTEM kmem
10
11TRACE_EVENT(kmalloc,
12
13 TP_PROTO(unsigned long call_site,
14 const void *ptr,
15 size_t bytes_req,
16 size_t bytes_alloc,
17 gfp_t gfp_flags),
18
19 TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags),
20
21 TP_STRUCT__entry(
22 __field( unsigned long, call_site )
23 __field( const void *, ptr )
24 __field( size_t, bytes_req )
25 __field( size_t, bytes_alloc )
26 __field( gfp_t, gfp_flags )
27 ),
28
29 TP_fast_assign(
30 __entry->call_site = call_site;
31 __entry->ptr = ptr;
32 __entry->bytes_req = bytes_req;
33 __entry->bytes_alloc = bytes_alloc;
34 __entry->gfp_flags = gfp_flags;
35 ),
36
37 TP_printk("call_site=%lx ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%08x",
38 __entry->call_site,
39 __entry->ptr,
40 __entry->bytes_req,
41 __entry->bytes_alloc,
42 __entry->gfp_flags)
43);
44
45TRACE_EVENT(kmem_cache_alloc,
46
47 TP_PROTO(unsigned long call_site,
48 const void *ptr,
49 size_t bytes_req,
50 size_t bytes_alloc,
51 gfp_t gfp_flags),
52
53 TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags),
54
55 TP_STRUCT__entry(
56 __field( unsigned long, call_site )
57 __field( const void *, ptr )
58 __field( size_t, bytes_req )
59 __field( size_t, bytes_alloc )
60 __field( gfp_t, gfp_flags )
61 ),
62
63 TP_fast_assign(
64 __entry->call_site = call_site;
65 __entry->ptr = ptr;
66 __entry->bytes_req = bytes_req;
67 __entry->bytes_alloc = bytes_alloc;
68 __entry->gfp_flags = gfp_flags;
69 ),
70
71 TP_printk("call_site=%lx ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%08x",
72 __entry->call_site,
73 __entry->ptr,
74 __entry->bytes_req,
75 __entry->bytes_alloc,
76 __entry->gfp_flags)
77);
78
79TRACE_EVENT(kmalloc_node,
80
81 TP_PROTO(unsigned long call_site,
82 const void *ptr,
83 size_t bytes_req,
84 size_t bytes_alloc,
85 gfp_t gfp_flags,
86 int node),
87
88 TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags, node),
89
90 TP_STRUCT__entry(
91 __field( unsigned long, call_site )
92 __field( const void *, ptr )
93 __field( size_t, bytes_req )
94 __field( size_t, bytes_alloc )
95 __field( gfp_t, gfp_flags )
96 __field( int, node )
97 ),
98
99 TP_fast_assign(
100 __entry->call_site = call_site;
101 __entry->ptr = ptr;
102 __entry->bytes_req = bytes_req;
103 __entry->bytes_alloc = bytes_alloc;
104 __entry->gfp_flags = gfp_flags;
105 __entry->node = node;
106 ),
107
108 TP_printk("call_site=%lx ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%08x node=%d",
109 __entry->call_site,
110 __entry->ptr,
111 __entry->bytes_req,
112 __entry->bytes_alloc,
113 __entry->gfp_flags,
114 __entry->node)
115);
116
117TRACE_EVENT(kmem_cache_alloc_node,
118
119 TP_PROTO(unsigned long call_site,
120 const void *ptr,
121 size_t bytes_req,
122 size_t bytes_alloc,
123 gfp_t gfp_flags,
124 int node),
125
126 TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags, node),
127
128 TP_STRUCT__entry(
129 __field( unsigned long, call_site )
130 __field( const void *, ptr )
131 __field( size_t, bytes_req )
132 __field( size_t, bytes_alloc )
133 __field( gfp_t, gfp_flags )
134 __field( int, node )
135 ),
136
137 TP_fast_assign(
138 __entry->call_site = call_site;
139 __entry->ptr = ptr;
140 __entry->bytes_req = bytes_req;
141 __entry->bytes_alloc = bytes_alloc;
142 __entry->gfp_flags = gfp_flags;
143 __entry->node = node;
144 ),
145
146 TP_printk("call_site=%lx ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%08x node=%d",
147 __entry->call_site,
148 __entry->ptr,
149 __entry->bytes_req,
150 __entry->bytes_alloc,
151 __entry->gfp_flags,
152 __entry->node)
153);
154
155TRACE_EVENT(kfree,
156
157 TP_PROTO(unsigned long call_site, const void *ptr),
158
159 TP_ARGS(call_site, ptr),
160
161 TP_STRUCT__entry(
162 __field( unsigned long, call_site )
163 __field( const void *, ptr )
164 ),
165
166 TP_fast_assign(
167 __entry->call_site = call_site;
168 __entry->ptr = ptr;
169 ),
170
171 TP_printk("call_site=%lx ptr=%p", __entry->call_site, __entry->ptr)
172);
173
174TRACE_EVENT(kmem_cache_free,
175
176 TP_PROTO(unsigned long call_site, const void *ptr),
177
178 TP_ARGS(call_site, ptr),
179
180 TP_STRUCT__entry(
181 __field( unsigned long, call_site )
182 __field( const void *, ptr )
183 ),
184
185 TP_fast_assign(
186 __entry->call_site = call_site;
187 __entry->ptr = ptr;
188 ),
189
190 TP_printk("call_site=%lx ptr=%p", __entry->call_site, __entry->ptr)
191);
192
193#undef TRACE_SYSTEM
diff --git a/include/trace/trace_event_types.h b/include/trace/trace_event_types.h
index 33b6bfcba93b..552a50e169a6 100644
--- a/include/trace/trace_event_types.h
+++ b/include/trace/trace_event_types.h
@@ -4,3 +4,4 @@
4#include <trace/irq_event_types.h> 4#include <trace/irq_event_types.h>
5#include <trace/lockdep_event_types.h> 5#include <trace/lockdep_event_types.h>
6#include <trace/skb_event_types.h> 6#include <trace/skb_event_types.h>
7#include <trace/kmem_event_types.h>
diff --git a/include/trace/trace_events.h b/include/trace/trace_events.h
index 0e2aa80076d9..13d6b85668cf 100644
--- a/include/trace/trace_events.h
+++ b/include/trace/trace_events.h
@@ -4,3 +4,4 @@
4#include <trace/irq.h> 4#include <trace/irq.h>
5#include <trace/lockdep.h> 5#include <trace/lockdep.h>
6#include <trace/skb.h> 6#include <trace/skb.h>
7#include <trace/kmem.h>