diff options
author | Steven Rostedt <srostedt@redhat.com> | 2009-05-15 16:16:30 -0400 |
---|---|---|
committer | Frederic Weisbecker <fweisbec@gmail.com> | 2009-05-26 14:31:14 -0400 |
commit | 62ba180e80f4194a498585ac0e4c07daa8ca08d1 (patch) | |
tree | 44bdb742aa542e16cc08d93d6cca6b22e9492071 /include/trace | |
parent | 937cdb9db7f59278d0cb1582e6e64e3dfd73b4fc (diff) |
tracing: add flag output for kmem events
This patch changes the output for gfp_flags from being a simple hex value
to the actual names.
gfp_flags=GFP_ATOMIC instead of gfp_flags=00000020
And even
gfp_flags=GFP_KERNEL instead of gfp_flags=000000d0
(Thanks to Frederic Weisbecker for pointing out that the first version
had a bad order of GFP masks)
[ Impact: more human readable output from tracer ]
Acked-by: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Diffstat (limited to 'include/trace')
-rw-r--r-- | include/trace/events/kmem.h | 53 |
1 files changed, 45 insertions, 8 deletions
diff --git a/include/trace/events/kmem.h b/include/trace/events/kmem.h index c22c42f980b5..9baba50d6512 100644 --- a/include/trace/events/kmem.h +++ b/include/trace/events/kmem.h | |||
@@ -7,6 +7,43 @@ | |||
7 | #undef TRACE_SYSTEM | 7 | #undef TRACE_SYSTEM |
8 | #define TRACE_SYSTEM kmem | 8 | #define TRACE_SYSTEM kmem |
9 | 9 | ||
10 | /* | ||
11 | * The order of these masks is important. Matching masks will be seen | ||
12 | * first and the left over flags will end up showing by themselves. | ||
13 | * | ||
14 | * For example, if we have GFP_KERNEL before GFP_USER we wil get: | ||
15 | * | ||
16 | * GFP_KERNEL|GFP_HARDWALL | ||
17 | * | ||
18 | * Thus most bits set go first. | ||
19 | */ | ||
20 | #define show_gfp_flags(flags) \ | ||
21 | (flags) ? __print_flags(flags, "|", \ | ||
22 | {(unsigned long)GFP_HIGHUSER_MOVABLE, "GFP_HIGHUSER_MOVABLE"}, \ | ||
23 | {(unsigned long)GFP_HIGHUSER, "GFP_HIGHUSER"}, \ | ||
24 | {(unsigned long)GFP_USER, "GFP_USER"}, \ | ||
25 | {(unsigned long)GFP_TEMPORARY, "GFP_TEMPORARY"}, \ | ||
26 | {(unsigned long)GFP_KERNEL, "GFP_KERNEL"}, \ | ||
27 | {(unsigned long)GFP_NOFS, "GFP_NOFS"}, \ | ||
28 | {(unsigned long)GFP_ATOMIC, "GFP_ATOMIC"}, \ | ||
29 | {(unsigned long)GFP_NOIO, "GFP_NOIO"}, \ | ||
30 | {(unsigned long)__GFP_HIGH, "GFP_HIGH"}, \ | ||
31 | {(unsigned long)__GFP_WAIT, "GFP_WAIT"}, \ | ||
32 | {(unsigned long)__GFP_IO, "GFP_IO"}, \ | ||
33 | {(unsigned long)__GFP_COLD, "GFP_COLD"}, \ | ||
34 | {(unsigned long)__GFP_NOWARN, "GFP_NOWARN"}, \ | ||
35 | {(unsigned long)__GFP_REPEAT, "GFP_REPEAT"}, \ | ||
36 | {(unsigned long)__GFP_NOFAIL, "GFP_NOFAIL"}, \ | ||
37 | {(unsigned long)__GFP_NORETRY, "GFP_NORETRY"}, \ | ||
38 | {(unsigned long)__GFP_COMP, "GFP_COMP"}, \ | ||
39 | {(unsigned long)__GFP_ZERO, "GFP_ZERO"}, \ | ||
40 | {(unsigned long)__GFP_NOMEMALLOC, "GFP_NOMEMALLOC"}, \ | ||
41 | {(unsigned long)__GFP_HARDWALL, "GFP_HARDWALL"}, \ | ||
42 | {(unsigned long)__GFP_THISNODE, "GFP_THISNODE"}, \ | ||
43 | {(unsigned long)__GFP_RECLAIMABLE, "GFP_RECLAIMABLE"}, \ | ||
44 | {(unsigned long)__GFP_MOVABLE, "GFP_MOVABLE"} \ | ||
45 | ) : "GFP_NOWAIT" | ||
46 | |||
10 | TRACE_EVENT(kmalloc, | 47 | TRACE_EVENT(kmalloc, |
11 | 48 | ||
12 | TP_PROTO(unsigned long call_site, | 49 | TP_PROTO(unsigned long call_site, |
@@ -33,12 +70,12 @@ TRACE_EVENT(kmalloc, | |||
33 | __entry->gfp_flags = gfp_flags; | 70 | __entry->gfp_flags = gfp_flags; |
34 | ), | 71 | ), |
35 | 72 | ||
36 | TP_printk("call_site=%lx ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%08x", | 73 | TP_printk("call_site=%lx ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%s", |
37 | __entry->call_site, | 74 | __entry->call_site, |
38 | __entry->ptr, | 75 | __entry->ptr, |
39 | __entry->bytes_req, | 76 | __entry->bytes_req, |
40 | __entry->bytes_alloc, | 77 | __entry->bytes_alloc, |
41 | __entry->gfp_flags) | 78 | show_gfp_flags(__entry->gfp_flags)) |
42 | ); | 79 | ); |
43 | 80 | ||
44 | TRACE_EVENT(kmem_cache_alloc, | 81 | TRACE_EVENT(kmem_cache_alloc, |
@@ -67,12 +104,12 @@ TRACE_EVENT(kmem_cache_alloc, | |||
67 | __entry->gfp_flags = gfp_flags; | 104 | __entry->gfp_flags = gfp_flags; |
68 | ), | 105 | ), |
69 | 106 | ||
70 | TP_printk("call_site=%lx ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%08x", | 107 | TP_printk("call_site=%lx ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%s", |
71 | __entry->call_site, | 108 | __entry->call_site, |
72 | __entry->ptr, | 109 | __entry->ptr, |
73 | __entry->bytes_req, | 110 | __entry->bytes_req, |
74 | __entry->bytes_alloc, | 111 | __entry->bytes_alloc, |
75 | __entry->gfp_flags) | 112 | show_gfp_flags(__entry->gfp_flags)) |
76 | ); | 113 | ); |
77 | 114 | ||
78 | TRACE_EVENT(kmalloc_node, | 115 | TRACE_EVENT(kmalloc_node, |
@@ -104,12 +141,12 @@ TRACE_EVENT(kmalloc_node, | |||
104 | __entry->node = node; | 141 | __entry->node = node; |
105 | ), | 142 | ), |
106 | 143 | ||
107 | TP_printk("call_site=%lx ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%08x node=%d", | 144 | TP_printk("call_site=%lx ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%s node=%d", |
108 | __entry->call_site, | 145 | __entry->call_site, |
109 | __entry->ptr, | 146 | __entry->ptr, |
110 | __entry->bytes_req, | 147 | __entry->bytes_req, |
111 | __entry->bytes_alloc, | 148 | __entry->bytes_alloc, |
112 | __entry->gfp_flags, | 149 | show_gfp_flags(__entry->gfp_flags), |
113 | __entry->node) | 150 | __entry->node) |
114 | ); | 151 | ); |
115 | 152 | ||
@@ -142,12 +179,12 @@ TRACE_EVENT(kmem_cache_alloc_node, | |||
142 | __entry->node = node; | 179 | __entry->node = node; |
143 | ), | 180 | ), |
144 | 181 | ||
145 | TP_printk("call_site=%lx ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%08x node=%d", | 182 | TP_printk("call_site=%lx ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%s node=%d", |
146 | __entry->call_site, | 183 | __entry->call_site, |
147 | __entry->ptr, | 184 | __entry->ptr, |
148 | __entry->bytes_req, | 185 | __entry->bytes_req, |
149 | __entry->bytes_alloc, | 186 | __entry->bytes_alloc, |
150 | __entry->gfp_flags, | 187 | show_gfp_flags(__entry->gfp_flags), |
151 | __entry->node) | 188 | __entry->node) |
152 | ); | 189 | ); |
153 | 190 | ||