aboutsummaryrefslogtreecommitdiffstats
path: root/include/trace/kmem.h
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2009-04-10 08:54:16 -0400
committerSteven Rostedt <rostedt@goodmis.org>2009-04-14 09:43:40 -0400
commitea20d9293ce423a39717ed4375393129a2e701f9 (patch)
tree30cbfd532e6541c17eb69a63044cfe7bce6cf974 /include/trace/kmem.h
parent0a19e53c1514ad8e9c3cbab40c6c3f52c86f403d (diff)
tracing: consolidate trace and trace_event headers
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>
Diffstat (limited to 'include/trace/kmem.h')
-rw-r--r--include/trace/kmem.h189
1 files changed, 186 insertions, 3 deletions
diff --git a/include/trace/kmem.h b/include/trace/kmem.h
index 46efc2423f03..d7d12189e5c8 100644
--- a/include/trace/kmem.h
+++ b/include/trace/kmem.h
@@ -1,9 +1,192 @@
1#ifndef _TRACE_KMEM_H 1#if !defined(_TRACE_KMEM_H) || defined(TRACE_HEADER_MULTI_READ)
2#define _TRACE_KMEM_H 2#define _TRACE_KMEM_H
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5#include <linux/tracepoint.h> 5#include <linux/tracepoint.h>
6 6
7#include <trace/kmem_event_types.h> 7#undef TRACE_SYSTEM
8#define TRACE_SYSTEM kmem
8 9
9#endif /* _TRACE_KMEM_H */ 10TRACE_EVENT(kmalloc,
11
12 TP_PROTO(unsigned long call_site,
13 const void *ptr,
14 size_t bytes_req,
15 size_t bytes_alloc,
16 gfp_t gfp_flags),
17
18 TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags),
19
20 TP_STRUCT__entry(
21 __field( unsigned long, call_site )
22 __field( const void *, ptr )
23 __field( size_t, bytes_req )
24 __field( size_t, bytes_alloc )
25 __field( gfp_t, gfp_flags )
26 ),
27
28 TP_fast_assign(
29 __entry->call_site = call_site;
30 __entry->ptr = ptr;
31 __entry->bytes_req = bytes_req;
32 __entry->bytes_alloc = bytes_alloc;
33 __entry->gfp_flags = gfp_flags;
34 ),
35
36 TP_printk("call_site=%lx ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%08x",
37 __entry->call_site,
38 __entry->ptr,
39 __entry->bytes_req,
40 __entry->bytes_alloc,
41 __entry->gfp_flags)
42);
43
44TRACE_EVENT(kmem_cache_alloc,
45
46 TP_PROTO(unsigned long call_site,
47 const void *ptr,
48 size_t bytes_req,
49 size_t bytes_alloc,
50 gfp_t gfp_flags),
51
52 TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags),
53
54 TP_STRUCT__entry(
55 __field( unsigned long, call_site )
56 __field( const void *, ptr )
57 __field( size_t, bytes_req )
58 __field( size_t, bytes_alloc )
59 __field( gfp_t, gfp_flags )
60 ),
61
62 TP_fast_assign(
63 __entry->call_site = call_site;
64 __entry->ptr = ptr;
65 __entry->bytes_req = bytes_req;
66 __entry->bytes_alloc = bytes_alloc;
67 __entry->gfp_flags = gfp_flags;
68 ),
69
70 TP_printk("call_site=%lx ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%08x",
71 __entry->call_site,
72 __entry->ptr,
73 __entry->bytes_req,
74 __entry->bytes_alloc,
75 __entry->gfp_flags)
76);
77
78TRACE_EVENT(kmalloc_node,
79
80 TP_PROTO(unsigned long call_site,
81 const void *ptr,
82 size_t bytes_req,
83 size_t bytes_alloc,
84 gfp_t gfp_flags,
85 int node),
86
87 TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags, node),
88
89 TP_STRUCT__entry(
90 __field( unsigned long, call_site )
91 __field( const void *, ptr )
92 __field( size_t, bytes_req )
93 __field( size_t, bytes_alloc )
94 __field( gfp_t, gfp_flags )
95 __field( int, node )
96 ),
97
98 TP_fast_assign(
99 __entry->call_site = call_site;
100 __entry->ptr = ptr;
101 __entry->bytes_req = bytes_req;
102 __entry->bytes_alloc = bytes_alloc;
103 __entry->gfp_flags = gfp_flags;
104 __entry->node = node;
105 ),
106
107 TP_printk("call_site=%lx ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%08x node=%d",
108 __entry->call_site,
109 __entry->ptr,
110 __entry->bytes_req,
111 __entry->bytes_alloc,
112 __entry->gfp_flags,
113 __entry->node)
114);
115
116TRACE_EVENT(kmem_cache_alloc_node,
117
118 TP_PROTO(unsigned long call_site,
119 const void *ptr,
120 size_t bytes_req,
121 size_t bytes_alloc,
122 gfp_t gfp_flags,
123 int node),
124
125 TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags, node),
126
127 TP_STRUCT__entry(
128 __field( unsigned long, call_site )
129 __field( const void *, ptr )
130 __field( size_t, bytes_req )
131 __field( size_t, bytes_alloc )
132 __field( gfp_t, gfp_flags )
133 __field( int, node )
134 ),
135
136 TP_fast_assign(
137 __entry->call_site = call_site;
138 __entry->ptr = ptr;
139 __entry->bytes_req = bytes_req;
140 __entry->bytes_alloc = bytes_alloc;
141 __entry->gfp_flags = gfp_flags;
142 __entry->node = node;
143 ),
144
145 TP_printk("call_site=%lx ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%08x node=%d",
146 __entry->call_site,
147 __entry->ptr,
148 __entry->bytes_req,
149 __entry->bytes_alloc,
150 __entry->gfp_flags,
151 __entry->node)
152);
153
154TRACE_EVENT(kfree,
155
156 TP_PROTO(unsigned long call_site, const void *ptr),
157
158 TP_ARGS(call_site, ptr),
159
160 TP_STRUCT__entry(
161 __field( unsigned long, call_site )
162 __field( const void *, ptr )
163 ),
164
165 TP_fast_assign(
166 __entry->call_site = call_site;
167 __entry->ptr = ptr;
168 ),
169
170 TP_printk("call_site=%lx ptr=%p", __entry->call_site, __entry->ptr)
171);
172
173TRACE_EVENT(kmem_cache_free,
174
175 TP_PROTO(unsigned long call_site, const void *ptr),
176
177 TP_ARGS(call_site, ptr),
178
179 TP_STRUCT__entry(
180 __field( unsigned long, call_site )
181 __field( const void *, ptr )
182 ),
183
184 TP_fast_assign(
185 __entry->call_site = call_site;
186 __entry->ptr = ptr;
187 ),
188
189 TP_printk("call_site=%lx ptr=%p", __entry->call_site, __entry->ptr)
190);
191
192#endif