Steven Rostedt | ea20d92 | 2009-04-10 08:54:16 -0400 | [diff] [blame^] | 1 | #if !defined(_TRACE_KMEM_H) || defined(TRACE_HEADER_MULTI_READ) |
Zhaolei | 02af61b | 2009-04-10 14:26:18 +0800 | [diff] [blame] | 2 | #define _TRACE_KMEM_H |
Eduard - Gabriel Munteanu | b9ce08c | 2008-08-10 20:14:03 +0300 | [diff] [blame] | 3 | |
| 4 | #include <linux/types.h> |
Zhaolei | fc182a4 | 2009-04-10 14:27:38 +0800 | [diff] [blame] | 5 | #include <linux/tracepoint.h> |
Eduard - Gabriel Munteanu | b9ce08c | 2008-08-10 20:14:03 +0300 | [diff] [blame] | 6 | |
Steven Rostedt | ea20d92 | 2009-04-10 08:54:16 -0400 | [diff] [blame^] | 7 | #undef TRACE_SYSTEM |
| 8 | #define TRACE_SYSTEM kmem |
Eduard - Gabriel Munteanu | b9ce08c | 2008-08-10 20:14:03 +0300 | [diff] [blame] | 9 | |
Steven Rostedt | ea20d92 | 2009-04-10 08:54:16 -0400 | [diff] [blame^] | 10 | TRACE_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 | |
| 44 | TRACE_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 | |
| 78 | TRACE_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 | |
| 116 | TRACE_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 | |
| 154 | TRACE_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 | |
| 173 | TRACE_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 |